// If the timestamp is the same year, show the month and date
$Format = T('Date.DefaultDayFormat', '%B %e');
} else if (date('Y', $Timestamp) != date('Y', $Now)) {
// If the timestamp is not the same year, just show the year
$Format = T('Date.DefaultYearFormat', '%B %Y');
} else {
// Otherwise, use the date format
$Format = T('Date.DefaultFormat', '%B %e, %Y');
}
first I inserted new line ($Configuration['Garden']['Locale'] = 'sk-SK';) into conf/congig.php file, it replaced english names of months to slovak names, but I have to change the order of months and days in that names - not februar 13, I need "13 februar"
jungica advised to find applications\dashboard\locale\en-CA\definitions.php and so on...there is %B %e and replacement of these to parameters did not solve date order...
@MacWebsk - let me know if you try this and if it works. You should also try
Delete all the .ini files in your cache/ folder. To clear the cache after you make the change.
You may be stuck with days like 01 marec with the %d option. The %e option will not work on some machines.
/vanilla/cache/Smarty/
Edit a file called locale.php in your /vanilla/conf/local.php
<?php if (!defined('APPLICATION')) exit();
// 1 March - no leading zero - may not work on some computers.
$Definition['Date.DefaultDayFormat'] = '%e %B';
// or uncomment the one below for 01 March.
//$Definition['Date.DefaultDayFormat'] = '%d %B';
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
As a followup, there appears to be numerous ways to do what you wanted to.
This is probably the better way assuming you created a locale.
You can change definitions in the
/vanilla/locales/the-locale-you-created/definitions.php
search for it to see if the definition exists and modify it, if not add line
$Definition['Date.DefaultDayFormat'] = '%e %B';
below will get overwritten when you update your version, so make a copy.
/config/locale.php
as above
http://vanillaforums.org/discussion/comment/158378#Comment_158378
and the numerous ways described here...
http://vanillaforums.org/docs/localization
e.g.
Plugin: pluginfolder/locale/en-CA.php
there is a search order - so if the definition occurs multiple times in the same file, which it shouldn't, but if it does the last one in the file will take effect.
the config/locale.php - appears to be the last one to act and will override any other instances.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
I'm using the Italian transifex translation and have the same problem.
I managed to change date format by adding the $Definition['Date.DefaultDayFormat'] = '%e %B'; row to the site_core.php file (not definitions.php).
But I tried to add the lines for localizing month names and they didn't work, no matter what file I did put them in.
Any suggestion?
Apparently Vanilla gets the names of the names of the months from the unix locale settings, rather than from any localization files of the script itself. Which is unfortunate and impedes localization.
Comments
you don't have to use arrays, just set your config file (conf/config.php) insert new line anywhere like this:
(this means all names will be hungarian)
- Spam
- Abuse
- Troll
2 • Off Topic Insightful 2Awesome LOL •@Olivier_Chevet hi, step 4 of your instructions is the same with step 1?
My long month names (Slovak) are visible just as one letter. I follow your 3 steps instructions carefuly.
check my forum site pls: macweb.sk/forum/
thanks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@jungica: ok, solved, thank you very much mate. :) koszonom
- Spam
- Abuse
- Troll
1 • Off Topic Insightful Awesome 1LOL •@jungica: nice fix, but the order is still backwards...
Right now, it says "februar 13" when i need "13 februar".
Any way to change the order? :)
Thanks in advance.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •which language do you want to use?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Norwegian (nb_NO)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •put into config: $Configuration['Garden']['Locale'] = 'nb_NO'; and search for the time display and change
(februar 13)
to
(13 februar)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I added "$Configuration['Garden']['Locale'] = 'nb_NO';" to /conf/config.php, and it shows norwegian month names perfectly.
But there are no "%B" or "%d" in the entire /conf/config.php document.
Could you post your time display code?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •try library\core\class.format.php line 468? or library\core\functions.general.php line 927?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Found this when i searched for %B:
Found this when i searched for %d:
Found this when i searched for %B:
Found this when i searched for %d:
Did not find anything in either documents when i searched for %B %d.
Please advice.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •forget it, check your
or your own, and find
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@jungica replacement %B for %e did not help in my case...anybody else try it?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •This is such a long thread to follow, can you summarize what you have currently have and what you want to do? If you feel like it.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@peregrine:
first I inserted new line ($Configuration['Garden']['Locale'] = 'sk-SK';) into conf/congig.php file, it replaced english names of months to slovak names, but I have to change the order of months and days in that names - not februar 13, I need "13 februar"
jungica advised to find applications\dashboard\locale\en-CA\definitions.php and so on...there is %B %e and replacement of these to parameters did not solve date order...
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Thanks, I'll get back to you in about 6 hours - got some things to do.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@MacWebsk - let me know if you try this and if it works. You should also try Delete all the .ini files in your cache/ folder. To clear the cache after you make the change. You may be stuck with days like 01 marec with the %d option. The %e option will not work on some machines.
/vanilla/cache/Smarty/Edit a file called locale.php in your /vanilla/conf/local.php
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •@peregrine: Thank you very much, it works and looks pretty good :) my issue solved :)
Take a look: http://www.macweb.sk/forum
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@MacWebsk
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I'm using the Italian transifex translation and have the same problem. I managed to change date format by adding the $Definition['Date.DefaultDayFormat'] = '%e %B'; row to the site_core.php file (not definitions.php). But I tried to add the lines for localizing month names and they didn't work, no matter what file I did put them in. Any suggestion?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Apparently Vanilla gets the names of the names of the months from the unix locale settings, rather than from any localization files of the script itself. Which is unfortunate and impedes localization.
See: http://vanillaforums.org/discussion/22190/change-date-format#latest
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •