mirror of
https://github.com/Jonnyan404/memos-bber.git
synced 2026-04-25 03:58:37 +09:00
c8bdb918f3
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.
50 lines
1.3 KiB
JavaScript
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") |