freezer/lib/translations.i18n.dart

54 lines
1.7 KiB
Dart
Raw Normal View History

2023-07-29 02:17:26 +00:00
import 'package:flutter/material.dart';
import 'package:freezer/languages/crowdin.dart';
import 'package:freezer/languages/en_us.dart';
import 'package:i18n_extension/i18n_extension.dart';
List<Language> languages = [
Language('en', 'US', "English"),
Language('ar', 'AR', "Arabic"),
Language('pt', 'BR', "Brazil"),
Language('it', 'IT', "Italian"),
Language('de', 'DE', "German"),
Language('ru', 'RU', "Russian"),
Language('es', 'ES', "Spanish"),
Language('hr', 'HR', "Croatian"),
Language('el', 'GR', "Greek"),
Language('ko', 'KO', "Korean"),
Language('fr', 'FR', "Baguette"),
Language('he', 'IL', "Hebrew"),
Language('tr', 'TR', "Turkish"),
Language('ro', 'RO', "Romanian"),
Language('id', 'ID', "Indonesian"),
Language('fa', 'IR', "Persian"),
Language('pl', 'PL', "Polish"),
Language('uk', 'UA', "Ukrainian"),
Language('hu', 'HU', "Hungarian"),
Language('ur', 'PK', "Urdu"),
Language('hi', 'IN', "Hindi"),
Language('sk', 'SK', "Slovak"),
Language('cs', 'CZ', "Czech"),
Language('vi', 'VI', "Vietnamese"),
Language('nl', 'NL', "Dutch"),
Language('sl', 'SL', "Slovenian"),
Language('zh', 'CN', "Chinese"),
Language('fil', 'PH', "Filipino"),
Language('ast', 'ES', "Asturian"),
Language('bul', 'BG', "Bulgarian"),
Language('uwu', 'UWU', "Furry")
];
List<Locale> get supportedLocales => languages.map((l) => l.getLocale).toList();
extension Localization on String {
static var _t = Translations.byLocale("en_US") + language_en_us + crowdin;
String get i18n => localize(this, _t);
}
class Language {
String name;
String locale;
String country;
Language(this.locale, this.country, this.name);
Locale get getLocale => Locale(this.locale, this.country);
2021-03-16 19:35:50 +00:00
}