Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new language #239

Open
BaseMax opened this issue Mar 25, 2022 · 3 comments
Open

Adding new language #239

BaseMax opened this issue Mar 25, 2022 · 3 comments

Comments

@BaseMax
Copy link

BaseMax commented Mar 25, 2022

Hi there,
Adding new languages welcomed?
What format and structure followed for languages?

@AlperBayraktar
Copy link
Contributor

I created this instruction and tested it to verify if it works.

  • In public/locales:

    • create a folder with language's short name
    • provide needed files and values in that folder by looking to another language supports in public/locales. Currently, common.json and editor.json files need to be provided.
  • In data\:

    • Create file in data folder with this format: section-templates-languageshortnamelowercase_LANGUAGESHORTNAMEUPPERCASE.js For example, English language support is written as data\section-templates-en_EN.js. Copy a language code from a file in data folder, update language name and values.
    • In data\index.js
      • import your language section data from the file you created in previous step in format of import { languageshortnamelowercase_LANGUAGESHORTNAMEUPPERCASE } from './section-templates-languageshortnamelowercase_LANGUAGESHORTNAMEUPPERCASE'. For example, English language support is written as `import { en_EN } from './section-templates-en_EN'.
      • add your language to module.exports in a format of: short_name_lowercase: shortnamelowercase_shortnameuppercase. For example, English language support is written as en: en_EN
  • In components\LanguageDropDown.js, add language's name as label and short name as route

  • Add language's short name to next-i18next.config.js's locales array.

@BaseMax
Copy link
Author

BaseMax commented Sep 2, 2022

Good job @AlperBayraktar

@AlperBayraktar
Copy link
Contributor

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants