Skip to content

Commit

Permalink
Add Spanish & arabic to supported languages in App
Browse files Browse the repository at this point in the history
  • Loading branch information
gnunicorn committed Aug 14, 2024
1 parent 9968f33 commit d7bd7b5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/lib/features/settings/model/language_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ class LanguageModel {

factory LanguageModel.fromCode(String? locale) {
switch (locale) {
case 'ar':
return const LanguageModel.arabic();
case 'de':
return const LanguageModel.german();
case 'es':
return const LanguageModel.spanish();
case 'pl':
return const LanguageModel.polish();
case 'fr':
Expand Down Expand Up @@ -38,11 +42,21 @@ class LanguageModel {
: languageName = 'Polski',
languageCode = 'pl';

const LanguageModel.spanish()
: languageName = 'Espanol',
languageCode = 'es';

const LanguageModel.arabic()
: languageName = 'اَلْعَرَبِيَّةُ',
languageCode = 'ar';

static const allLanguagesList = [
// we show them in ehm... alphabetical order
// we show them in ehm... alphabetical order of the name in their own language
LanguageModel.german(),
LanguageModel.english(),
LanguageModel.spanish(),
LanguageModel.french(),
LanguageModel.polish(),
LanguageModel.arabic(),
];
}

0 comments on commit d7bd7b5

Please sign in to comment.