OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Translation of month in conference timeline

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Translation of month in conference timeline

Postby Dragone » Tue Jul 08, 2008 7:18 am

Hi to all,
I would like to translate the months of the page "Conference Timeline" in Italian (and in general all the month of the site), but I can't find where they are written
They aren't in the local/en_US file...and I don't find it in the code
I use OCS 2.1.0.1
Thanks in advance for your help
Daniela
Dragone
 
Posts: 45
Joined: Fri Apr 01, 2005 2:21 am
Location: Italy

Re: Translation of month in conference timeline

Postby smiri » Wed Jul 09, 2008 2:00 pm

Hi Daniela,

I believe these months are printed by the PHP code automatically.

You could search the web to see if it's possible to make PHP print stuff in a different language or not.

Regards,
smiri
 
Posts: 183
Joined: Thu Sep 06, 2007 7:01 pm

Re: Translation of month in conference timeline

Postby Dragone » Thu Jul 10, 2008 7:49 am

Hi,
yes, it is possible using the setlocale function
For example I have found
Code: Select all
<?php 
setlocale(LC_TIME, 'it_IT'); 
echo strftime("%A %d %B %Y"); 
?> 

But where should I do the change for conference timeline and in general for all the dates in OCS?

Does anyone else has done this change even in another language?
Thanks
Daniela
Dragone
 
Posts: 45
Joined: Fri Apr 01, 2005 2:21 am
Location: Italy

Re: Translation of month in conference timeline

Postby asmecher » Thu Jul 10, 2008 8:04 am

Hi Daniela,

This should already be set in classes/i18n/Locale.inc.php in the initialize() function:
Code: Select all
        /**
         * Initialize the locale system.
         */
        function initialize() {
                // Use defaults if locale info unspecified.
                $locale = Locale::getLocale();
                $localeFile = Locale::getMainLocaleFilename($locale);

                $sysLocale = $locale . '.' . LOCALE_ENCODING;
                if (!@setlocale(LC_ALL, $sysLocale, $locale)) {
                        // For PHP < 4.3.0
                        if(setlocale(LC_ALL, $sysLocale) != $sysLocale) {
                                setlocale(LC_ALL, $locale);
                        }
                }

                Locale::registerLocaleFile($locale, $localeFile);
        }
Can you debug to see if something there is not working properly?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Translation of month in conference timeline

Postby Dragone » Fri Jul 11, 2008 8:48 am

Hi,
I have printed the value of that funcion:
Locale=it_IT
Localefile=locale/it_IT/locale.xml
Syslocale=it_IT.utf-8
I have noticed, however, that I entered both the if statements
My server is linux. With set command I have LANG=en_US.UTF-8
I have php PHP 5.2.0-8
In ocs the primary locale is Italian
I have also installated ocs on my pc with windows xp but I have again
Locale=it_IT
Localefile=locale/it_IT/locale.xml
Syslocale=it_IT.utf-8

Thanks
Daniela
Dragone
 
Posts: 45
Joined: Fri Apr 01, 2005 2:21 am
Location: Italy

Re: Translation of month in conference timeline

Postby asmecher » Fri Jul 11, 2008 4:45 pm

Hi Daniela,

Try removing the "@" character before the first setlocale call; it may be suppressing an error message that would help to debug further.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Translation of month in conference timeline

Postby Dragone » Mon Jul 14, 2008 4:02 am

Hi,
I have removed the @ but nothing happened.
Then, I have commented out the if (if (!@setlocale(LC_ALL, $sysLocale, $locale))... )
and I have written below (just to try)
setlocale(LC_ALL,'it_IT','it-IT','it','ita');
echo strftime("%A %d %B %Y");
but unfortunately I have Monday 14 July 2008 and not "Lunedì 14 luglio 2008" in italian.
It seems like the setlocale has no effect. If i write echo setlocale(....) I view nothing
I think that is a problem of the php and the server...but I am not a systems analyst
Should perhaps I install some php extension for italian language? Or something else?
I have a Debian Server with php 5.
Thanks
Daniela
Dragone
 
Posts: 45
Joined: Fri Apr 01, 2005 2:21 am
Location: Italy

Re: Translation of month in conference timeline

Postby asmecher » Mon Jul 21, 2008 10:50 pm

Hi Daniela,

Were you able to get things working with the example code you posted earlier?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Translation of month in conference timeline

Postby Dragone » Tue Aug 05, 2008 3:00 am

Hi alec,
no, I haven't resolved my problem
Can you help me?
Thanks
Daniela
Dragone
 
Posts: 45
Joined: Fri Apr 01, 2005 2:21 am
Location: Italy

Re: Translation of month in conference timeline

Postby asmecher » Tue Aug 05, 2008 9:26 am

Hi Daniela,

From http://ca.php.net/setlocale, try:
  • Uncommenting the it_IT entries in /etc/locale.gen
  • Running locale-gen
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Translation of month in conference timeline

Postby Dragone » Wed Aug 06, 2008 7:03 am

Hi,
I have tried but nothing happened
I have also changed
/etc/default/locale
and turned off and on apache but also nothing happened
I have also cleaned the cache and user session but nothing happened

Should I maybe activate the mbstring library in my php.ini?
Or something else?
Thanks
Daniela
Dragone
 
Posts: 45
Joined: Fri Apr 01, 2005 2:21 am
Location: Italy

Re: Translation of month in conference timeline

Postby asmecher » Wed Aug 06, 2008 8:20 am

Hi Daniela,

On my Debian system I was able to debug by creating a script with the following contents:
Code: Select all
<?php

if (!setlocale(LC_TIME, 'it_IT')) die(Italian not available!\n");

echo strftime('%B %e, %Y') . "\n";

?>
My instructions in http://pkp.sfu.ca/support/forum/viewtopic.php?p=12632#p12632 were able to get Italian working. However, this is a PHP or system issue, not OCS -- one of the resources at http://www.php.net/support.php might be able to provide better guidance. Alternately, a Debian mailing list might help.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm


Return to OCS Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest

cron