Skip to content

[SFCalendar] Issue: Cannot Force Western Digits in SfCalendar When App Locale is Arabic #2373

@h1amza

Description

@h1amza

Bug description

When my app's locale is set to Arabic (e.g. Locale('ar', 'MA')), the SfCalendar widget displays all numbers (dates, times, week numbers) using Arabic-Indic digits (e.g. ١,٢,٣).
I want to display all numbers in Western (English) digits (0-9) only in the calendar, while keeping the rest of my app in Arabic.

Steps to reproduce

1- Set your app's locale to Arabic (e.g. Locale('ar', 'MA')).
2- Wrap SfCalendar with Localizations.override(locale: Locale('ar', 'MA')).
3- Observe that all numbers in the calendar are still Arabic-Indic digits.

Code sample

MaterialApp(
locale: Locale('ar', 'MA'),
home: Scaffold(
body: Localizations.override(
context: context,
locale: Locale('ar','MA'),
child: SfCalendar(
view: CalendarView.week,
timeSlotViewSettings: TimeSlotViewSettings(
timeFormat: 'HH:mm',
),
),
),
),
);

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Image
Image

Activity

Mugunthan-Ramalingam

Mugunthan-Ramalingam commented on Jun 10, 2025

@Mugunthan-Ramalingam
Contributor

Hi @h1amza,

You can refer to our Knowledge Base (KB) article that explains how to override the localizations in SfCalendar to display the digits instead of Arabic words for numbers in the calendar UI. We have shared the KB documentation for your reference.

KB link: https://support.syncfusion.com/kb/article/11052/how-to-override-the-material-app-locale-and-set-english-language-for-flutter-calendar

However, a GitHub sample reference is attached in the KB documentation. You can refer to the sample and customize it based on your requirements.

If you have any further queries, please get back to us. We are always happy to assist you.

Regards,
Mugunthan.

h1amza

h1amza commented on Jun 10, 2025

@h1amza
Author

Thank you for your reply @Mugunthan-Ramalingam but in CalendarView.week and CalendarView.day, the hour/time labels still display Arabic-Indic digits (١٢) instead of Western digits (12).

could you guide me on how to enforce Western digits (1, 2, 3) in these views?

Appreciate your help,

Image

Image

h1amza

h1amza commented on Jun 11, 2025

@h1amza
Author

@sfHariHaraSudhan can you please update the tag label to open

Mugunthan-Ramalingam

Mugunthan-Ramalingam commented on Jun 16, 2025

@Mugunthan-Ramalingam
Contributor

Hi @h1amza,

We have created a simple sample using two SfCalendar widgets, with English set as the default localization for the app. In this sample, the first calendar is overridden with the Arabic locale using Localizations.override. As a result, the time labels and week view header date labels are rendered correctly in digits instead of Arabic numerals. The second calendar, which uses the default English locale, also renders the time and date labels in Western digits as expected.

We’ve shared this sample for your reference, and you can customize it further based on your specific requirements.

However, if you are still experiencing the issue, we kindly request you to replicate it in the shared sample and provide more specific details about the scenario. This will help us assist you more effectively.

Demo:

Image

Sample: gh_2373.zip

Regards,
Mugunthan.

h1amza

h1amza commented on Jun 23, 2025

@h1amza
Author

I found the problem in my case 🙌, the issue was caused by this line in my main : Intl.defaultLocale = locale.toLanguageTag();
This was affecting number formatting globally by setting the default locale, which caused the problem.

Thanks a lot @Mugunthan-Ramalingam for your support and guidance! 🙏

added
solvedSolved the query using existing solutions
and removed on Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    calendarCalendar componentsolvedSolved the query using existing solutions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @h1amza@sfHariHaraSudhan@Mugunthan-Ramalingam

        Issue actions

          [SFCalendar] Issue: Cannot Force Western Digits in SfCalendar When App Locale is Arabic · Issue #2373 · syncfusion/flutter-widgets