Remove locale name provider

This commit is contained in:
problematicconsumer
2023-12-14 16:07:46 +03:30
parent b14938ca62
commit e7722aa53d
3 changed files with 8 additions and 14 deletions

View File

@@ -1,4 +1,3 @@
import 'package:flutter_localized_locales/flutter_localized_locales.dart';
import 'package:hiddify/gen/fonts.gen.dart';
import 'package:hiddify/gen/translations.g.dart';
@@ -6,8 +5,12 @@ extension AppLocaleX on AppLocale {
String get preferredFontFamily =>
this == AppLocale.fa ? FontFamily.shabnam : "";
String get localeName =>
LocaleNamesLocalizationsDelegate
.nativeLocaleNames[flutterLocale.toString()] ??
name;
String get localeName => switch (flutterLocale.toString()) {
"en" => "English",
"fa" => "فارسی",
"ru" => "Русский",
"zh" || "zh_CN" => "中文",
"tr" => "Türkçe",
_ => "Unknown",
};
}