Open H4zh4n opened 1 year ago
this response may be late but i used this in my app as a workaround
textDirection: Get.locale == Locale('ku') ? TextDirection.rtl : null,
add this in GetMaterialApp
@Tabarek Thanks a bunch 🌸 I used a different approach and it worked out well for me.
For anyone interested, Since user controls the language selection in my app (no automatic language selection based on device language), I just used one of the RTL languages that I probably won't support. these languages are all Right to Left :
Arabic - Locale('ar')
Farsi - Locale('fa')
Hebrew - Locale('he')
Pashto - Locale('ps')
Urdu - Locale('ur')
I just picked he
(Hebrew) as default Locale for Kurdi. and in the class that extends Translations
I set it up like below :
Map<String, Map<String, String>> get keys => {
'en': {
'hello': 'Hello',
},
'he': {
'hello': 'سڵاو',
},
'ar': {
'hello': 'اهلا',
},
};
When user chose Kurdish Language I just changed the locale to Hebrew and that was it.
Get.updateLocale(Locale('he'));
This library ( The flutter_kurdish_localization ) was not necessary to use. no need to setup localizationsDelegates
with KurdishMaterialLocalizations
or KurdishWidgetLocalizations
. Normal GetMaterialApp
with it's locale
and that's it.
Apologies for the Close / Re-open of the issue. I do think it should stay open and let the dev decide whether they want to have something that works with GetX then close it, or have it be as it is and let people use other approaches.
The Library works perfectly well with normal
MaterialApp
usage. however if I use GetX Library which I have to useGetMaterialApp
it instead treatsku
as Left to Right.Normal MaterialApp :
GetX's
GetMaterialApp
:Any work-around ?