Supported Languages
Español (Spanish)
Default Language
res/values/strings.xmlApp name: MiTensionEnglish
English Translation
res/values-en/strings.xmlApp name: MyPressureGalego (Galician)
Galician Translation
res/values-gl/strings.xmlApp name: A miña TensiónHow It Works
Android’s resource system automatically selects the appropriate language based on the user’s device settings. If a translation isn’t available for the user’s language, the app falls back to Spanish (default).The app responds immediately to language changes without requiring a restart.
String Resources Structure
All user-facing text is stored in XML resource files organized by category:Resource Files Location
String Categories
App Basics
App Basics
Core app identification strings:Translations:
- Spanish: MiTension
- English: MyPressure
- Galician: A miña Tensión
Time Periods
Time Periods
Labels for the three daily measurement periods:English translations:
- Morning, Afternoon, Night
- Mañá, Tarde, Noite
Measurement Labels
Measurement Labels
Blood pressure measurement terminology:The app uses both long and short versions for different UI contexts.
Screen Titles
Screen Titles
Dynamic titles with parameter placeholders:
Action Buttons
Action Buttons
Calendar Navigation
Calendar Navigation
Messages and Feedback
Messages and Feedback
User feedback messages:
Notifications
Notifications
Push notification content:
Blood Pressure Legend
Blood Pressure Legend
Color-coded blood pressure classification:These classifications follow standard medical guidelines.
String Formatting
MiTensión uses Android’s string formatting for dynamic content:Format Specifiers
String Parameters
Use
%1$s, %2$s, etc. for string values:Integer Parameters
Use
%d or %1$d for numbers:Adding New Languages
To add support for a new language:Create Resource Directory
Create a new values directory with the language code:Common language codes:
values-fr- Frenchvalues-de- Germanvalues-pt- Portuguesevalues-it- Italian
Translation Guidelines
Follow these best practices when adding or updating translations.
Do’s and Don’ts
Maintain Consistency
Maintain Consistency
✅ Use consistent terminology throughout the app✅ Keep the same tone and formality level✅ Preserve parameter placeholders exactly❌ Don’t translate technical terms unnecessarily❌ Don’t change parameter order without updating code
Consider Text Length
Consider Text Length
Some languages use longer words than others. Consider:
- Button labels should be concise
- Allow for 30-40% text expansion
- Test UI layouts with different languages
- Use short versions where space is limited
Handle Plurals
Handle Plurals
For quantities that may be singular or plural, use plural resources:
Preserve Special Characters
Preserve Special Characters
XML special characters must be escaped:
&for &<for <>for >"for ”'or\'for ’
Accessing Strings in Code
In Composables
UsestringResource() in Jetpack Compose:
In ViewModels
Correct approach:In Background Workers
Workers have access to Context:Testing Translations
Manual Testing
Verify All Screens
Navigate through every screen and check:
- All text is translated
- No truncated text
- Layouts adjust properly
- Dialogs display correctly
Automated Testing
While automated translation testing is limited, you can verify resource completeness:Current Translation Coverage
Spanish
100% Complete52 strings
English
100% Complete52 strings
Galician
100% Complete52 strings
All supported languages have complete translation coverage with no missing strings.
Best Practices Summary
- Always translate all strings - Incomplete translations break the user experience
- Test with actual devices - Emulators may not catch all layout issues
- Keep strings.xml organized - Use comments to group related strings
- Avoid hardcoded text - Never put user-visible text directly in code
- Consider RTL languages - If adding Arabic or Hebrew, test right-to-left layouts
- Update all languages together - When adding new features, translate immediately
- Review translations - Have native speakers review translations when possible
Need Help?
For questions about internationalization:- Check the Contributing Guidelines
- Review Android’s Localization documentation
- Open an issue on GitHub for translation help