New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arabic locale for Calendar #351
Comments
@AlexIach we should be respecting the "first day of the week" setting on the locale. Can you tell me exactly which language+country your locale is set to? |
@edenman Language Arabic, Country United Arab Emirates. To create Calendar I write: |
I don't know Arabic language, but using dictionary and Google Translate, your header is populated with the following way (Left to right) Sunday, Saturday, Friday, Thursday, Wednesday, Tuesday, Monday. On your CalendarPickerView 20th of March ( Numerical 20th in Arabic is " ٢٠" ) is Wednesday( الأربعاء ) but in fact it's Monday. |
I also created using |
Hello @edenman Ohhh sorry man, I'm confused because of Android devices and Emulators, in one device everything is displayed properly ( right to left as expected ) in others no. I can not find reason why? It does not depends on devices' model and Android version. I have no idea why so stare behavior when locale is Arabic. |
hello @AlexIach how to set days in week start from السبت |
@eslamwael74 this library should be respecting the user's locale's setting for the "first day of the week". If you're not seeing this work correctly, please comment here with:
|
-Device Name : Honor8 and nexux 5X Very Thanks for your support. @edenman |
I am waiting for your response @edenman |
As I stated earlier in this thread, we rely on If you want to change the first day of the week for a given Locale, you can do this:
...before you initialize the CalendarPickerView. |
Not Working :D please solve this issue!! @edenman |
This is not a support forum. Be respectful of Eric's time. We will respond
when we have the time.
…On Thu, Sep 14, 2017, 6:01 PM Eslam wael ***@***.***> wrote:
Not Working :D
` Calendar c = Calendar.getInstance(TimeZone.getDefault(), new
Locale("ar", "EG"));
c.setFirstDayOfWeek(Calendar.SATURDAY);
calendarView.init(today, nextYear.getTime()).
inMode(CalendarPickerView.SelectionMode.MULTIPLE);`
please solve this issue!! @edenman <https://github.com/edenman>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#351 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEETV1cQTA98kG6mxfjGAvHzQgg-2kks5siaIbgaJpZM4Mm4mm>
.
|
for Eric's time, i solved it :D
` private static int getDayOfWeek(int firstDayOfWeek, int offset, boolean isRtl) {
Thank you for support. @JakeWharton @edenman |
Hello. I was able to translate the calendar to Arabic, however, I want to retain the year and days as english / latin instead of Arabic. I was able to create a workaround for Lollipop and up however, cannot find a workaround for JellyBean and KitKat. Is there a way to specifically initialize the days and year from arabic to english numbers? Thanks a lot. if (MyApp.getInstance().selectedLang.equals("en")) {
calendarPickerInitializer = calendarPickerView.init(today, nextYear.getTime());
} else {
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
// using english numbers instead of arabic
calendarPickerInitializer = calendarPickerView.init(today, nextYear.getTime(), new Locale.Builder().setLanguageTag("ar-u-nu-latn").build());
} else {
// using arabic numbers - HOW TO MAKE THE DAYS AND YEAR IN ENGLISH NUMBER
calendarPickerInitializer = calendarPickerView.init(today, nextYear.getTime(), new Locale("ar", "SA"));
}
} |
@arvi your best bet is to fork this library and manually change the formatters that you want to customize |
@edenman thanks for your prompt reply. May I know the file where the formatters are for day? What term can I CTRL+F in the library. Thanks a lot. Never mind. I found it by searching for "setText" term :) |
Wrong displaying Calendar using Arabic locale.
In Arabic calendar first day of the week is Saturday, so it causes misalignment between Day Of Week's name and date. So I can make offset for day of week, to adjust it to date, but it will not be properly. Is is possible to make offset for date as I can do for day of weeks?
The text was updated successfully, but these errors were encountered: