Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Apr 2008
    Location
    South Africa
    Posts
    25
    Plugin Contributions
    0

    Default Re: Localization problem - month names

    Hi Guys,

    Im having some problems. The language I need to set my setlocale to is not a very common setting, and i wonder if it even exists? I need to set the locale to Afrikaans, because everything is afrikaans except for the month names. This seems like a really stupid design. Why not use normal variables for the months or days just like any other string? It breaks my mind. I have very limited knowledge, so any help will be appreciated. Do I need to speak to my host about languages? Is there a way I can bypass the server and use my own functions to get the strings?

    thanks

  2. #12
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Localization problem - month names

    Why not use normal variables for the months or days just like any other string?
    That is one of those pieces of legacy code that has never been changed - you can blame HDPL - perhaps a future release will do something for it.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #13
    Join Date
    Apr 2008
    Location
    South Africa
    Posts
    25
    Plugin Contributions
    0

    Default Re: Localization problem - month names

    Ah ok.

    Still, anyone?

  4. #14
    Join Date
    Apr 2008
    Location
    South Africa
    Posts
    25
    Plugin Contributions
    0

    Default Re: Localization problem - month names

    Anyone? Please please!

  5. #15
    Join Date
    Dec 2010
    Posts
    1
    Plugin Contributions
    0

    xhtml problem Re: Localization problem - month names

    Quote Originally Posted by Vik View Post
    I've run into the same problem recently...
    So, You may fix it as follows:

    $month_number=date('m');
    switch($month_number)
    {
    case '01': $temp='January in Hungarian';break;
    case '02': $temp='February in Hungarian';break;
    ...
    ...
    case '12': $temp='December in Hungarian';break;
    }

    define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For '. $temp);

    It should be done in /includes/languages/your_templates/hungarian.php

    It works for me (I need Bulgarian on my site).
    Hope that helps.
    Thanks for the help Vik.

    My server doesn't have spanish locale, I checked with:

    [FONT="Courier New"]# locale -a
    C
    en_US.utf8
    POSIX
    [/FONT]
    So I had to manually type the month names.

    Example for Spanish:

    In includes/languages/spanish.php

    // Nombre de meses a capón, porque el servidor no los tiene
    $month_number=date('m');
    switch($month_number)
    {
    case '01': $temp='Enero';break;
    case '02': $temp='Febrero';break;
    case '03': $temp='Marzo';break;
    case '04': $temp='Abril';break;

    case '05': $temp='Mayo';break;
    case '06': $temp='Junio';break;
    case '07': $temp='Julio';break;
    case '08': $temp='Agosto';break;

    case '09': $temp='Septiembre';break;
    case '10': $temp='Octubre';break;
    case '11': $temp='Noviembre';break;
    case '12': $temp='Diciembre';break;
    }

    define('TABLE_HEADING_NEW_PRODUCTS', 'Nuevos productos de '. $temp);
    I put it just under the DATE section:

    // look in your $PATH_LOCALE/locale directory for available locales..
    // on RedHat try 'en_US'
    // on FreeBSD try 'en_US.ISO_8859-1'
    // on Windows try 'en', or 'English'
    @setlocale(LC_TIME, 'es_ES.UTF8');//unix, was @setlocale(LC_TIME, 'en_US.ISO_8859-1');
    @setlocale(LC_TIME, 'Spanish_Spain.1252');//windows
    define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()
    define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
    define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
    define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

  6. #16
    Join Date
    Feb 2011
    Posts
    8
    Plugin Contributions
    0

    Default Re: Localization problem - month names

    Quote Originally Posted by Vik View Post
    I've run into the same problem recently...
    So, You may fix it as follows:

    $month_number=date('m');
    switch($month_number)
    {
    case '01': $temp='January in Hungarian';break;
    case '02': $temp='February in Hungarian';break;
    ...
    ...
    case '12': $temp='December in Hungarian';break;
    }

    define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For '. $temp);

    It should be done in /includes/languages/your_templates/hungarian.php

    It works for me (I need Bulgarian on my site).
    Hope that helps.
    It works quite fine for Greek Language too.
    Thanks a lot.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v150 Month names not appearing correctly
    By tips007 in forum General Questions
    Replies: 1
    Last Post: 19 Oct 2012, 10:45 PM
  2. Localization problem
    By elgar in forum Addon Language Packs
    Replies: 0
    Last Post: 21 Oct 2008, 10:51 PM
  3. Localization problem
    By elgar in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Sep 2008, 08:47 AM
  4. Month Names in different languages
    By altryne in forum Addon Language Packs
    Replies: 11
    Last Post: 22 Aug 2007, 05:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg