-
create a folder in the
locales
directory, where the name of this new folder should contain the code of the language. (e.gde_DE
for German language ornl_NL
for Dutch). language codes can be found here. -
create
index.js
file in the new directory. -
copy
index.js
content from theen_US
(english) folder and edit the code and the content. -
open
locales/locales.js
file from the locales directory and import the new file like the rest. -
for the
docs
all you have to do is copydocs.md
fromen_US
folder to the new language directory and start editing the content. (e.gde_DE/docs.md
)
Run the app in dev mode to test.
The original english translation file.
en_US/index.js
const en_US = {
language_name: "English",
sub_title: "simple, fast, secure client-side file encryption",
};
export default en_US;
Copy en_US
file content and create new language folder and file :
de_DE/index.js
const de_DE = {
language_name: "Deutsch",
sub_title: "Einfache, schnelle, sichere Client-seitige Dateiverschlüsselung",
};
export default de_DE;
then import the new file in locales.js
import en_US from "./en_US";
import de_DE from "./de_DE";
const locales = {
en_US,
de_DE,
};
export default locales;