Vyslon
Vyslon

Reputation: 11

Applandeo Material-Calendar-View, how can I change the language of displayed months?

I'm using this material calendar view library: https://github.com/Applandeo/Material-Calendar-View

And I can't find how to change the language of the calendar, changing language/location of my emulated phone didn't change anything (I even tried with my personnal phone which is correctly configured.

Here is the text I want to change

Upvotes: 0

Views: 1302

Answers (2)

Vyslon
Vyslon

Reputation: 11

Sorry, I just found the answer on the documentation, hadn't find it in the documentation the last time : documentation

Result

Upvotes: 1

Adel Askri
Adel Askri

Reputation: 1

You can set by using custom labels

widget.setTitleFormatter(new MonthArrayTitleFormatter(getResources().getTextArray(R.array.custom_months)));
widget.setWeekDayFormatter(new ArrayWeekDayFormatter(getResources().getTextArray(R.array.custom_weekdays)));

And this is on your Strings folder under values

<string-array name="custom_weekdays">
    <item>Su</item>
    <item>M</item>
    <item>Tu</item>
    <item>W</item>
    <item>Th</item>
    <item>F</item>
    <item>Sa</item>
</string-array>

<string-array name="custom_months">
    <item>JAN</item>
    <item>Feb</item>
    <item>MARCH</item>
    <item>April</item>
    <item>MAY</item>
    <item>June</item>
    <item>JULY</item>
    <item>Aug</item>
    <item>SEPT</item>
    <item>Oct</item>
    <item>Nov</item>
    <item>DEC</item>
</string-array>

Have a good day !

Upvotes: 0

Related Questions