We welcome contributions for translating our application into various languages. If you'd like to help with translations, please follow these steps.
-
Look for the
./src/utils/translations
directory to find existing translations. If you didn't find the language you interested in then proceed to step 2. -
Create a new file for the language by duplicating the
./src/utils/translations/ru.ts
file. Name it using the language code (e.g.,fr.ts
for French translations). -
Translate the keys into your language. Remember to also change the language code in first the line:
const ru = {
And at the end of the file:
export default ru;
-
Import translation file in the
./src/utils/translations.ts
. Import the generated file like this:import en from "./translations/en"; import ru from "./translations/ru";
-
Add the language to the
supportedLanguages
map like this, to show this language in the app's menu:export const supportedLanguages = new Map([ ["en", "english"], ["ru", "русский"], ]);
-
Add language to
resources
like this:resources: { en: { translation: en, }, ru: { translation: ru, }, },
-
Add language to
fallbackLng
like this:fallbackLng: { ru: ["ru"], default: [defaultLanguageCode], },
-
Open the file
./src/utils/datetime.ts
. Import the locale fromdate-fns/locale
as follows:import { enUS, ru } from "date-fns/locale";
-
And add the locale to the
locales
variable like this:const locales = new Map([ ["en", enUS], ["ru", ru], ]);
-
Build the project (see instructions here).
-
Check the work of the
formatter
andlinter
. To do this, use the following commands:npm run fmt npm run lint
-
Make a Pull Request with the translated file.
- Please ensure accuracy and maintain consistency with the existing translations.
- Add comments to clarify if necessary.
- Respect the original meaning when translating phrases.