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. 21
      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

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

@ -87,12 +87,14 @@ abstract class AppLocalizations {
];
/// 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.
///
/// 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);
/// No description provided for @loginAgain.
@ -1198,14 +1200,17 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
}
AppLocalizations lookupAppLocalizations(Locale locale) {
// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'en':
return AppLocalizationsEn();
case 'en': return AppLocalizationsEn();
}
throw FlutterError('AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.');
throw FlutterError(
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'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(
app,
{
'nextcloud': 'Nextcloud',
'core': 'Server',
'files': 'Files',
'news': 'News',
@ -41,8 +42,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get errorCredentialsForAccountNoLongerMatch => 'The credentials for this account no longer match';
@override
String get errorServerHadAProblemProcessingYourRequest =>
'The server had a problem while processing your request. You might want to try again';
String get errorServerHadAProblemProcessingYourRequest => 'The server had a problem while processing your request. You might want to try again';
@override
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';
@override
String get errorNoCompatibleNextcloudAppsFound =>
'No compatible Nextcloud apps could be found.\nWe are working hard to implement more and more apps!';
String get errorNoCompatibleNextcloudAppsFound => 'No compatible Nextcloud apps could be found.\nWe are working hard to implement more and more apps!';
@override
String get errorServerInMaintenanceMode =>
'The server is in maintenance mode. Please try again later or contact the server admin.';
String get errorServerInMaintenanceMode => 'The server is in maintenance mode. Please try again later or contact the server admin.';
@override
String errorMissingPermission(String name) {
@ -125,8 +123,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get nextPushSupported => 'NextPush is supported!';
@override
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.';
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.';
@override
String get nextPushSupportedInstall => 'Install NextPush';
@ -206,8 +203,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get globalOptionsPushNotificationsEnabled => 'Enabled';
@override
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';
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';
@override
String get globalOptionsPushNotificationsDistributor => 'UnifiedPush Distributor';

3
tool/generate-app.sh

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

Loading…
Cancel
Save