Month names translation
Permalink 2 users found helpful
Hello, I'm wondering how can i change displaying month name in page list block, which is shown using this code:
Where can i edit month names, so they can be displayed in my language [PL] ?
greetings
$month = $cobj->getCollectionDatePublic('F'); and i put month name using : <?php echo $month; ?>
Where can i edit month names, so they can be displayed in my language [PL] ?
greetings
Actually i have tried both versions of translation that You have posted. None of these translates month names. Anyway thanks for your time :)
I think that month names are stored somewhere else. Could anybody tell me where ?
I think that month names are stored somewhere else. Could anybody tell me where ?
Oh I'm sorry. Ok I found these; maybe they'll help? -
http://www.concrete5.org/community/forums/internationalization/fxin...
http://www.concrete5.org/community/forums/usage/set-locale-on-date-...
http://www.concrete5.org/community/forums/internationalization/fxin...
http://www.concrete5.org/community/forums/usage/set-locale-on-date-...
Have you installed the language files for pl? If month names are not in them I think you could make a language file for the pagelist block then use echo t($month) in your template.
Have you tried
<?php echo t($month); ?>
Thanks for your replies guys, using your information i've solved my problem :)
I've red 2 topic that Wagdi posted and i realized that there is no translation anywhere for months.
here is the solution which helped me:
1. create dummy php file (f.e months.php) and place it anywhere in root/concrete directory.
2. put code below into that that file
3. using poedit open your .po file and "update from source"
properties for your .po file (edit it with poedit, if you cannot update your files)
- if you have located .po file in root/languages/pl_PL/LC_MESSAGES/ use "base path" as "../../../" and add paths "." <-- it will search in each .php file
-then go to tab "sources keyword" --> add "t" (i guess its concrete5 translate function)
4. After updating your translation file from source,it should have months and days available to translate. Translate it to your language and save file
-
5. set in ROOT/config/site.php and in your page list block.
6. at last use to use your translated month name in page list block :) - thanks to Jongosi.
I mark Wagdi's post as helpful, but Jongosi, u have also helped. Thank you both guys :)
I've red 2 topic that Wagdi posted and i realized that there is no translation anywhere for months.
here is the solution which helped me:
1. create dummy php file (f.e months.php) and place it anywhere in root/concrete directory.
2. put code below into that that file
<?php print t('Monday'); print t('Tuesday'); print t('Wednesday'); print t('Thursday'); print t('Friday'); print t('Saturday'); print t('Sunday'); print t('January'); print t('February'); print t('March'); print t('April'); print t('May'); print t('June'); print t('July');
Viewing 15 lines of 20 lines. View entire code block.
3. using poedit open your .po file and "update from source"
properties for your .po file (edit it with poedit, if you cannot update your files)
- if you have located .po file in root/languages/pl_PL/LC_MESSAGES/ use "base path" as "../../../" and add paths "." <-- it will search in each .php file
-then go to tab "sources keyword" --> add "t" (i guess its concrete5 translate function)
4. After updating your translation file from source,it should have months and days available to translate. Translate it to your language and save file
-
5. set
define('LOCALE', 'pl_PL');
setlocale(LC_TIME, 'pl_PL');
6. at last use
<?php echo t($month); ?>
I mark Wagdi's post as helpful, but Jongosi, u have also helped. Thank you both guys :)
Sweet, well done grosik.
Hi grosik,
this behaviour is in the core (5.6) now. Just do this:
API Docs are here:http://docs.mnkras.com/class_concrete5___helper___date.html#a5f7a74...
Best Patrick
this behaviour is in the core (5.6) now. Just do this:
$dh = Loader:helper("date"); $month = $dh->date('F',$cobj->getCollectionDatePublic("U")); echo $month
API Docs are here:http://docs.mnkras.com/class_concrete5___helper___date.html#a5f7a74...
Best Patrick
Hi Patrick, thanks for Your reply, that will be helpful on my new project, but the issue i met when i started this topic was related to older project on C5 v 5.5. I don't want to update that site ATM, because of much modifications i have done there (maybe when i have more time).
Anyway thanks for the info, now this topic have 2 solutions :)
Anyway thanks for the info, now this topic have 2 solutions :)
I still can't change the names of the months :S
I'm prob doing something wrong in the view.php file in my blocks\page_lists\ folder.
Some tips?
thanks
I'm prob doing something wrong in the view.php file in my blocks\page_lists\ folder.
Some tips?
thanks
http://concrete5.pl/
http://concrete5.org.pl/