Files
memos-bber/js/i18n.js
T
jonny c8bdb918f3 Display supported Memos version in popup
Add a localized notice for supported Memos versions and render it in the extension popup. Introduce the "supportedMemosVersion" message in en and zh_CN (shows compatibility: v0.24.0+ and tested versions), add a corresponding div to popup.html, and wire it up in js/i18n.js so the text is populated via i18n.
2026-03-05 18:17:36 +08:00

50 lines
1.3 KiB
JavaScript

function getMessage(key) {
return chrome.i18n.getMessage(key) || ''
}
function setText(id, messageKey) {
const el = document.getElementById(id)
if (el) el.textContent = getMessage(messageKey)
}
function setPlaceholder(id, messageKey) {
const el = document.getElementById(id)
if (el) el.placeholder = getMessage(messageKey)
}
function setTitle(id, messageKey) {
const el = document.getElementById(id)
if (el) el.title = getMessage(messageKey)
}
setText("saveKey", "saveBtn")
setText("saveTag", "saveBtn")
setText("supportedMemosVersion", "supportedMemosVersion")
setPlaceholder("apiUrl", "placeApiUrl")
setPlaceholder("apiTokens", "placeApiTokens")
setPlaceholder("content", "placeContent")
setText("lockPrivate", "lockPrivate")
setText("lockProtected", "lockProtected")
setText("lockPublic", "lockPublic")
setText("content_submit_text", "submitBtn")
setPlaceholder("hideInput", "placeHideInput")
setPlaceholder("showInput", "placeShowInput")
setText("uploadlist-title", "uploadedListTitle")
// Native hover tooltips (title)
setTitle("opensite", "tipOpenSite")
setTitle("blog_info_edit", "tipSettings")
setTitle("tags", "tipTags")
setTitle("newtodo", "tipTodo")
setTitle("upres", "tipUpload")
setTitle("getlink", "tipLink")
setTitle("random", "tipRandom")
setTitle("search", "tipSearch")
setTitle("lock", "tipVisibility")
setTitle("content_submit_text", "tipSend")