mirror of
https://git.netzspielplatz.de/docker-multiarch/openwrt-firmware-selector.git
synced 2025-11-08 23:59:32 +00:00
adds translation support via i18n.js
Uses react-i18next library to provide APIs for translational
purposes.
Translation data is loaded from `src/locales/{{lng}}/translation.json`
and is accessed by dot notation.
The data can be translated in two ways:
1. In functional components, a method `t` can be instantiated using the
`useTranslation` method from rect-18next.
2. In class components, a method `t` can be accessed via props while
exporting the component with `withTranslation` method from react-i18next
library.
The syntax will look like `t('data.data')` or `this.props.t('data.data')`
Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
This commit is contained in:
parent
8f68dc328e
commit
07b13c3f7a
10 changed files with 156 additions and 54 deletions
20
src/locales/de/translation.json
Normal file
20
src/locales/de/translation.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"title": "OpenWrt Firmware Selector Wizard",
|
||||
"appIntro": {
|
||||
"head": "Laden Sie die OpenWrt-Firmware für Ihr Gerät herunter!",
|
||||
"para": "Bitte benutzen Sie den unten stehenden Eingang, um die Firmware für Ihr Gerät herunterzuladen!"
|
||||
},
|
||||
"components": {
|
||||
"submit": "einreichen",
|
||||
"changeLanguage": "Sprache ändern",
|
||||
"select": {
|
||||
"placeholder": "Wählen...",
|
||||
"noOptions": "Keine Optionen"
|
||||
}
|
||||
},
|
||||
"table": {
|
||||
"model": "Modell",
|
||||
"vendor": "Verkäufer",
|
||||
"variant": "Variante"
|
||||
}
|
||||
}
|
||||
20
src/locales/en/translation.json
Normal file
20
src/locales/en/translation.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"title": "OpenWrt Firmware Selector Wizard",
|
||||
"appIntro": {
|
||||
"head": "Download OpenWrt firmware for your device!",
|
||||
"para": "Please use the input below to download firmware for your device!"
|
||||
},
|
||||
"components": {
|
||||
"submit": "Submit",
|
||||
"changeLanguage": "Change Language",
|
||||
"select": {
|
||||
"placeholder": "Select...",
|
||||
"noOptions": "No options"
|
||||
}
|
||||
},
|
||||
"table": {
|
||||
"model": "Model",
|
||||
"vendor": "Vendor",
|
||||
"variant": "Variant"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue