Browse Source

app,tool,neon: Fix generating localizations

pull/266/head
jld3103 2 years ago
parent
commit
212c50bda6
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 6
      packages/app/l10n.yaml
  2. 17
      packages/neon/neon/lib/l10n/localizations.dart
  3. 16
      packages/neon/neon/lib/l10n/localizations_en.dart
  4. 3
      tool/generate-app.sh

6
packages/app/l10n.yaml

@ -0,0 +1,6 @@
arb-dir: ../neon/neon/lib/l10n
template-arb-file: en.arb
output-localization-file: localizations.dart
synthetic-package: false
output-dir: ../neon/neon/lib/l10n
nullable-getter: false

17
packages/neon/neon/lib/l10n/localizations.dart

@ -87,12 +87,14 @@ abstract class AppLocalizations {
]; ];
/// A list of this localizations delegate's supported locales. /// A list of this localizations delegate's supported locales.
static const List<Locale> supportedLocales = <Locale>[Locale('en')]; static const List<Locale> supportedLocales = <Locale>[
Locale('en')
];
/// No description provided for @appImplementationName. /// No description provided for @appImplementationName.
/// ///
/// In en, this message translates to: /// In en, this message translates to:
/// **'{app, select, core{Server} files{Files} news{News} notes{Notes} notifications{Notifications} other{}}'** /// **'{app, select, nextcloud{Nextcloud} core{Server} files{Files} news{News} notes{Notes} notifications{Notifications} other{}}'**
String appImplementationName(String app); String appImplementationName(String app);
/// No description provided for @loginAgain. /// No description provided for @loginAgain.
@ -1198,14 +1200,17 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
} }
AppLocalizations lookupAppLocalizations(Locale locale) { AppLocalizations lookupAppLocalizations(Locale locale) {
// Lookup logic when only language code is specified. // Lookup logic when only language code is specified.
switch (locale.languageCode) { switch (locale.languageCode) {
case 'en': case 'en': return AppLocalizationsEn();
return AppLocalizationsEn();
} }
throw FlutterError('AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' throw FlutterError(
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue ' 'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration ' 'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.'); 'that was used.'
);
} }

16
packages/neon/neon/lib/l10n/localizations_en.dart

@ -11,6 +11,7 @@ class AppLocalizationsEn extends AppLocalizations {
String _temp0 = intl.Intl.selectLogic( String _temp0 = intl.Intl.selectLogic(
app, app,
{ {
'nextcloud': 'Nextcloud',
'core': 'Server', 'core': 'Server',
'files': 'Files', 'files': 'Files',
'news': 'News', 'news': 'News',
@ -41,8 +42,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get errorCredentialsForAccountNoLongerMatch => 'The credentials for this account no longer match'; String get errorCredentialsForAccountNoLongerMatch => 'The credentials for this account no longer match';
@override @override
String get errorServerHadAProblemProcessingYourRequest => String get errorServerHadAProblemProcessingYourRequest => 'The server had a problem while processing your request. You might want to try again';
'The server had a problem while processing your request. You might want to try again';
@override @override
String get errorSomethingWentWrongTryAgainLater => 'Something went wrong. Please try again later'; String get errorSomethingWentWrongTryAgainLater => 'Something went wrong. Please try again later';
@ -59,12 +59,10 @@ class AppLocalizationsEn extends AppLocalizations {
String get errorConnectionTimedOut => 'Connection has timed out'; String get errorConnectionTimedOut => 'Connection has timed out';
@override @override
String get errorNoCompatibleNextcloudAppsFound => String get errorNoCompatibleNextcloudAppsFound => 'No compatible Nextcloud apps could be found.\nWe are working hard to implement more and more apps!';
'No compatible Nextcloud apps could be found.\nWe are working hard to implement more and more apps!';
@override @override
String get errorServerInMaintenanceMode => String get errorServerInMaintenanceMode => 'The server is in maintenance mode. Please try again later or contact the server admin.';
'The server is in maintenance mode. Please try again later or contact the server admin.';
@override @override
String errorMissingPermission(String name) { String errorMissingPermission(String name) {
@ -125,8 +123,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get nextPushSupported => 'NextPush is supported!'; String get nextPushSupported => 'NextPush is supported!';
@override @override
String get nextPushSupportedText => String get nextPushSupportedText => 'NextPush is a FOSS way of receiving push notifications using the UnifiedPush protocol via a Nextcloud instance.\nYou can install NextPush from the F-Droid app store.';
'NextPush is a FOSS way of receiving push notifications using the UnifiedPush protocol via a Nextcloud instance.\nYou can install NextPush from the F-Droid app store.';
@override @override
String get nextPushSupportedInstall => 'Install NextPush'; String get nextPushSupportedInstall => 'Install NextPush';
@ -206,8 +203,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get globalOptionsPushNotificationsEnabled => 'Enabled'; String get globalOptionsPushNotificationsEnabled => 'Enabled';
@override @override
String get globalOptionsPushNotificationsEnabledDisabledNotice => String get globalOptionsPushNotificationsEnabledDisabledNotice => 'No UnifiedPush distributor could be found or you denied the permission for showing notifications. Please go to the app settings and allow notifications and go to https://unifiedpush.org/users/distributors and setup any of the listed distributors. Then re-open this app and you should be able to enable notifications';
'No UnifiedPush distributor could be found or you denied the permission for showing notifications. Please go to the app settings and allow notifications and go to https://unifiedpush.org/users/distributors and setup any of the listed distributors. Then re-open this app and you should be able to enable notifications';
@override @override
String get globalOptionsPushNotificationsDistributor => 'UnifiedPush Distributor'; String get globalOptionsPushNotificationsDistributor => 'UnifiedPush Distributor';

3
tool/generate-app.sh

@ -24,4 +24,7 @@ color="#f37736"
wait wait
fvm dart run flutter_native_splash:create fvm dart run flutter_native_splash:create
fvm flutter gen-l10n
) )
./tool/format.sh

Loading…
Cancel
Save