Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BroonDev committed Aug 27, 2024
2 parents 216edd1 + cac51e0 commit 071fd7d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/src/localization/language_manager.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import '../../lucid_validation.dart';
import 'languages/portuguese_brazillian_language.dart';

final _avaliableLanguages = <String, Language>{
'pt_BR': PortugueseBrasillianLanguage(),
'pt': PortugueseBrasillianLanguage(),
'en': EnglishLanguage(),
'en_US': EnglishLanguage(),
};

abstract class LanguageManager {
final _globalTranslations = <String, Map<String, String>>{};
Expand All @@ -22,6 +30,10 @@ abstract class LanguageManager {
}
return message;
}

Language getLanguage(String culture) {
return _avaliableLanguages[culture] ?? LucidValidation.global.language;
}
}

class DefaultLanguageManager extends LanguageManager {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import '../language.dart';

class PortugueseBrasillianLanguage extends Language {
PortugueseBrasillianLanguage() : super('pt_BR');
}

0 comments on commit 071fd7d

Please sign in to comment.