Author |
Message |
tima26
New Member


Joined: Jun 24, 2008
Posts: 10
|
Posted:
Thu Aug 21, 2008 1:08 am |
|
I've problem with the translation of time in News module. I translate ravennuke into Azerbaijan . And now I don't know how translate the time in news. I have read that in Admin Panel ->Preferences -> Locale Time Format I must write the local time. For example :
Turkey lang : tr_TR
English :en_US
Russian :ru_RU
Deustch :de_DE
Spain : es_ES
But I can'y find AZERBAIJAN . Could you help me  |
|
|
|
 |
tima26

|
Posted:
Thu Aug 21, 2008 2:15 am |
|
Where Can I find this ? Please write your ideas. Thanx from now |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Aug 21, 2008 5:26 am |
|
This can be tricky. Be sure to read Only registered users can see links on this board! Get registered or login! very carefully:
There is a note from 21-Jan-2008 that may help. Use aze instead of cym.
bryn wrote: |
bryn AT lunarvis DOT com
21-Jan-2008 06:04
Posting this in the hope it might be useful to others, as I could find very little info anywhere. If you want to use a Welsh locale and have the suitable language support installed, you pass 'cym' (abbreviated form of Cymraeg) to setlocale:
<?php
setlocale(LC_TIME, 'cym');
$welsh= gmstrftime("%A, %B %Y - %H:%M",time());
echo $welsh;
?>
The above certainly applies to Windows systems, but should also apply to Unix if the required support is installed.
Cheers,
Bryn. |
Running this script using aze instead of cym produces Cüm? axsami, Avgust 2008 - 11:19. I don't know if that's correct but hopefully this will point you in the right direction.
Code:
<?php
setlocale(LC_TIME, 'aze');
$azerbaijan = gmstrftime("%A, %B %Y - %H:%M",time());
echo $azerbaijan;
?>
|
|
|
|
|
 |
tima26

|
Posted:
Thu Aug 21, 2008 6:09 am |
|
Thanx Raven
I tried to change mainfile.php
Code:function formatTimestamp($time) {
global $datetime, $locale;
static $localeSet; // setlocale() can be expensive to call; only need to call it once
if (!isset($localeSet)) {
setlocale(LC_TIME, $locale);
$localeSet = 1;
}
if (!is_numeric($time)) {
preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})/', $time, $datetime);
$time = gmmktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]);
}
$time -= date('Z');
$datetime = strftime(_DATESTRING, $time);
$datetime = ucfirst($datetime);
return $datetime;
}
|
I replaced setlocale(LC_TIME, $locale); with setlocale(LC_TIME, 'aze');
And also in admin panel a wrote aze. But there was no changes |
|
|
|
 |
Raven

|
Posted:
Thu Aug 21, 2008 6:32 am |
|
My response was not the exact answer to your issue. I was directing you to a source for discovering the solution. Running that script I gave you produces a result that you need to confirm is correct. If it is then you know your server is set up for Azerbaijan which is a base/core requirement before the RN solution will even work. Then I was leaving it up to you to use Google to discover the ??_?? code for Azerbaijan
Try az-AZ
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. |
|
|
|
 |
tima26

|
Posted:
Mon Aug 25, 2008 2:44 am |
|
I tried But it didn't work. I tried all the variants you said but no results. Please help if you have any other ideas about this. |
|
|
|
 |
|