Slots Time AM/PM

Slots Time AM/PM

by Susan Ruiz -
Number of replies: 4

Hi Scheduler users! again here, i currently present a problem with my module: 


$ MODULE-> version = 2013092702; 

$ MODULE-> release = '2.5.1'; Human-friendly version // name 

$ MODULE-> requires = 2013051400; Requires // Moodle 2.5 

$ MODULE-> = MATURITY_STABLE maturity; Stable branch // 

$ MODULE-> cron = 60; // Period for cron to check this module (secs) 

i am using Moodle version in the 2.6.3 (Build: 20140512). 


It turns out that in the course settings, force the Spanish language of mexico and shows me the time in the 24 hours, and  I want 12 hour format and read AM / PM, with the language of Spain if you show me the 12 hours but does not specify AM / PM, this which will bring confusion among students and teachers, any suggestions?? 


i  changed the file langConfig EN_US_UTF8 and if it shows me 12 hours with your AM-PM,  but this change the days and months in English. 


Please if someone can guide, I will be very grateful. 


Greetings and happy day.

Average of ratings: -
In reply to Susan Ruiz

Re: Slots Time AM/PM

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers

You say that you tried to customize the English language pack; did you try customizing the corresponding string in the Spanish language pack too? (See Site administration -> Language - >Language customizations)

In reply to Henning Bostelmann

Re: Slots Time AM/PM

by Susan Ruiz -

Hi Henning, Thanks for your answer, I will try explain better.

I've customized the chains of language: Spanish / mexico in Home / ► Site administration / ► Language / ► Language Customisation -> langconfig.php,

 I replaced these values 

% H:% M% l by this value:% M% p in different strings, but it has not worked, show me the value of 12 hours but does not show me if AM / PM. 

I also tried changing the core_langconfig - locale (es_MX.UTF-8) by en_AU.UTF-8 and in the scheduler, works! but not completely because it also show the days on English. 

I tried changing the core_langconfig - locale (es_MX.UTF-8) by en_US.UTF-8 and the scheduler displays the time with 12-hour format but without AM / PM 

I need to know if the locale file (es_MX.UTF-8 and en_US.UTF-8) has to do with this? is there any way to fix ?. 

I took several screenshots to be better appreciated. 


Thank you very much for your answer 


Regards

Susan Ruiz

Attachment moodle.jpg
Attachment moodle2.jpg
In reply to Susan Ruiz

Re: Slots Time AM/PM

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers

Hi Susan

thanks for this detailed explanation. I can reproduce the behaviour that you describe, and I must say it puzzled me for a while. The solution is, in short, as follows.

You have correctly configured the time format (core_langconfig / strftimetime) to include the AM / PM part. (I would not change core_langconfig / locale though.) However, it turns out that the localized value for the English text "AM"/"PM" in the Spanish (Mexico) locale is, in the default configuration, just the empty string. That is, someone thinks that "AM" in English translates to "" in Mexican Spanish.

Now this translation is not determined by Scheduler. In fact, it's not determined by Moodle either, and not even by PHP. As it turns out, it is determined by the operating system.

On my Linux (Ubuntu 14.04) machine, I solved the problem as follows. I edited the file /usr/share/i18n/locales/es_MX and replaced the line

 am_pm   "";""

with

 am_pm  "<U0041><U004D>";"<U0050><U004D>"

Then I ran "sudo locale-gen". This finally makes the AM/PM text correctly show up in the scheduler on Moodle. (Weird enough!)

Of course, since all this is operating system dependent, it may look very different on your machine.

Best wishes
Henning

In reply to Henning Bostelmann

Re: Slots Time AM/PM

by Susan Ruiz -

Hi Henning, 


Wow got you to thinking, thank you very much for your answer, now I  just waiting for the response of a guru A2Hosting that is where hosting my site moodle, because as I enter via ssh I have not root permissions to change the local file,  


Thank you very much and have a nice day. 


Regards from Venezuela.

Susan Ruiz