st3v3nmw / obsidian-spaced-repetition Public
generated from obsidianmd/obsidian-sample-pluginHelp Translate
Stephen Mwangi edited this page Aug 29, 2021
·
3 revisions
Clone this wiki locally
Steps
To help translate the plugin to another language:
- Fork this repository,
- Copy the entries from
src/lang/locale/en.tsto the proper file inlocales(i.e.fr.tsfor French, orsw.tsfor Swahili), - Translate
- Then open a pull request.
- & a thank you for your time, much appreciated!
Translating
Sample en.ts file:
// English
export default {
EASY: "Easy",
SHOW_ANSWER: "Show Answer",
DAYS_STR_IVL: "${interval} days",
CHECK_ALGORITHM_WIKI: 'For more information, check the <a href="${algo_url}">algorithm implementation</a>.',
}Equivalent sw.ts file:
// Swahili
export default {
EASY: "Rahisi",
SHOW_ANSWER: "Onyesha Jibu",
DAYS_STR_IVL: "Siku ${interval}",
CHECK_ALGORITHM_WIKI: 'Kwa habari zaidi, angalia <a href="${algo_url}">utekelezaji wa algorithm</a>.',
}A part of that last one is uhh, Google translated, I have a working understanding of Swahili but not enough to write computerese lol.
Please note that:
- Only the strings(templates) on the right of the key should be translated.
- Text inside
${}isn't translated. This is used to replace variables in code. For instance, if interval = 4, it becomes4 daysin English &Siku 4in Swahili. Quite nifty if you ask me.