12/22/2
This commit is contained in:
@@ -1,94 +1,88 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../main.dart';
|
||||
import '../themes/themes.dart';
|
||||
import 'package:sefer_driver/constant/box_name.dart';
|
||||
import 'package:sefer_driver/main.dart';
|
||||
import 'package:sefer_driver/controller/themes/themes.dart';
|
||||
|
||||
class LocaleController extends GetxController {
|
||||
Locale? language;
|
||||
String countryCode = '';
|
||||
void restartApp() {
|
||||
// Get.offAll(MyApp);
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
ThemeData appTheme = themeEnglish;
|
||||
ThemeData appTheme = lightThemeEnglish;
|
||||
|
||||
changeLang(String langcode) {
|
||||
void changeLang(String langcode) {
|
||||
Locale locale;
|
||||
switch (langcode) {
|
||||
case "ar":
|
||||
locale = const Locale("ar");
|
||||
appTheme = themeArabic;
|
||||
appTheme = lightThemeArabic;
|
||||
box.write(BoxName.lang, 'ar');
|
||||
break;
|
||||
case "en":
|
||||
locale = const Locale("en");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'en');
|
||||
break;
|
||||
case "tr":
|
||||
locale = const Locale("tr");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'tr');
|
||||
break;
|
||||
case "fr":
|
||||
locale = const Locale("fr");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'fr');
|
||||
break;
|
||||
case "it":
|
||||
locale = const Locale("it");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'it');
|
||||
break;
|
||||
case "de":
|
||||
locale = const Locale("de");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'de');
|
||||
break;
|
||||
case "el":
|
||||
locale = const Locale("el");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'el');
|
||||
break;
|
||||
case "es":
|
||||
locale = const Locale("es");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'es');
|
||||
break;
|
||||
case "fa":
|
||||
locale = const Locale("fa");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'fa');
|
||||
break;
|
||||
case "zh":
|
||||
locale = const Locale("zh");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'zh');
|
||||
break;
|
||||
case "ru":
|
||||
locale = const Locale("ru");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'ru');
|
||||
break;
|
||||
case "hi":
|
||||
locale = const Locale("hi");
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
box.write(BoxName.lang, 'hi');
|
||||
break;
|
||||
default:
|
||||
locale = Locale(Get.deviceLocale!.languageCode);
|
||||
box.write(BoxName.lang, Get.deviceLocale!.languageCode);
|
||||
appTheme = themeEnglish;
|
||||
appTheme = lightThemeEnglish;
|
||||
break;
|
||||
}
|
||||
|
||||
box.write(BoxName.lang, langcode);
|
||||
Get.changeTheme(appTheme);
|
||||
Get.updateLocale(locale);
|
||||
restartApp();
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -925,10 +925,50 @@ Store your money with us and receive it in your bank as a monthly salary.''':
|
||||
"You will get cost of your work for this trip":
|
||||
"ستحصل على تكلفة عملك لهذه الرحلة",
|
||||
"in your wallet": "في محفظتك",
|
||||
"you gain": "تكسب",
|
||||
"you gain": "تكسب", "Account": "الحساب",
|
||||
"Wallet": "المحفظة", "Maintenance Offer": "عرض الصيانة",
|
||||
"Enter your Question here": "أدخل سؤالك هنا",
|
||||
"Ineligible for Offer": "غير مؤهل للحصول على العرض",
|
||||
"You should complete 500 trips to unlock this feature.":
|
||||
"يجب عليك إكمال 500 رحلة لتفعيل هذه الميزة.",
|
||||
"Thank You!": "شكراً لك!",
|
||||
"Your rating has been submitted.": "تم إرسال تقييمك.",
|
||||
"General": "عام",
|
||||
"Language": "اللغة",
|
||||
"You can change the language of the app": "يمكنك تغيير لغة التطبيق",
|
||||
"Change Country": "تغيير الدولة",
|
||||
"Don't start trip if passenger not in your car":
|
||||
"لا تبدأ الرحلة إذا لم يكن الراكب في سيارتك",
|
||||
"You can change the Country to get all features":
|
||||
"يمكنك تغيير الدولة للحصول على جميع الميزات",
|
||||
"Slide to End Trip": "اسحب لإنهاء الرحلة",
|
||||
"App Preferences": "تفضيلات التطبيق",
|
||||
"Google Map App": "تطبيق خرائط جوجل",
|
||||
"If you want to make Google Map App run directly when you apply order":
|
||||
"إذا كنت تريد تشغيل تطبيق خرائط جوجل مباشرة عند تطبيق الطلب",
|
||||
"Vibration": "الاهتزاز",
|
||||
|
||||
"Help & Support": "المساعدة والدعم",
|
||||
|
||||
"Please select a rating before submitting.":
|
||||
"يرجى تحديد تقييم قبل الإرسال.",
|
||||
|
||||
"Please check back later for available rides.":
|
||||
"يرجى التحقق مرة أخرى لاحقًا للحصول على الرحلات المتاحة.",
|
||||
"Please enter your question": "يرجى إدخال سؤالك",
|
||||
"Submit Question": "إرسال السؤال",
|
||||
"Your Questions": "أسئلتك",
|
||||
"No questions asked yet.": "لم يتم طرح أي أسئلة بعد.",
|
||||
"Activities": "الأنشطة",
|
||||
"History of Trip": "سجل الرحلات",
|
||||
"Available for rides": "متاح للرحلات",
|
||||
"Support": "الدعم",
|
||||
|
||||
"Helping Center": "مركز المساعدة",
|
||||
"More": "المزيد",
|
||||
"Order Cancelled": "الطلب ملغى",
|
||||
"Order Cancelled by Passenger": "تم إلغاء الطلب من قبل الراكب",
|
||||
"Success": "النجاح",
|
||||
"Success": "تمام",
|
||||
"Feedback data saved successfully": "تم حفظ بيانات التقييم بنجاح",
|
||||
"No Promo for today .": "لا ترويج لليوم.",
|
||||
"Select your destination": "اختر وجهتك",
|
||||
|
||||
Reference in New Issue
Block a user