Page 1 of 1
Как русифицировать дату?
Posted: Mon 17. Jun 2013, 11:36
by Maxim

Как вывести дату в таком формате:
"Последнее обновление:
18
мая 2013 г. 11:31"
Сейчас так:

Wie kann ich das Datum in folgendem Format:
"Последнее обновление:
18
мая 2013 г. 11:31"

How to print the date in this format:
"Последнее обновление:
18
мая 2013 г. 11:31"
Re: Как русифицировать дату?
Posted: Mon 17. Jun 2013, 13:29
by pergachris
Hi,
I am not sure, but you can try:
cmsimple\languages\ru.php
Line144
" $tx['lastupdate']['dateformat']="F d, Y, H:i"; "
Change " F d " to " d F "
" $tx['lastupdate']['dateformat']="d F, Y, H:i"; "
regards
Меня интересует именно русификация (локализация) даты.
Posted: Tue 18. Jun 2013, 07:56
by Maxim

Здравствуйте.
Спасибо за участие.
Я это знаю:
Настройки > Язык > Lastupdate > Dateformat > d F Y, H:i
Но меня интересует именно русификация (локализация) даты.
Чтобы дата была не "18
May 2013, 11:31", а "18
Мая 2013, 11:31".

Guten Tag.
Vielen Dank für die Teilnahme.
Ich weiß es:
Einstellungen > Sprache > Lastupdate > Dateformat > d F Y H:i
Aber mich interessiert die Russifizierung (Lokalisierung) Datum.
Um das Datum war nicht "18
May 2013, 11:31" ein, und wurde "18
Мая 2013, 11:31".

Hello.
Thank you for your participation.
I know it:
Settings > Language > Lastupdate > Dateformat > d F Y H:i
But I am interested in is Russification (localization) the date.
To date was not "18
May 2013, 11:31," and was "18
Мая 2013, 11:31".
Re: Как русифицировать дату?
Posted: Tue 18. Jun 2013, 09:20
by pergachris
Hello,
I missunderstood, sorry.
So, you want to change "May" into "Мая" ?
I am afraid, I can not find a translation.
I looked at: da, en, fi, fr, ru, tr, there is always the same variable = "F"
The result of "F" is now "June"
Look at all languages, it is all the same, there is no translation.
Only for "de" there is the variable "m", that gives the result "06"
So if you change the line to "d m Y, H:i" you will get the result: "18.06.2013, 09:19"
regards
Интересно и красивее - русификация (локализация) даты.
Posted: Tue 18. Jun 2013, 09:38
by Maxim
Only for "de" there is the variable "m", that gives the result "06"
So if you change the line to "d m Y, H:i" you will get the result: "18.06.2013, 09:19"

Ещё раз спасибо, но я это знаю.
Интересно и красивее - русификация (локализация) даты.

Noch mal danke, aber ich weiß es.
Interessant und schön - die Russifizierung (Lokalisierung) Datum.

Thanks again, but I know it.
Interesting and beautiful - Russification (localization) the date.
Re: Как русифицировать дату?
Posted: Tue 18. Jun 2013, 10:37
by pergachris
O.K.
I found out that is possible to change the result for "m"
("m" = month in two digits = 06)
<?php
$monate = array(01=>"Januar",
02=>"Februar",
03=>"März",
04=>"April",
05=>"Mai",
06=>"Juni",
07=>"Juli",
08=>"August",
09=>"September",
10=>"Oktober",
11=>"November",
12=>"Dezember");
?>
<?php
$monat = date("m");
echo $monate[$monat];
?>
That change the "06" into "Juni"
But I do not know how to put this in cmsimple
I am sure Gert knows that. I hope, he will answer to your problem.
regards
Зделал пару тестов с setlocale () - не получилось
Posted: Tue 18. Jun 2013, 10:52
by Maxim

Cделал пару тестов с
setlocale () - не получилось

Habe ein paar Tests mit
setlocale () - hat nicht funktioniert

Did a couple of tests with
setlocale () - failed
Code: Select all
function lastupdate($br = NULL, $hour = NULL) {
global $tx, $pth;
$t = $tx['lastupdate']['text'] . ':';
if (!(isset($br)))
$t .= tag('br');
else
$t .= ' ';
return $t . date($tx['lastupdate']['dateformat'], filemtime($pth['file']['content']) + (isset($hour) ? $hour * 3600 : 0));
}
Re: Как русифицировать дату?
Posted: Tue 18. Jun 2013, 11:10
by pergachris
Hi,
I think, there must be following line in.
cmsimple\languages\ru.php
$tx['lastupdate']['monthnames_array']="Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember";
Of course you need the name of the months in your language.
I guess a kind of following code have to complete to the lastupdate function.
(I copied it from a calendar plugin)
$month = (isset($month)) ? $month : date("n",time());
$textmonth = date("F",mktime(1,1,1,$month,1,$year));
$monthnames = explode(",", $plugin_tx['calendar']['monthnames_array']);
$textmonth = $monthnames[$mo..
But I hope Gert can tell you more
regards
Thank you, Christoph!!!
Posted: Tue 18. Jun 2013, 12:19
by Maxim