Skip to content

Commit

Permalink
feat: add translations for mobile-only texts
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-anders committed Jul 4, 2024
1 parent 7873304 commit 90ce9ef
Show file tree
Hide file tree
Showing 90 changed files with 8,583 additions and 1,871 deletions.
25 changes: 25 additions & 0 deletions docs/internationalisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,28 @@ flutter gen-l10n
```

You should see the new strings in the `lib/l10n/lila_*.arb` and `lib/l10n/lila_*.dart` files.

## Adding mobile-specific translations

> **Note**
>
> When working on a new feature, you should start with hardcoding English texts first. Once the feature is done,
> released and even used for a while, we can add translations, in order to avoid useless translating work.
There are some strings that appear only in this app, but not on lichess.org.

If you have a new string to be translated, add it to `translations/source.mobile.xml`. Make sure to include a `comment`
attribute, describing the usage of the string and its contents (e.g. placeholders). Some strings also must not exceed a
certain width due to UI constraints, use the `maxLength` attribute for that.

After updating translations as
described above, they can be used like the other translations, however a `mobile` prefix is added in dart. For example,
"foo" in `mobile.xml` turns into `mobileFoo` in dart.

> **Note**
>
> We do not translate error messages that are not critically important, such as "could not load XY" when screen "XY"
> failed to load. Translating work is done by a team of volunteers and we try to focus on quality rather than quantity.
> Such messages are mostly edge cases in the sense they should be rarely seen and people would understand that something
> went wrong and could not load without understanding the actual meaning of the error message.
40 changes: 40 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,46 @@
"mobileToolsTab": "Tools",
"mobileWatchTab": "Watch",
"mobileSettingsTab": "Settings",
"mobileMustBeLoggedIn": "You must be logged in to view this page.",
"mobileSystemColors": "System colors",
"mobileFeedbackButton": "Feedback",
"mobileOkButton": "OK",
"mobileSettingsHapticFeedback": "Haptic feedback",
"mobileSettingsImmersiveMode": "Immersive mode",
"mobileSettingsImmersiveModeSubtitle": "Hide system UI while playing. Use this if you are bothered by the system's navigation gestures at the edges of the screen. Applies to game and Puzzle Storm screens.",
"mobileNotFollowingAnyUser": "You are not following any user.",
"mobileAllGames": "All games",
"mobileRecentSearches": "Recent searches",
"mobileClearButton": "Clear",
"mobilePlayersMatchingSearchTerm": "Players with \"{param}\"",
"@mobilePlayersMatchingSearchTerm": {
"placeholders": {
"param": {
"type": "String"
}
}
},
"mobileNoSearchResults": "No results",
"mobileAreYouSure": "Are you sure?",
"mobilePuzzleStreakAbortWarning": "You will lose your current streak and your score will be saved.",
"mobilePuzzleStormNothingToShow": "Nothing to show. Play some runs of storm",
"mobileSharePuzzle": "Share this puzzle",
"mobileShareGameURL": "Share game URL",
"mobileShareGamePGN": "Share PGN",
"mobileSharePositionAsFEN": "Share position as FEN",
"mobileShowVariations": "Show variations",
"mobileHideVariation": "Hide variation",
"mobileShowComments": "Show comments",
"mobilePuzzleStormConfirmEndRun": "Do you want to end this run?",
"mobilePuzzleStormFilterNothingToShow": "Nothing to show, please change the filters",
"mobileCancelTakebackOffer": "Cancel takeback offer",
"mobileCancelDrawOffer": "Cancel draw offer",
"mobileWaitingForOpponentToJoin": "Waiting for opponent to join...",
"mobileBlindfoldMode": "Blindfold",
"mobileLiveStreamers": "Live streamers",
"mobileCustomGameJoinAGame": "Join a game",
"mobileCorrespondenceClearSavedMove": "Clear saved move",
"mobileSomethingWentWrong": "Something went wrong.",
"activityActivity": "Activity",
"activityHostedALiveStream": "Hosted a live stream",
"activityRankedInSwissTournament": "Ranked #{param1} in {param2}",
Expand Down
232 changes: 230 additions & 2 deletions lib/l10n/l10n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ abstract class AppLocalizations {
Locale('nn'),
Locale('pl'),
Locale('pt'),
Locale('pt', 'BR'),
Locale('pt', 'PT'),
Locale('ro'),
Locale('ru'),
Locale('sk'),
Expand All @@ -202,6 +202,234 @@ abstract class AppLocalizations {
Locale('zh', 'TW')
];

/// No description provided for @mobileHomeTab.
///
/// In en, this message translates to:
/// **'Home'**
String get mobileHomeTab;

/// No description provided for @mobilePuzzlesTab.
///
/// In en, this message translates to:
/// **'Puzzles'**
String get mobilePuzzlesTab;

/// No description provided for @mobileToolsTab.
///
/// In en, this message translates to:
/// **'Tools'**
String get mobileToolsTab;

/// No description provided for @mobileWatchTab.
///
/// In en, this message translates to:
/// **'Watch'**
String get mobileWatchTab;

/// No description provided for @mobileSettingsTab.
///
/// In en, this message translates to:
/// **'Settings'**
String get mobileSettingsTab;

/// No description provided for @mobileMustBeLoggedIn.
///
/// In en, this message translates to:
/// **'You must be logged in to view this page.'**
String get mobileMustBeLoggedIn;

/// No description provided for @mobileSystemColors.
///
/// In en, this message translates to:
/// **'System colors'**
String get mobileSystemColors;

/// No description provided for @mobileFeedbackButton.
///
/// In en, this message translates to:
/// **'Feedback'**
String get mobileFeedbackButton;

/// No description provided for @mobileOkButton.
///
/// In en, this message translates to:
/// **'OK'**
String get mobileOkButton;

/// No description provided for @mobileSettingsHapticFeedback.
///
/// In en, this message translates to:
/// **'Haptic feedback'**
String get mobileSettingsHapticFeedback;

/// No description provided for @mobileSettingsImmersiveMode.
///
/// In en, this message translates to:
/// **'Immersive mode'**
String get mobileSettingsImmersiveMode;

/// No description provided for @mobileSettingsImmersiveModeSubtitle.
///
/// In en, this message translates to:
/// **'Hide system UI while playing. Use this if you are bothered by the system\'s navigation gestures at the edges of the screen. Applies to game and Puzzle Storm screens.'**
String get mobileSettingsImmersiveModeSubtitle;

/// No description provided for @mobileNotFollowingAnyUser.
///
/// In en, this message translates to:
/// **'You are not following any user.'**
String get mobileNotFollowingAnyUser;

/// No description provided for @mobileAllGames.
///
/// In en, this message translates to:
/// **'All games'**
String get mobileAllGames;

/// No description provided for @mobileRecentSearches.
///
/// In en, this message translates to:
/// **'Recent searches'**
String get mobileRecentSearches;

/// No description provided for @mobileClearButton.
///
/// In en, this message translates to:
/// **'Clear'**
String get mobileClearButton;

/// No description provided for @mobilePlayersMatchingSearchTerm.
///
/// In en, this message translates to:
/// **'Players with \"{param}\"'**
String mobilePlayersMatchingSearchTerm(String param);

/// No description provided for @mobileNoSearchResults.
///
/// In en, this message translates to:
/// **'No results'**
String get mobileNoSearchResults;

/// No description provided for @mobileAreYouSure.
///
/// In en, this message translates to:
/// **'Are you sure?'**
String get mobileAreYouSure;

/// No description provided for @mobilePuzzleStreakAbortWarning.
///
/// In en, this message translates to:
/// **'You will lose your current streak and your score will be saved.'**
String get mobilePuzzleStreakAbortWarning;

/// No description provided for @mobilePuzzleStormNothingToShow.
///
/// In en, this message translates to:
/// **'Nothing to show. Play some runs of storm'**
String get mobilePuzzleStormNothingToShow;

/// No description provided for @mobileSharePuzzle.
///
/// In en, this message translates to:
/// **'Share this puzzle'**
String get mobileSharePuzzle;

/// No description provided for @mobileShareGameURL.
///
/// In en, this message translates to:
/// **'Share game URL'**
String get mobileShareGameURL;

/// No description provided for @mobileShareGamePGN.
///
/// In en, this message translates to:
/// **'Share PGN'**
String get mobileShareGamePGN;

/// No description provided for @mobileSharePositionAsFEN.
///
/// In en, this message translates to:
/// **'Share position as FEN'**
String get mobileSharePositionAsFEN;

/// No description provided for @mobileShowVariations.
///
/// In en, this message translates to:
/// **'Show variations'**
String get mobileShowVariations;

/// No description provided for @mobileHideVariation.
///
/// In en, this message translates to:
/// **'Hide variation'**
String get mobileHideVariation;

/// No description provided for @mobileShowComments.
///
/// In en, this message translates to:
/// **'Show comments'**
String get mobileShowComments;

/// No description provided for @mobilePuzzleStormConfirmEndRun.
///
/// In en, this message translates to:
/// **'Do you want to end this run?'**
String get mobilePuzzleStormConfirmEndRun;

/// No description provided for @mobilePuzzleStormFilterNothingToShow.
///
/// In en, this message translates to:
/// **'Nothing to show, please change the filters'**
String get mobilePuzzleStormFilterNothingToShow;

/// No description provided for @mobileCancelTakebackOffer.
///
/// In en, this message translates to:
/// **'Cancel takeback offer'**
String get mobileCancelTakebackOffer;

/// No description provided for @mobileCancelDrawOffer.
///
/// In en, this message translates to:
/// **'Cancel draw offer'**
String get mobileCancelDrawOffer;

/// No description provided for @mobileWaitingForOpponentToJoin.
///
/// In en, this message translates to:
/// **'Waiting for opponent to join...'**
String get mobileWaitingForOpponentToJoin;

/// No description provided for @mobileBlindfoldMode.
///
/// In en, this message translates to:
/// **'Blindfold'**
String get mobileBlindfoldMode;

/// No description provided for @mobileLiveStreamers.
///
/// In en, this message translates to:
/// **'Live streamers'**
String get mobileLiveStreamers;

/// No description provided for @mobileCustomGameJoinAGame.
///
/// In en, this message translates to:
/// **'Join a game'**
String get mobileCustomGameJoinAGame;

/// No description provided for @mobileCorrespondenceClearSavedMove.
///
/// In en, this message translates to:
/// **'Clear saved move'**
String get mobileCorrespondenceClearSavedMove;

/// No description provided for @mobileSomethingWentWrong.
///
/// In en, this message translates to:
/// **'Something went wrong.'**
String get mobileSomethingWentWrong;

/// No description provided for @activityActivity.
///
/// In en, this message translates to:
Expand Down Expand Up @@ -7850,7 +8078,7 @@ AppLocalizations lookupAppLocalizations(Locale locale) {
}
case 'pt': {
switch (locale.countryCode) {
case 'BR': return AppLocalizationsPtBr();
case 'PT': return AppLocalizationsPtPt();
}
break;
}
Expand Down
Loading

0 comments on commit 90ce9ef

Please sign in to comment.