Skip to content
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

Add german to web app #3214

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ extension LocaleExtension on Locale {
return AppLocalizations.of(context).languageArabic;
case 'it':
return AppLocalizations.of(context).languageItalian;
case 'de':
return AppLocalizations.of(context).languageGerman;
default:
return '';
}
Expand All @@ -29,6 +31,8 @@ extension LocaleExtension on Locale {
return 'Français';
case 'en':
return 'English';
case 'de':
return 'Deutsch';
case 'vi':
return 'Tiếng Việt';
case 'ru':
Expand All @@ -41,4 +45,4 @@ extension LocaleExtension on Locale {
return '';
}
}
}
}
8 changes: 7 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,12 @@
"placeholders_order": [],
"placeholders": {}
},
"languageGerman": "German",
"@languageGerman": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"messageDialogSendEmailUploadingAttachment": "Your message could not be sent because it uploading attachment",
"@messageDialogSendEmailUploadingAttachment": {
"type": "text",
Expand Down Expand Up @@ -3251,4 +3257,4 @@
"placeholders_order": [],
"placeholders": {}
}
}
}
8 changes: 7 additions & 1 deletion lib/l10n/intl_messages.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,12 @@
"placeholders_order": [],
"placeholders": {}
},
"languageGerman": "German",
"@languageGerman": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"messageDialogSendEmailUploadingAttachment": "Your message could not be sent because it uploading attachment",
"@messageDialogSendEmailUploadingAttachment": {
"type": "text",
Expand Down Expand Up @@ -4024,4 +4030,4 @@
"placeholders_order": [],
"placeholders": {}
}
}
}
8 changes: 7 additions & 1 deletion lib/main/localizations/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,12 @@ class AppLocalizations {
name: 'languageEnglish');
}

String get languageGerman {
return Intl.message(
'German',
name: 'languageGerman');
}

String get languageVietnamese {
return Intl.message(
'Vietnamese',
Expand Down Expand Up @@ -4219,4 +4225,4 @@ class AppLocalizations {
'Find emails',
name: 'findEmails');
}
}
}
1 change: 1 addition & 0 deletions lib/main/localizations/language_code_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
class LanguageCodeConstants {
static const String english = 'en';
static const String french = 'fr';
static const String german = 'de';
static const String vietnamese = 'vi';
static const String italian = 'it';
static const String russian = 'ru';
Expand Down
8 changes: 5 additions & 3 deletions lib/main/localizations/localization_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class LocalizationService extends Translations {
LanguageCodeConstants.vietnamese,
LanguageCodeConstants.russian,
LanguageCodeConstants.arabic,
LanguageCodeConstants.italian
LanguageCodeConstants.italian,
LanguageCodeConstants.german
];

static const List<Locale> supportedLocales = [
Expand All @@ -27,7 +28,8 @@ class LocalizationService extends Translations {
Locale(LanguageCodeConstants.vietnamese, 'VN'),
Locale(LanguageCodeConstants.russian, 'RU'),
Locale(LanguageCodeConstants.arabic, 'TN'),
Locale(LanguageCodeConstants.italian, 'IT')
Locale(LanguageCodeConstants.italian, 'IT'),
Locale(LanguageCodeConstants.german, 'DE')
];

static void changeLocale(String langCode) {
Expand Down Expand Up @@ -65,4 +67,4 @@ class LocalizationService extends Translations {

@override
Map<String, Map<String, String>> get keys => {};
}
}
4 changes: 3 additions & 1 deletion lib/main/utils/app_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class AppUtils {
return const date_format.ArabicDateLocale();
} else if (currentLanguageCode == LanguageCodeConstants.italian) {
return const date_format.ItalianDateLocale();
} else if (currentLanguageCode == LanguageCodeConstants.german) {
return const date_format.GermanDateLocale();
} else {
return const date_format.EnglishDateLocale();
}
Expand All @@ -82,4 +84,4 @@ class AppUtils {
final timeZoneOffsetAsString = timeZoneOffset >= 0 ? '+$timeZoneOffset' : '$timeZoneOffset';
return 'GMT$timeZoneOffsetAsString';
}
}
}
Loading