-
-
Notifications
You must be signed in to change notification settings - Fork 8
Translations
EverShelf uses JSON translation files in the translations/ folder. The app auto-detects the browser language on load and falls back to English.
| Language | File | Status |
|---|---|---|
| ๐ฎ๐น Italian | translations/it.json |
โ Complete (base language) |
| ๐ฌ๐ง English | translations/en.json |
โ Complete |
| ๐ฉ๐ช German | translations/de.json |
โ Complete |
cp translations/it.json translations/fr.jsonOpen fr.json in your editor and translate every value (leave the keys unchanged).
{
"app": {
"name": "EverShelf",
"loading": "Chargement..." โ translate this
},
"nav": {
"title": "๐ EverShelf", โ keep emoji, translate text
"home": "Accueil"
}
}Rules:
- Never change the key names (left side of
:) - Keep
{placeholder}tokens unchanged โ they are replaced at runtime- Example:
"toast.added": "Added {name} to {location}"โ keep{name}and{location}
- Example:
- Keep HTML tags if present (rare):
<strong>,<br> - Keep emojis (they are part of the UX design)
- Plurals: some keys have
_one/_manyvariants โ translate both
Open assets/js/app.js and find the SUPPORTED_LANGUAGES constant (near the top):
const SUPPORTED_LANGUAGES = ['it', 'en', 'de'];Add your language code:
const SUPPORTED_LANGUAGES = ['it', 'en', 'de', 'fr'];Update the README.md badge:
[](translations/)Open the app with ?lang=fr in the URL to force your language:
http://localhost:8080/?lang=fr
Check for missing keys โ they will show the raw key name in the UI (e.g. nav.title).
Open a pull request with your new translations/fr.json and the updated app.js line. See Contributing.
The file is a nested JSON object. Here are the main sections:
| Section | Description |
|---|---|
app |
General app strings |
nav |
Navigation labels |
btn |
Button labels |
locations |
Storage location names |
categories |
Product category names |
dashboard |
Dashboard section titles |
inventory |
Inventory page strings |
use |
Use/consume form strings |
add |
Add product form strings |
scan |
Barcode scanner strings |
recipes |
Recipe page strings |
cooking |
Cooking mode strings |
shopping |
Shopping list strings |
log |
Transaction log strings |
settings |
Settings page strings |
scale |
Scale integration strings |
toast |
Toast notification messages |
error |
Error messages |
confirm |
Confirmation dialog strings |
If a new feature adds keys to it.json (the base), you need to add the same keys to en.json and de.json.
The CI pipeline validates that all language files contain the same keys โ a missing key will fail the build.
To check locally:
node -e "
const it = require('./translations/it.json');
const en = require('./translations/en.json');
// flatten and compare keys...
"Or just open a PR โ CI will flag any missing keys automatically.
-
?lang=xxURL parameter (forces a specific language) -
localStorage.getItem('lang')(last manually selected language) -
navigator.language/navigator.languages(browser preference) - Fallback:
en
Users can change the language in Settings โ Language.