spacedrive/interface/locales
2024-05-09 15:43:37 +03:00
..
ar fix size keys i8n 2024-05-09 15:43:37 +03:00
be fix size keys i8n 2024-05-09 15:43:37 +03:00
de fix size keys i8n 2024-05-09 15:43:37 +03:00
en fix size keys i8n 2024-05-09 15:43:37 +03:00
es fix size keys i8n 2024-05-09 15:43:37 +03:00
fr fix size keys i8n 2024-05-09 15:43:37 +03:00
it fix size keys i8n 2024-05-09 15:43:37 +03:00
ja fix size keys i8n 2024-05-09 15:43:37 +03:00
nl fix size keys i8n 2024-05-09 15:43:37 +03:00
ru fix size keys i8n 2024-05-09 15:43:37 +03:00
tr fix size keys i8n 2024-05-09 15:43:37 +03:00
zh-CN fix size keys i8n 2024-05-09 15:43:37 +03:00
zh-TW fix size keys i8n 2024-05-09 15:43:37 +03:00
i18nnext.d.ts [ENG-1502] I18n (#1897) 2024-01-08 20:26:46 +00:00
README.md Media metadata extraction & Thumbnailer rework (#2285) 2024-05-09 02:20:28 +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 all locales with the source language (en) and update missing keys.

pnpm i18n:sync