Thank you for your interest in helping translate Resonate! This guide will walk you through the process of adding translations to make the app accessible to users worldwide.
Resonate uses Flutter's internationalization (i18n) framework with ARB (Application Resource Bundle) files to manage translations. Currently, the app supports:
- English (en) - Primary language (template)
- Hindi (hi) - Secondary language
Before you begin translating, make sure you have:
- Flutter SDK installed on your system
- Git for version control
- Basic understanding of JSON syntax
- Familiarity with the target language and its cultural context
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/Resonate.git cd Resonate - Create a new branch for your translation work:
git checkout -b translation-YOUR_LANGUAGE_CODE
Translation files are located in the lib/l10n/ directory:
lib/l10n/
├── app_en.arb # English (template file)
├── app_hi.arb # Hindi
└── app_YOUR_LANGUAGE_CODE.arb # Your new translation
l10n.yaml- Configuration file for Flutter's localization systemuntranslated.txt- Lists untranslated messages (auto-generated)
-
Copy the template file:
cp lib/l10n/app_en.arb lib/l10n/app_YOUR_LANGUAGE_CODE.arb
-
Add the locale identifier at the beginning of your new file:
{ "@@locale": "YOUR_LANGUAGE_CODE", "title": "Resonate", ... }
Before translating, you need to register your new language in the app's configuration files:
Add your language code to the supportedLocales list in lib/main.dart:
supportedLocales: [
Locale('en'),
Locale('hi'),
Locale('YOUR_LANGUAGE_CODE'), // Add your language here
],Add your language code to the CFBundleLocalizations array in ios/Runner/Info.plist:
<key>CFBundleLocalizations</key>
<array>
<string>hi</string>
<string>en</string>
<string>YOUR_LANGUAGE_CODE</string> <!-- Add your language here -->
</array>Note:
- The order in both files doesn't matter, but it's recommended to maintain alphabetical order for consistency.
- For Android, no additional configuration is needed as Flutter automatically detects supported locales from the ARB files.
Open your new ARB file and translate each string value while keeping the keys unchanged.
{
"@@locale": "es",
"title": "Resonate",
"roomDescription": "Sé educado y respeta la opinión de la otra persona. Evita comentarios groseros.",
"hidePassword": "Ocultar Contraseña",
"showPassword": "Mostrar Contraseña",
"passwordEmpty": "La contraseña no puede estar vacía",
"password": "Contraseña"
}- Keep JSON keys unchanged - Only translate the values
- Preserve placeholders - Text like
{username}should remain unchanged - Maintain formatting - Preserve line breaks (
\n) and special characters - Handle metadata - Don't translate
@prefixed keys, but do translate description values
{
"welcomeMessage": "Welcome, {username}!",
"@welcomeMessage": {
"description": "Message shown to welcome the user",
"placeholders": {
"username": {
"type": "String",
"example": "John"
}
}
}
}Some strings use ICU message format for pluralization or selection:
{
"noAvailableRoom": "{isRoom, select, true{No Room Available} false{No Upcoming Room Available} other{No Room Information Available}}\nGet Started By Adding One Below!"
}Translate each option while maintaining the structure:
{
"noAvailableRoom": "{isRoom, select, true{Keine Räume verfügbar} false{Keine bevorstehenden Räume verfügbar} other{Keine Rauminformationen verfügbar}}\nBeginnen Sie, indem Sie unten einen hinzufügen!"
}-
Run the app with your translations:
flutter run
-
Generate localization files:
flutter gen-l10n
-
Check for untranslated strings:
- Review the generated
untranslated.txtfile - Ensure all required strings are translated
- Review the generated
Before submitting your translation:
- Accuracy - Translations convey the correct meaning
- Cultural appropriateness - Consider local customs and context
- Consistency - Use consistent terminology throughout
- Grammar and spelling - Check for linguistic errors
- JSON syntax - Validate your ARB file is valid JSON
- Placeholders preserved - All
{variable}placeholders intact - Metadata intact - All
@prefixed keys and structure preserved - App testing - Test the app with your language
# Validate JSON syntax
flutter pub get
flutter gen-l10n
# Check for missing translations
cat untranslated.txtgit add lib/l10n/app_YOUR_LANGUAGE_CODE.arb lib/main.dart ios/Runner/Info.plist
git commit -m "feat: add YOUR_LANGUAGE translation support
- Added complete translation for YOUR_LANGUAGE (YOUR_LANGUAGE_CODE)
- Translated all UI strings and messages
- Maintained placeholder and metadata structure
- Updated supportedLocales in main.dart
- Added language to iOS CFBundleLocalizations"-
Push your branch:
git push origin translation-YOUR_LANGUAGE_CODE
-
Create a Pull Request to the
devbranch with:- Clear title:
Add YOUR_LANGUAGE translation support - Description including:
- Language name and code
- Translation completion status
- Any cultural considerations or notes
- Screenshots if possible
- Clear title:
Your pull request will be reviewed for:
- Translation quality and accuracy
- Technical correctness
- Consistency with existing translations
- App functionality with the new language
To update an existing translation:
- Identify outdated strings in
untranslated.txt - Compare with template
app_en.arbfor new or changed strings - Update your language file with new translations
- Test thoroughly before submitting
Use standard language codes (ISO 639-1) for your translations:
| Language | Code | Example File |
|---|---|---|
| Arabic | ar | app_ar.arb |
| Chinese (Simplified) | zh | app_zh.arb |
| French | fr | app_fr.arb |
| German | de | app_de.arb |
| Japanese | ja | app_ja.arb |
| Portuguese | pt | app_pt.arb |
| Russian | ru | app_ru.arb |
| Spanish | es | app_es.arb |
- JSON validators - jsonlint.com
- ICU Message Format - Format.js
- Translation memory tools - CAT tools for consistency
If you encounter any issues or have questions:
- Check existing issues on GitHub for similar problems
- Create a new issue with the
translationlabel - Join our community discussions for translation-related questions
- Contact maintainers for complex translation decisions
All translators will be:
- Credited in the app's about section
- Mentioned in release notes
- Added to the contributors list
Thank you for helping make Resonate accessible to users around the world! 🌍