Skip to content

Wrap up translating all strings #1325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,21 @@
"filename": {"type": "String", "example": "file.txt"}
}
},
"filenameAndSizeInMiB": "{filename}: {size} MiB",
"@filenameAndSizeInMiB": {
"description": "The name of a file, and its size in mebibytes.",
"placeholders": {
"filename": {"type": "String", "example": "foo.txt"},
"size": {"type": "String", "example": "20.2"}
}
},
"errorFilesTooLarge": "{num, plural, =1{File is} other{{num} files are}} larger than the server's limit of {maxFileUploadSizeMib} MiB and will not be uploaded:\n\n{listMessage}",
"@errorFilesTooLarge": {
"description": "Error message when attached files are too large in size.",
"placeholders": {
"num": {"type": "int", "example": "2"},
"maxFileUploadSizeMib": {"type": "int", "example": "15"},
"listMessage": {"type": "String", "example": "foo.txt\nbar.txt"}
"listMessage": {"type": "String", "example": "foo.txt: 10.1 MiB\nbar.txt 20.2 MiB"}
}
},
"errorFilesTooLargeTitle": "{num, plural, =1{File} other{Files}} too large",
Expand Down Expand Up @@ -475,9 +483,9 @@
"@loginAddAnAccountPageTitle": {
"description": "Title for page to add a Zulip account."
},
"loginServerUrlInputLabel": "Your Zulip server URL",
"@loginServerUrlInputLabel": {
"description": "Input label in login page for Zulip server URL entry."
"loginServerUrlLabel": "Your Zulip server URL",
"@loginServerUrlLabel": {
"description": "Label in login page for Zulip server URL entry."
},
"loginHidePassword": "Hide password",
"@loginHidePassword": {
Expand Down Expand Up @@ -808,5 +816,13 @@
"scrollToBottomTooltip": "Scroll to bottom",
"@scrollToBottomTooltip": {
"description": "Tooltip for button to scroll to bottom."
},
"appVersionUnknownPlaceholder": "(…)",
"@appVersionUnknownPlaceholder": {
"description": "Placeholder to show in place of the app version when it is unknown."
},
"zulipAppTitle": "Zulip",
"@zulipAppTitle": {
"description": "The name of Zulip. This should be either 'Zulip' or a transliteration."
}
}
6 changes: 3 additions & 3 deletions assets/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@
"@loginAddAnAccountPageTitle": {
"description": "Title for page to add a Zulip account."
},
"loginServerUrlInputLabel": "URL serwera Zulip",
"@loginServerUrlInputLabel": {
"description": "Input label in login page for Zulip server URL entry."
"loginServerUrlLabel": "URL serwera Zulip",
"@loginServerUrlLabel": {
"description": "Label in login page for Zulip server URL entry."
},
"loginHidePassword": "Ukryj hasło",
"@loginHidePassword": {
Expand Down
6 changes: 3 additions & 3 deletions assets/l10n/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@
"@loginAddAnAccountPageTitle": {
"description": "Title for page to add a Zulip account."
},
"loginServerUrlInputLabel": "URL вашего сервера Zulip",
"@loginServerUrlInputLabel": {
"description": "Input label in login page for Zulip server URL entry."
"loginServerUrlLabel": "URL вашего сервера Zulip",
"@loginServerUrlLabel": {
"description": "Label in login page for Zulip server URL entry."
},
"loginHidePassword": "Скрыть пароль",
"@loginHidePassword": {
Expand Down
6 changes: 3 additions & 3 deletions assets/l10n/app_sk.arb
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
}
}
},
"loginServerUrlInputLabel": "Adresa vášho Zulip servera",
"@loginServerUrlInputLabel": {
"description": "Input label in login page for Zulip server URL entry."
"loginServerUrlLabel": "Adresa vášho Zulip servera",
"@loginServerUrlLabel": {
"description": "Label in login page for Zulip server URL entry."
},
"errorMessageNotSent": "Správa nebola odoslaná",
"@errorMessageNotSent": {
Expand Down
22 changes: 20 additions & 2 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ abstract class ZulipLocalizations {
/// **'Failed to upload file: {filename}'**
String errorFailedToUploadFileTitle(String filename);

/// The name of a file, and its size in mebibytes.
///
/// In en, this message translates to:
/// **'{filename}: {size} MiB'**
String filenameAndSizeInMiB(String filename, String size);

/// Error message when attached files are too large in size.
///
/// In en, this message translates to:
Expand Down Expand Up @@ -735,11 +741,11 @@ abstract class ZulipLocalizations {
/// **'Add an account'**
String get loginAddAnAccountPageTitle;

/// Input label in login page for Zulip server URL entry.
/// Label in login page for Zulip server URL entry.
///
/// In en, this message translates to:
/// **'Your Zulip server URL'**
String get loginServerUrlInputLabel;
String get loginServerUrlLabel;

/// Icon label for button to hide password in input form.
///
Expand Down Expand Up @@ -1190,6 +1196,18 @@ abstract class ZulipLocalizations {
/// In en, this message translates to:
/// **'Scroll to bottom'**
String get scrollToBottomTooltip;

/// Placeholder to show in place of the app version when it is unknown.
///
/// In en, this message translates to:
/// **'(…)'**
String get appVersionUnknownPlaceholder;

/// The name of Zulip. This should be either 'Zulip' or a transliteration.
///
/// In en, this message translates to:
/// **'Zulip'**
String get zulipAppTitle;
}

class _ZulipLocalizationsDelegate extends LocalizationsDelegate<ZulipLocalizations> {
Expand Down
13 changes: 12 additions & 1 deletion lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
return 'Failed to upload file: $filename';
}

@override
String filenameAndSizeInMiB(String filename, String size) {
return '$filename: $size MiB';
}

@override
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage) {
String _temp0 = intl.Intl.pluralLogic(
Expand Down Expand Up @@ -370,7 +375,7 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get loginAddAnAccountPageTitle => 'Add an account';

@override
String get loginServerUrlInputLabel => 'Your Zulip server URL';
String get loginServerUrlLabel => 'Your Zulip server URL';

@override
String get loginHidePassword => 'Hide password';
Expand Down Expand Up @@ -632,4 +637,10 @@ class ZulipLocalizationsAr extends ZulipLocalizations {

@override
String get scrollToBottomTooltip => 'Scroll to bottom';

@override
String get appVersionUnknownPlaceholder => '(…)';

@override
String get zulipAppTitle => 'Zulip';
}
13 changes: 12 additions & 1 deletion lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
return 'Failed to upload file: $filename';
}

@override
String filenameAndSizeInMiB(String filename, String size) {
return '$filename: $size MiB';
}

@override
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage) {
String _temp0 = intl.Intl.pluralLogic(
Expand Down Expand Up @@ -370,7 +375,7 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
String get loginAddAnAccountPageTitle => 'Add an account';

@override
String get loginServerUrlInputLabel => 'Your Zulip server URL';
String get loginServerUrlLabel => 'Your Zulip server URL';

@override
String get loginHidePassword => 'Hide password';
Expand Down Expand Up @@ -632,4 +637,10 @@ class ZulipLocalizationsEn extends ZulipLocalizations {

@override
String get scrollToBottomTooltip => 'Scroll to bottom';

@override
String get appVersionUnknownPlaceholder => '(…)';

@override
String get zulipAppTitle => 'Zulip';
}
13 changes: 12 additions & 1 deletion lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
return 'Failed to upload file: $filename';
}

@override
String filenameAndSizeInMiB(String filename, String size) {
return '$filename: $size MiB';
}

@override
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage) {
String _temp0 = intl.Intl.pluralLogic(
Expand Down Expand Up @@ -370,7 +375,7 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
String get loginAddAnAccountPageTitle => 'Add an account';

@override
String get loginServerUrlInputLabel => 'Your Zulip server URL';
String get loginServerUrlLabel => 'Your Zulip server URL';

@override
String get loginHidePassword => 'Hide password';
Expand Down Expand Up @@ -632,4 +637,10 @@ class ZulipLocalizationsJa extends ZulipLocalizations {

@override
String get scrollToBottomTooltip => 'Scroll to bottom';

@override
String get appVersionUnknownPlaceholder => '(…)';

@override
String get zulipAppTitle => 'Zulip';
}
13 changes: 12 additions & 1 deletion lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
return 'Failed to upload file: $filename';
}

@override
String filenameAndSizeInMiB(String filename, String size) {
return '$filename: $size MiB';
}

@override
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage) {
String _temp0 = intl.Intl.pluralLogic(
Expand Down Expand Up @@ -370,7 +375,7 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
String get loginAddAnAccountPageTitle => 'Add an account';

@override
String get loginServerUrlInputLabel => 'Your Zulip server URL';
String get loginServerUrlLabel => 'Your Zulip server URL';

@override
String get loginHidePassword => 'Hide password';
Expand Down Expand Up @@ -632,4 +637,10 @@ class ZulipLocalizationsNb extends ZulipLocalizations {

@override
String get scrollToBottomTooltip => 'Scroll to bottom';

@override
String get appVersionUnknownPlaceholder => '(…)';

@override
String get zulipAppTitle => 'Zulip';
}
13 changes: 12 additions & 1 deletion lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
return 'Nie udało się załadować pliku: $filename';
}

@override
String filenameAndSizeInMiB(String filename, String size) {
return '$filename: $size MiB';
}

@override
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage) {
String _temp0 = intl.Intl.pluralLogic(
Expand Down Expand Up @@ -370,7 +375,7 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
String get loginAddAnAccountPageTitle => 'Dodaj konto';

@override
String get loginServerUrlInputLabel => 'URL serwera Zulip';
String get loginServerUrlLabel => 'URL serwera Zulip';

@override
String get loginHidePassword => 'Ukryj hasło';
Expand Down Expand Up @@ -632,4 +637,10 @@ class ZulipLocalizationsPl extends ZulipLocalizations {

@override
String get scrollToBottomTooltip => 'Przewiń do dołu';

@override
String get appVersionUnknownPlaceholder => '(…)';

@override
String get zulipAppTitle => 'Zulip';
}
13 changes: 12 additions & 1 deletion lib/generated/l10n/zulip_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
return 'Не удалось загрузить файл: $filename';
}

@override
String filenameAndSizeInMiB(String filename, String size) {
return '$filename: $size MiB';
}

@override
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage) {
String _temp0 = intl.Intl.pluralLogic(
Expand Down Expand Up @@ -370,7 +375,7 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
String get loginAddAnAccountPageTitle => 'Добавление учетной записи';

@override
String get loginServerUrlInputLabel => 'URL вашего сервера Zulip';
String get loginServerUrlLabel => 'URL вашего сервера Zulip';

@override
String get loginHidePassword => 'Скрыть пароль';
Expand Down Expand Up @@ -632,4 +637,10 @@ class ZulipLocalizationsRu extends ZulipLocalizations {

@override
String get scrollToBottomTooltip => 'Scroll to bottom';

@override
String get appVersionUnknownPlaceholder => '(…)';

@override
String get zulipAppTitle => 'Zulip';
}
13 changes: 12 additions & 1 deletion lib/generated/l10n/zulip_localizations_sk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
return 'Nepodarilo sa nahrať súbor: $filename';
}

@override
String filenameAndSizeInMiB(String filename, String size) {
return '$filename: $size MiB';
}

@override
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage) {
String _temp0 = intl.Intl.pluralLogic(
Expand Down Expand Up @@ -370,7 +375,7 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
String get loginAddAnAccountPageTitle => 'Pridať účet';

@override
String get loginServerUrlInputLabel => 'Adresa vášho Zulip servera';
String get loginServerUrlLabel => 'Adresa vášho Zulip servera';

@override
String get loginHidePassword => 'Skryť heslo';
Expand Down Expand Up @@ -632,4 +637,10 @@ class ZulipLocalizationsSk extends ZulipLocalizations {

@override
String get scrollToBottomTooltip => 'Scroll to bottom';

@override
String get appVersionUnknownPlaceholder => '(…)';

@override
String get zulipAppTitle => 'Zulip';
}
6 changes: 6 additions & 0 deletions lib/licenses.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ Stream<LicenseEntry> additionalLicenses() async* {
rootBundle.loadString('assets/Pygments/AUTHORS.txt'),
]);

// This does not need to be translated, as it is just a small fragment
// of text surrounded by a large quantity of English text that isn't
// translated anyway.
// (And it would be logistically tricky to translate, as this code is
// called from the `main` function before the [ZulipApp] widget is built,
// let alone has updated [GlobalLocalizations].)
return '$licenseFileText\n\nAUTHORS file follows:\n\n$authorsFileText';
}());
yield LicenseEntryWithLineBreaks(
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/about_zulip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class _AboutZulipPageState extends State<AboutZulipPage> {
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
ListTile(
title: Text(zulipLocalizations.aboutPageAppVersion),
subtitle: Text(_packageInfo?.version ?? '(…)')),
subtitle: Text(_packageInfo?.version
?? zulipLocalizations.appVersionUnknownPlaceholder)),
ListTile(
title: Text(zulipLocalizations.aboutPageOpenSourceLicenses),
subtitle: Text(zulipLocalizations.aboutPageTapToView),
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ class _ZulipAppState extends State<ZulipApp> with WidgetsBindingObserver {
// TODO(#524) choose initial account as last one used
final initialAccountId = globalStore.accounts.firstOrNull?.id;
return MaterialApp(
title: 'Zulip',
onGenerateTitle: (BuildContext context) {
return ZulipLocalizations.of(context).zulipAppTitle;
},
localizationsDelegates: ZulipLocalizations.localizationsDelegates,
supportedLocales: ZulipLocalizations.supportedLocales,
theme: themeData,
Expand Down
Loading
Loading