MyBB Community Forums

Full Version: names of the week and months in the thread and post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hello, I can not find where change to read the names of days of the week and months in Italian, rather than English as currently in post and the panel welcome appear in English as a screen attached.
It's currently not possible without a modification, if I recall correctly. You'll need to modify my_date to use setlocale and strftime...
thanks, you might better explain the change?
I found the solution but we need the English translation and adaptation to the Italian language
thanks
http://www.mybb.fr/showthread.php?tid=323
The my_date modification is the same, but you need to change this line to your locale:
setlocale(LC_TIME, "FR");

I'm not sure what the locale for Italian is, but I think you can find it here: http://ca.php.net/setlocale
/**
* Replacement of the gmdate() function for french version.
*
* @param string A date format according to PHP's date structure.
* @param int The unix timestamp the date should be generated for.
* @return string The formatted  GMT timestamp "localized".
*
* Remplacement de la fonction gmdate() pour version française
*
* @param chaîne Un format de date conforme à la structure date PHP
* @param int Le timestamp Unix pour lequel il faut générer une date
* @return Le timestamp GMT formaté "localisé" *
*/

function my_gmdate ($format, $stamp)
{
    // Changes the localization information
    // Modifie les informations de localisation
    setlocale(LC_TIME, 'Italiano (IT)');
    
    // Replaces the format params used for date() fonction with those used by gmstrftime() function
    // witch returns formatted date according to the local configuration
    
    // Remplace les paramètres de format utilisés par la fonction date() par ceux utilisés par la fonction gmstrftime()
    // qui retourne la date formatée en fonction de la configuration locale.
    
    // Ex. Replaces "M Y" with "%b %Y" for gmstrftime() (please check it, surely it remains errors or missing params)
    // Ex. Remplace "M Y" par "%b %Y" pour gmstrftime() (merci de vérifier, il doit rester quelques erreurs ou omissions de paramètres)
    
    $format=str_replace(
    array ("D", "l", "M", "F", "d", "j", "y", "o", "M", "H", "h", "z", "m", "i", "a", "s", "N", "W", "w", "y", "Y", "e"),
    array("%a", "%A", "%b", "%B", "%d", "%e", "%g", "%G", "%h", "%H", "%I", "%j", "%m", "%M", "%p", "%u", "%W", "%w", "%u", "%y", "%Y", "%z"), $format);
    // returns the localized formated string
    // retourne la chaîne formatée "française"
    return gmstrftime($format, $stamp);
}

I included this, I believe there is need for English translation
the mod is not working right now!

help me please
Smile
Have you tried this:

setlocale(LC_TIME, 'IT');
(2008-07-04, 12:54 AM)DennisTT Wrote: [ -> ]Have you tried this:

setlocale(LC_TIME, 'IT');

also tried this and does not work

enclosed my file functions.php please you could check it?

[attachment=9670]
You never use the my_gmdate() function in your my_date() function

Change gmdate( ... ) to my_gmdate()
I'm interested in that topic, too. Turkish people want to see their MyBB forum full Turkish...
Pages: 1 2