mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-19 19:16:01 +00:00
1.5 KiB
1.5 KiB
How to add translations
Getting ready
- Clone the Commonlib repository, which owns the translation catalogue.
git clone https://github.com/vrtmrz/livesync-commonlib
- Make
ls-debugfolder under your vault's.obsidianfolder (as like.../dev/.obsidian/ls-debug).
Add translations for already defined terms
- Install dependencies, and build the plug-in as dev. build.
cd livesync-commonlib
npm ci
npm run i18n:bake
- Install the resulting packed Commonlib artefact in a Self-hosted LiveSync development checkout, build the plug-in, copy
main.jsto.obsidian/plugins/obsidian-livesyncin your test Vault, and run Self-hosted LiveSync. - You will get the
missing-translation-yyyy-mm-dd.jsonl, please fill in new translations. - Build the plug-in again, and confirm that displayed things were expected.
- Add the translations to the Commonlib catalogue, run
npm run i18n:bake, and make the pull request tohttps://github.com/vrtmrz/livesync-commonlib.
Make messages to be translated
- Find the message that you want to be translated.
- Change the literal to use
$tf, like below.
- Logger("Could not determine passphrase to save data.json! You probably make the configuration sure again!", LOG_LEVEL_URGENT);
+ Logger($tf('someKeyForPassphraseError'), LOG_LEVEL_URGENT);
- Make the PR to
https://github.com/vrtmrz/obsidian-livesync. - Follow the steps of "Add translations for already defined terms" to add the translations.