-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtranslated_locale_name.dart
More file actions
42 lines (42 loc) · 972 Bytes
/
translated_locale_name.dart
File metadata and controls
42 lines (42 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
extension TranslateLocaleExtension on Locale {
/// Returns the locale name in its corresponding language.
String translatedLocaleName() {
switch (toLanguageTag()) {
case 'de':
case 'de-DE':
return 'Deutsh';
case 'en':
case 'en-US':
return 'English';
case 'es':
case 'es-ES':
return 'Español';
case 'fr':
case 'fr-FR':
return 'Français';
case 'it':
case 'it-IT':
return 'Italiano';
case 'ja':
case 'ja-JP':
return '日本語';
case 'ko':
case 'ko-KR':
return '한국어';
case 'pt':
case 'pt-BR':
return 'Português';
case 'ru':
case 'ru-RU':
return 'Русский';
case 'zh':
case 'zh-CN':
return '简体中文';
case 'zh-TW':
return '繁體中文';
default:
debugPrint('Locale $this not found.');
return 'N/A';
}
}
}