1
0
mirror of https://github.com/vrtmrz/obsidian-livesync.git synced 2024-12-12 09:04:06 +02:00
obsidian-livesync/docs/adding_translations.md

1.4 KiB

How to add translations

Getting ready

  1. Clone this repository recursively.
git clone --recursive https://github.com/vrtmrz/obsidian-livesync
  1. Make ls-debug folder under your vault's .obsidian folder (as like .../dev/.obsidian/ls-debug).

Add translations for already defined terms

  1. Install dependencies, and build the plug-in as dev. build.
cd obsidian-livesync
npm i -D
npm run buildDev
  1. Copy the main.js to .obsidian/plugins/obsidian-livesync folder of your vault, and run Obsidian-Self-hosted LiveSync.
  2. You will get the missing-translation-yyyy-mm-dd.jsonl, please fill in new translations.
  3. Build the plug-in again, and confirm that displayed things were expected.
  4. Merge them into rosetta.ts, and make the PR to https://github.com/vrtmrz/livesync-commonlib.

Make messages to be translated

  1. Find the message that you want to be translated.
  2. Change the literal to a tagged template literal using $f, like below.
- Logger("Could not determine passphrase to save data.json! You probably make the configuration sure again!", LOG_LEVEL_URGENT);
+ Logger($f`Could not determine passphrase to save data.json! You probably make the configuration sure again!`, LOG_LEVEL_URGENT);
  1. Make the PR to https://github.com/vrtmrz/obsidian-livesync.
  2. Follow the steps of "Add translations for already defined terms" to add the translations.