From e7722aa53dd324eb444773db41f26b6cb096ec02 Mon Sep 17 00:00:00 2001 From: problematicconsumer Date: Thu, 14 Dec 2023 16:07:46 +0330 Subject: [PATCH] Remove locale name provider --- lib/core/localization/locale_extensions.dart | 13 ++++++++----- pubspec.lock | 8 -------- pubspec.yaml | 1 - 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/lib/core/localization/locale_extensions.dart b/lib/core/localization/locale_extensions.dart index e42d81e8..f581c3b1 100644 --- a/lib/core/localization/locale_extensions.dart +++ b/lib/core/localization/locale_extensions.dart @@ -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", + }; } diff --git a/pubspec.lock b/pubspec.lock index a2dc9bea..b98fcfc0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -483,14 +483,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_localized_locales: - dependency: "direct main" - description: - name: flutter_localized_locales - sha256: "478d10535edf07292e34cb4c757882edeeaf96d5e3dbb04b42733038bd41dd3f" - url: "https://pub.dev" - source: hosted - version: "2.0.5" flutter_loggy: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 7151a08d..c6a4420e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,6 @@ dependencies: slang: ^3.25.0 slang_flutter: ^3.25.0 timeago: ^3.6.0 - flutter_localized_locales: ^2.0.5 fpdart: ^1.1.0 freezed_annotation: ^2.4.1 json_annotation: ^4.8.1