spacedrive/interface/locales
Artsiom Voitas 2d78edef4d
Added even more i18n translation keys (#2453)
* more translation keys

* added i18n keys for future ObjectKindEnum translation

* more keys

* added more keys

* synced all new translation keys with all languages, translated keys on Belarusian and Russian

* added translation for objectkinds in overview

* added translation function for objectkinds

* added more keys to german locale

* renamed 'asc' and 'desc' keys

* rolled back changes

* added missed key

* there are much more keys, than you can imagine

* fixed misspelling

* removed console.log

* removed function "pluralize", added required plural words keys for each language

* fixed condition, which could've lead to undefined value

* hide filter description for boolean filters
2024-05-04 16:16:49 +00:00
..
ar Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
be Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
de Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
en Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
es Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
fr Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
it Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
ja Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
nl Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
ru Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
tr Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
zh-CN Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
zh-TW Added even more i18n translation keys (#2453) 2024-05-04 16:16:49 +00:00
i18nnext.d.ts [ENG-1502] I18n (#1897) 2024-01-08 20:26:46 +00:00
README.md [feat]: i18n contribution to include mention of dayjsLocales (#2444) 2024-05-03 01:53:21 +00:00

Locales

This directory contains the translations for the application.

Adding a new language

To add a new language, create a new directory with the language code (e.g. es for Spanish) and copy the en directory into it. Then, translate the strings in the new directory.

To display the new language as an option in the application, add the language code to the LANGUAGE_OPTIONS array in interface/app/$libraryId/settings/client/appearance.tsx.

export const LANGUAGE_OPTIONS = [
  { value: 'en', label: 'English' },
  { value: 'es', label: 'Español' },
  // The rest of the languages
];

Finally, add the new language code to the dayjsLocales object in interface/locales/index.ts. list of dayjs locales can be found here

const dayjsLocales: Record<string, any> = {
  // Add the new language code and import statement here
  // Example:
  // es: () => import('dayjs/locale/es.js'),
  en: () => import('dayjs/locale/en.js'),
  de: () => import('dayjs/locale/de.js'),
  // The rest of the languages
};

Syncing locales

This command will help you sync locales with the source language (en) and find missing keys.

npx i18next-locales-sync -p en -s it -l ./interface/locales

replace it with the language you want to sync with the source language.