Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,566
    Plugin Contributions
    30

    Default locale not available on local server, maybe..

    Hi,
    I am developing an english/spanish cart on a windows 2000 local pc with xampplite.

    When spanish is selected all text is in spanish apart from the day names which are in english.
    After much reading around the subject on setlocale I discover that the problem seems to be with my local server.

    I have used the code in the date wiki for testing the installed locales:

    <?php
    echo "<hr><br>The available 'locale' strings for 'es' on this server are:<br>";
    echo '<pre>';
    system('locale -a | grep -i es');
    echo '</pre>';
    ?>

    When I run this on my unix host, it returns a nice long list including es_ES.utf8 which I have been using.

    When run locally on the windows 2000 machine it returns nothing, not with es, esp, spain or en, only the first line of the test:

    The available 'locale' strings for 'en' on this server are:

    Due to lack of knowledge I don’t know if I should be installing or enabling something on the server or maybe (more likely) it is not executing the system command, anyway after a LOT of searching I have to admit defeat and ask here, what do I do?

    Thanks
    Steve

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: locale not available on local server, maybe..

    My guess (and it's little more than that) is that the xampplite package jettisons all the locale info as part of the lightening process. It's intended to be a very minimal installation, so carry all the baggage that comes with supporting every locale would logically be one of the fist things to jettison.

    I'd say just don't worry about it, unless you're planning to actually run your site on xampplite, in which case it's your customers who should do the worrying.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,566
    Plugin Contributions
    30

    Default Re: locale not available on local server, maybe..

    Hi,
    thanks for the reply.
    I have tried it with the full xampp and its just the same, thats why I think it has something to do with the system command not being executed.
    I am not really worried about it but I am amazed I cannot find out the answer. I have the habit of wasting time trying to wrestle pcs to the ground and this is no exception,

    regards
    Steve

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: locale not available on local server, maybe..

    Sounds like the XAMPP forum would be a better place for getting to the bottom of this. They'll know better than us what's included and whether there's anything that can cause locales to be ignored if they're there.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,566
    Plugin Contributions
    30

    Default Re: locale not available on local server, maybe..

    And the winning answer is....

    from the Apache forum:
    "There is no command "locale" (and "grep") on Windows which you can execute with system()"

    So the test code from the Zen Date Wiki could not work.

    After asking another question I got a german version of RTFM and sent to the php manual where I copied some code, looked at the Microsoft Language and Region codes
    http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspx
    http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspx
    and made up a test for windows servers which may be of use to other geeks.

    It fixed my "problem" in that it told me what to put in setlocale which was
    @setlocale(LC_TIME, 'Spanish_Spain.1252'); for windows,
    and
    @setlocale(LC_TIME, 'es_ES.UTF8'); for UNIX

    So, too many hours wasted on this silly issue but still, final score is computer 0 - human 1 which is how it should be.

    PHP Code:
    echo '<hr>test UNIX server for locales';
    echo 
    "<br>The available 'locale' strings for 'en' on this server are:<br>";
    echo 
    '<pre>';
    system('locale -a | grep -i en');
    echo 
    '</pre>';

    // There is no command "locale" (and "grep") on Windows which you can execute with system()

    echo '<hr>test WINDOWS server for locales';

    /* try different possible locale names for english GB as of PHP 4.3.0 */
    echo '<p>';
    $loc_en setlocale(LC_ALL'english_gbr''english_britain''english_england''english_great britain''english_uk''english_united kingdom''english_united-kingdom');
    echo 
    "Preferred locale for english GB on this system is '$loc_en'";
    echo 
    '<br/>' strftime("%A %d %B %Y"mktime(00012221978));

    /* try different possible locale names for english USA as of PHP 4.3.0 */
    echo '<p>';
    $loc_enusa setlocale(LC_ALL'english_usa''english_america''english_united states''english_united-states''english_us');
    echo 
    "Preferred locale for english USA on this system is '$loc_enusa'";
    echo 
    '<br/>' strftime("%A %d %B %Y"mktime(00012221978));

    /* try different possible locale names for german as of PHP 4.3.0 */
    echo '<p>';
    $loc_de setlocale(LC_ALL'de_DE@euro''de_DE''deu_deu');
    echo 
    "Preferred locale for german on this system is '$loc_de'";
    echo 
    '<br/>' strftime("%A %d %B %Y"mktime(00012221978));

    /* try different possible locale names for spanish as of PHP 4.3.0 */
    echo '<p>';
    $loc_es setlocale(LC_ALL'esp_esp''esp_spain''spanish_esp''spanish_spain');
    echo 
    "Preferred locale for spanish on this system is '$loc_es'";
    echo 
    '<br/>' strftime("%A %d %B %Y"mktime(00012221978));

    /* try different possible locale names for dutch as of PHP 4.3.0 */
    echo '<p>';
    $loc_nl setlocale(LC_ALL'nld_nld');
    echo 
    "Preferred locale for dutch on this system is '$loc_nl'";
    echo 
    '<br/>' strftime("%A %d %B %Y"mktime(00012221978)); 
    and what comes out on a unix server
    test UNIX server for locales
    The available 'locale' strings for 'en' on this server are:

    en_AU
    en_AU.iso88591
    en_AU.utf8
    en_BW
    en_BW.iso88591
    en_BW.utf8
    en_CA
    en_CA.iso88591
    en_CA.utf8
    en_DK
    en_DK.iso88591
    en_DK.utf8
    en_GB
    en_GB.iso88591
    en_GB.iso885915
    en_GB.utf8
    en_HK
    en_HK.iso88591
    en_HK.utf8
    en_IE
    en_IE.iso88591
    en_IE.iso885915@euro
    en_IE.utf8
    en_IE@euro
    en_IN
    en_IN.utf8
    en_NZ
    en_NZ.iso88591
    en_NZ.utf8
    en_PH
    en_PH.iso88591
    en_PH.utf8
    en_SG
    en_SG.iso88591
    en_SG.utf8
    en_US
    en_US.iso88591
    en_US.iso885915
    en_US.utf8
    en_ZA
    en_ZA.iso88591
    en_ZA.utf8
    en_ZW
    en_ZW.iso88591
    en_ZW.utf8
    french
    slovene
    slovenian

    test WINDOWS server for locales

    Preferred locale for english GB on this system is ''
    Friday 22 December 1978

    Preferred locale for english USA on this system is ''
    Friday 22 December 1978

    Preferred locale for german on this system is 'de_DE@euro'
    Freitag 22 Dezember 1978

    Preferred locale for spanish on this system is ''
    Freitag 22 Dezember 1978

    Preferred locale for dutch on this system is ''
    Freitag 22 Dezember 1978
    and what come out on a windows server:
    test UNIX server for locales
    The available 'locale' strings for 'en' on this server are:

    test WINDOWS server for locales

    Preferred locale for english GB on this system is 'English_United Kingdom.1252'
    Friday 22 December 1978

    Preferred locale for english USA on this system is 'English_United States.1252'
    Friday 22 December 1978

    Preferred locale for german on this system is 'German_Germany.1252'
    Freitag 22 Dezember 1978

    Preferred locale for spanish on this system is 'Spanish_Spain.1252'
    viernes 22 diciembre 1978

    Preferred locale for dutch on this system is 'Dutch_Netherlands.1252'
    vrijdag 22 december 1978
    hasta pronto,

    Steve

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: locale not available on local server, maybe..

    Quote Originally Posted by torvista View Post
    So, too many hours wasted on this silly issue but still, final score is computer 0 - human 1 which is how it should be.
    Bravo. I also waste too much time on silly issues. But I learn something every time and each incremental piece of knowledge increases the range of tools that I have available to apply to the next problem.

    Thanks for posting back what you found. That strengthens the whole community's toolset!
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 

Similar Threads

  1. v155 What value for locale should I use on my server?
    By torvista in forum Addon Language Packs
    Replies: 8
    Last Post: 11 Apr 2019, 10:23 AM
  2. mysql server not on local
    By fei2010 in forum General Questions
    Replies: 4
    Last Post: 26 Jun 2010, 10:09 AM
  3. Replies: 1
    Last Post: 10 May 2010, 05:29 PM
  4. Backup MYSQL Plugin not restoring on Local Server
    By roeghar in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 12 May 2009, 06:22 PM
  5. Some images not found after transfer from local server to host server
    By simon1066 in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 1 Apr 2009, 02:48 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR