From 6014b765f4d42585cd91d07887cc27fd64ae2880 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Sun, 9 Jul 2023 16:26:00 +0800 Subject: [PATCH] feat: close #2294 add documents for adding a new translation --- docs/translation.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/translation.md diff --git a/docs/translation.md b/docs/translation.md new file mode 100644 index 000000000..ebe1d6d76 --- /dev/null +++ b/docs/translation.md @@ -0,0 +1,12 @@ +# How to add a new translation? + +Assume that we are adding a new translation for `new`. + +1. copy `app/locales/en.ts` to `app/locales/new.ts`; +2. edit `new.ts`, change `const en: LocaleType = ` to `const new: PartialLocaleType`, and `export default new;`; +3. edit `app/locales/index.ts`: +4. `import new from './new.ts'`; +5. add `new` to `ALL_LANGS`; +6. add `new: "new lang"` to `ALL_LANG_OPTIONS`; +7. translate the strings in `new.ts`; +8. submit a pull request, and the author will merge it.