OJS 3 how to translate months names


#1

How to translate short and long month names Oct Nov May… I can’t find them in export of en_US locale.


#2

You will generally want to use PHP’s built in date command for this:
http://php.net/manual/en/function.date.php


#3

And where can I use the date command to translate the month names properly?


#4

OJS generally uses the PHP date command formatting according to the rules defined in config.inc.php:

If these are not affecting a particular component in OJS, can you describe what you are currently seeing and in what context you are seeing it?


#5

My conference portal is in Brazilian Portuguese but the months’ long names at the conference schedule come in English.

I’ve tried using
setlocale(LC_TIME,“pt_BR.UTF8”,“pt_BR”,“pt_BR.iso-8859-1”,“pt_BR.utf-8”,“portuguese”);
at the beginning of the function smarty_modifier_date_format in lib/pkp/lib/smarty/plugins/modifier.date_format.php but without success.

So, any guidance about what must be done would be of great help. Thanks.


#6

That seems like a pretty reasonable modification, assuming the template is processing dates such as:

Does a standalone call to setlocale() and strftime() outside of the OCS framework translate the date as expected? That is, can you tell if the problem is specific to PHP on your server, or specific only to OCS?


#7

As far as I am concerned, it’s really a PHP issue. I’ll contact the proper forum to find out a solution for that.

Thanks for the help.


#8

Problem solved, it was just a matter of “uncommenting” the desired locales at /etc/locale.gen and execute “locale-gen”.

Add the fact that the browser’s cache had to be mandatorily cleaned in order to check the results.

Thanks!