π End-to-end encrypted cloud for everything.
Ente strings
This package contains the user-facing strings and translations shared by the Auth, Locker, and Photos apps. Flutter's localization generator turns the ARB files in lib/l10n/arb into the Dart files in lib/l10n.
Translate
The strings can be translated in the Ente Mobile Crowdin project.
If your language is not listed, request it on GitHub.
Partial translations are welcome; apps generally enable a language after about 90% of their reachable strings are translated.
Add a string
Add the key and English text to
strings_en.arb:{ "existingKey": "Existing text", "newStringKey": "Your new string text" }Run
flutter gen-l10nfrommobile/packages/strings.Import the package in the app code:
import "package:ente_strings/ente_strings.dart";Read the string from a
BuildContext:context.strings.newStringKeyCommit the ARB and app changes.
After the pull request merges, the source workflow will upload the new string to Crowdin.
Plurals
Use the locale-aware one and other categories instead of =1:
"photosCount": "{count, plural, =0{No photos} one{{count} photo} other{{count} photos}}"
=0, one, and other can be used together. Exact selectors are evaluated first; one is a locale category and does not always mean exactly 1. When displaying the number, use the placeholder rather than hardcoding it in a plural branch.
Update a string
[!WARNING]
Updating a source string (English) invalidates all its translations.
- Update its English text in
strings_en.arb. - Run
flutter gen-l10nfrommobile/packages/strings. - Commit the ARB change.
After the pull request merges, the source workflow will update the string in Crowdin.
Delete a string
- Remove or replace every use of the string in the app code.
- Remove its value and any corresponding
@keyentry fromstrings_en.arb. - Run
flutter gen-l10nfrommobile/packages/strings. - Commit the ARB and app changes.
After the pull request merges, the source workflow will remove the string from Crowdin. The next translation sync will remove it from the translated ARB files.