2.4 KiB
2.4 KiB
Localization Files
This directory contains translation files for the Personotes application.
Available Languages
- English (
en.json) - Default language - Français (
fr.json) - French translation
File Structure
Each language file is a JSON file with nested keys for organizing translations:
{
"app": {
"name": "Personotes",
"tagline": "Simple Markdown note-taking"
},
"menu": {
"home": "Home",
"search": "Search"
},
"errors": {
"internalError": "Internal error"
}
}
Adding a New Language
To add support for a new language:
- Create a new JSON file named with the language code (e.g.,
es.jsonfor Spanish,de.jsonfor German) - Copy the structure from
en.json - Translate all strings to the target language
- Keep placeholders intact: Use
{{variable}}syntax as-is (e.g.,{{filename}},{{date}}) - Test your translation by setting the language in the application
Language Codes
Use standard ISO 639-1 codes:
en- Englishfr- Français (French)es- Español (Spanish)de- Deutsch (German)it- Italiano (Italian)pt- Português (Portuguese)ja- 日本語 (Japanese)zh- 中文 (Chinese)
Variable Interpolation
Some strings contain variables in the format {{variableName}}. Keep these exactly as they are:
{
"editor": {
"confirmDelete": "Are you sure you want to delete this note ({{filename}})?"
}
}
In French:
{
"editor": {
"confirmDelete": "Êtes-vous sûr de vouloir supprimer cette note ({{filename}}) ?"
}
}
Guidelines for Translators
- Consistency: Use consistent terminology throughout
- Context: Consider the UI context (button labels should be short, help text can be longer)
- Formality: Match the tone of the original language
- Special Characters: Ensure proper encoding for special characters
- Testing: Test in the actual application to see how translations fit in the UI
Contributing
To contribute a new translation:
- Fork the repository
- Create your translation file (e.g.,
locales/es.json) - Add the language to
languagessection in your file:"languages": { "en": "English", "fr": "Français", "es": "Español" } - Update this README with your language
- Submit a pull request
Thank you for helping make Personotes accessible to more users! 🌍