Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
EDC:
Download extensions for Elxis CMS
.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
Language
(Moderator:
Farhad Sakhaei
) »
where is the date lang file?
« previous
next »
Print
Pages: [
1
]
2
Author
Topic: where is the date lang file? (Read 30681 times)
golden76
Newbie
Posts: 1
where is the date lang file?
«
on:
March 10, 2007, 17:38:16 »
i cant find the date word in main lang file. where is it? WEEK and MONTH word. thanks:)
Logged
eliasan
Hero Member
Posts: 897
Re: where is the date lang file?
«
Reply #1 on:
March 10, 2007, 18:38:51 »
Hi,
I don't think there are such words in language files.
What are you trying to do?
Logged
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: where is the date lang file?
«
Reply #2 on:
March 10, 2007, 19:45:02 »
If you're talking about last updated, published etc... it depends on your server and localisation it provides. As for my case (Serbian) it could be one of the following, depending on a server: sr, sr-SR, sr_SR, srCS, sr_CS.utf8... but you have to experiment. Following is the PHP code that would give you the info needed:
<?php
/* Proverava koji local settings je podržan na hosting serveru */
/* Preimenivati u datoteku sa ekstenzijom .php (npr: datum.php */
/* Dodati na serer i pokrenuti (npr:
http://www.mojdomen.com/datum.php
*/
/* Rezultat upisati u admin joomle (Global configuration/Locale/Country locale */
$loc_sr = setlocale (LC_ALL, 'sr_YU.ISO8859-5', 'sr_YU.ISO8859-2', 'sr_YU@cyrillic.UTF-8', 'sr', 'sr_CS', 'sr_CS.UTF-8', 'sr_YU.UTF-8');
echo "Preporučena lokalzacija na ovom serveru je: '$loc_sr'";
phpinfo();
?>
This script is intended for use with joomla!, but I'm shure it could give you the info needed
Logged
I've got a snap in my finger...
Got rhythm in my walk...
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: where is the date lang file?
«
Reply #3 on:
March 10, 2007, 19:54:53 »
Sorry, I haven't translated the comments...
<?php
/* Checking wich locale setting is supported by server */
/* Copy this code into a file with *.php extension(eg: date.php */
/* Upload to a server (eg:
http://www.mydomain.com/date.php
*/
/* Write the result into joomla! (Global configuration/Locale/Country locale */
$loc_sr = setlocale (LC_ALL, 'sr_YU.ISO8859-5', 'sr_YU.ISO8859-2', 'sr_YU@cyrillic.UTF-8', 'sr', 'sr_CS', 'sr_CS.UTF-8', 'sr_YU.UTF-8');
echo "Recomended localisation on this server is: '$loc_sr'";
phpinfo();
?>
Now it could be used by anyone
Logged
I've got a snap in my finger...
Got rhythm in my walk...
datahell
Elxis Team
Hero Member
Posts: 10356
Re: where is the date lang file?
«
Reply #4 on:
March 10, 2007, 20:43:11 »
No, you dont need to translate dates (although month names are in gemini files)!
If you have set
locale
to
auto
(as we recommend) php can translate the dates for you!
The following example displays the month name of 10-03-2007 (March):
Code: (php)
[Select]
$d = date('Y-m-d H:i:s', mktime(0,0,0,'03','10','2007'));
$day= mosFormatDate($d, "%B");
Note: windows do not support utf8 locales so the dates will be displayed in english in windows.
«
Last Edit: March 10, 2007, 20:46:04 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: where is the date lang file?
«
Reply #5 on:
March 10, 2007, 20:53:56 »
So it's true, I forgot... but then, there are not much serious windows based servers. I just wanna add that I even have one site on a server wich disables my updiag functionality. But these ARE NOT the usual cases. In most cases, the script will give you much needed info. After that, guys at elxis.org will tell you what to do with it.
«
Last Edit: March 10, 2007, 22:13:58 by eliasan
»
Logged
I've got a snap in my finger...
Got rhythm in my walk...
datahell
Elxis Team
Hero Member
Posts: 10356
Re: where is the date lang file?
«
Reply #6 on:
March 11, 2007, 11:56:49 »
Jazzman something else: For the serbian locale (and any locale) add first the utf8 parts!
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: where is the date lang file?
«
Reply #7 on:
March 11, 2007, 14:07:37 »
Speaking of utf8... did you get my email with translations?
Logged
I've got a snap in my finger...
Got rhythm in my walk...
datahell
Elxis Team
Hero Member
Posts: 10356
Re: where is the date lang file?
«
Reply #8 on:
March 11, 2007, 17:10:03 »
Yes, Jazzman but I did nt get the time to deal with it. Give me 1-2 days.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: where is the date lang file?
«
Reply #9 on:
March 11, 2007, 17:25:51 »
OK, I'm ill at the moment so a vacation for me is a good thing.
Logged
I've got a snap in my finger...
Got rhythm in my walk...
datahell
Elxis Team
Hero Member
Posts: 10356
Multi-lingual dates
«
Reply #10 on:
March 11, 2007, 20:17:35 »
Conclusion for the multilingual dates:
Month name are located inside the main frontend language files ie (german.php, english.php, serbian.php etc).
Example for German:
DEFINE('_JAN','Januar');
DEFINE('_FEB','Februar');
DEFINE('_MAR','März');
DEFINE('_APR','April');
DEFINE('_MAY','Mai');
DEFINE('_JUN','Juni');
DEFINE('_JUL','Juli');
DEFINE('_AUG','August');
DEFINE('_SEP','September');
DEFINE('_OCT','Oktober');
DEFINE('_NOV','November');
DEFINE('_DEC','Dezember');
BUT you can display any part of the date without language file if you have locale set to auto
.
How it works
Lets say we need to display the multilingual name of "Monday". We need a date that we know that it was Monday. Today (2007-03-11) is Sunday so tommorow will be monday, so this date is fine for our work (used date can be any valid date even in the future).
So the multi-lingual name of
Monday
is:
mosFormatDate('2007-03-11 01:00:00', "%A");
Of
Thuesday
:
mosFormatDate('2007-03-12 01:00:00', "%A");
and so, on.
The names of the months can be taken with a trick like above.
March
:
mosFormatDate('2007-03-01 01:00:00', "%B");
April
:
mosFormatDate('2007-04-01 01:00:00', "%B");
etc.
Hope that helped
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: where is the date lang file?
«
Reply #11 on:
March 15, 2007, 19:01:26 »
Thanx Datahell, it was usefull from developer's POW, but, I wanted to ask this: Is there an option to add locale manually, if auto option fails? I don't see, ie, Serbian locale in the dropdown list. I ask this on behalf of many potential elxis users, that I try to port from joomla cms.
Logged
I've got a snap in my finger...
Got rhythm in my walk...
datahell
Elxis Team
Hero Member
Posts: 10356
Re: where is the date lang file?
«
Reply #12 on:
March 15, 2007, 19:08:06 »
Serbian locale is just missing from the relative list in the global configuration panel but the support for the Serbian language exist in Elxis. So, if you have set locale to auto, then for all users that have Serbian language locale will be set to Serbian.
'serbian' => array('sr_CS.utf8@euro', 'sr_CS.utf8', 'sr_CS'),
I just added serbian to the list. Thanks for your observation.
I want something from you, I want to tell me the locale for the "
Serbian latin
" language. I think it must be different than the cyrilic, is n't it?
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: where is the date lang file?
«
Reply #13 on:
March 15, 2007, 20:26:42 »
I've been busy on that subject lately, but, there are so many possible answers (according to ISO)... eg:
sr_lat, sr_YU, sh-SR... I've lived in more countries than I've had girfriends...
Logged
I've got a snap in my finger...
Got rhythm in my walk...
datahell
Elxis Team
Hero Member
Posts: 10356
Re: where is the date lang file?
«
Reply #14 on:
March 15, 2007, 20:40:03 »
I need the proper one... You can not have 2 locales for the same language! If you dont find the answer I will search the server's locales to find the most suitable. I think the problem is that Serbia has many political changes during last years and the country name as long as the locale have been changed. We must find the current locale for Serbian latin language.
You can find the locale with a test. Go to your (
UNIX
) server and upload a php file.
Add inside this file the following code:
<?php
setlocale (LC_COLLATE, 'YOUR LOCALE HERE');
setlocale (LC_CTYPE, 'YOUR LOCALE HERE');
setlocale (LC_TIME, 'YOUR LOCALE HERE');
header( 'Content-type: text/plain; charset=utf-8' );
echo strftime("%A, %d %B %Y %H:%M", time());
?>
Save this file as test.php and run it with your browser (
www.mysite.com/test.php
) .
Does the date appears in Serbian latin correctly? If no, change the locale and test another one. Test all possible locales and tell me your test results.
Notice:
You must set only utf8 locales (ie sr_CS.utf8 not just sr_CS).
PHP manual for locale:
http://www.php.net/manual/en/function.setlocale.php
Serbian locales:
http://unicode.org/cldr/data/diff/summary/sr.html
Hope that helped.
«
Last Edit: March 15, 2007, 20:50:05 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Print
Pages: [
1
]
2
« previous
next »
Elxis CMS Forum
»
Support
»
Language
(Moderator:
Farhad Sakhaei
) »
where is the date lang file?