Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
Like Tree1Likes

Thread: How to change locale in PHP?

  1. #11
    jellby is offline Junior Member
    Join Date
    Nov 2014
    Posts
    9

    Default

    Sure. Your code:

    PHP Code:
    <?php
    setlocale
    (LC_ALL'de_DE');
    echo 
    strftime("%e %B %Y");
    ?>
    Produces this for me:
    6 December 2020
    Which is not correct.

    And the code I posted before:

    PHP Code:
    <?php
    setlocale
    (LC_ALL'it_IT');
    echo 
    strftime("%A, %e %B %Y<br/>");
    setlocale(LC_ALL'de_DE');
    echo 
    strftime("%A, %e %B %Y<br/>");
    setlocale(LC_ALL'fr_FR');
    echo 
    strftime("%A, %e %B %Y<br/>");
    setlocale(LC_ALL'es_ES');
    echo 
    strftime("%A, %e %B %Y<br/>");
    ?>
    Produces this:
    domenica, 6 dicembre 2020
    domenica, 6 dicembre 2020
    domenica, 6 dicembre 2020
    domenica, 6 dicembre 2020
    which shows that only the Italian locale is doing anything.

  2. #12
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    543

    Default

    Fixed!

    Bye!

  3. #13
    jellby is offline Junior Member
    Join Date
    Nov 2014
    Posts
    9

    Default

    Thank you. I don't think I will need another locale for now, but I notice "sv_SE" (Swedish) doesn't work either. May I ask what the problem is? Do you need to enable locales one by one for each account? How can I get a list of available working locales (given that "resourcebundle_locales('')" is not reliable).

  4. #14
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    543

    Default

    Quote Originally Posted by jellby View Post
    May I ask what the problem is?
    Is just configuration, if you need other, just ask here.

    Quote Originally Posted by jellby View Post
    Do you need to enable locales one by one for each account?
    No, the settings are not for a single account.

    Bye!

  5. #15
    svennemans is offline Junior Member
    Join Date
    Jan 2012
    Posts
    6

    Default

    Quote Originally Posted by alemoppo View Post
    Is just configuration, if you need other, just ask here.
    Hi alemoppo,

    Would it be possible to add or enable the locale for Dutch (nl_NL and/or nl_BE)?

    See my other forum thread here

    thanks!

Page 2 of 2 FirstFirst 12

Posting Permissions

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

SEO by vBSEO