Extract ' t("string")
' from the scripts in the folder and generate one JSON file.
- logseq-l10n: L10N framework for Logseq plugins
- Clone this repo.
- Run command '
pnpm install
'. - Edit "config.js".
- Enclose all strings to be translated in the scripts with '
t("string")
'.. - Create a "
translations
" folder. - Enter "targetFolderPath" in "config.js".
- Run '
node index.cjs
' command in terminal. - One File will be created in the target folder.
If a file with the same name exists, it will be updated.
import { setup as l10nSetup , t } from "logseq-l10n"
const main = async () => {
//await l10nSetup({builtinTranslations: { }})
// Use `t` for text with translations.
console.log(t("Hello world!"))
logseq.UI.showMsg(t("Success"), "success")
}
- Translation > logseq-l10n-clone-json: Clone JSON files for Logseq full languages based on one translation file