Search code examples
macosunixlocalefreebsdosx-elcapitan

How can I install es_AR locale on OSX El Capitan?


I'm trying to install a locale on OSX (El Capitan) and I can't figure it out.

I've been googling for hours now.

In Ubuntu is as simple as locale-gen and dpkg-reconfigure.

I'm coding a PHP application that uses es_AR as a locale and I can't get my number formatting right.

Works fine in Linux systems.

Thanks.


Solution

  • First off, you already have asked this question here, and the Apple or Unix/Linux StackExchange pages are more appropriate for this question, however you put up bounty, and if nobody answers your question you don't get that bounty back, so I'll answer here and follow up with the same answer (if you find it formidable) on that other page.

    Unfortunately Apple really did not create a locale for Argentina, so when you look at the Language & Region section in the OSX settings, the difference between Español (Spain) and Español (Latinoamérica) is really non-existent in OSX. When I enabled either, there was no change on the available locales on my system:

    $ locale -a | grep es
    es_ES
    es_ES.ISO8859-1
    es_ES.ISO8859-15
    es_ES.UTF-8
    

    So unfortunately Apple did not include the es_419 (Latin America) or es_AR (Argentina) locales, and they tied those up into the es_ES locale.

    In talking to a friend who travels to Argentina frequently, is fluent in Spanish and also uses Spanish on their Mac:

    There could be slight spelling differences but mostly it's the grammar. It would just be some Spain Spanish grammar, but Argentines use some variants of Spain conjugations.

    So really it should not matter in the long run. You can simply copy the locale on Mac to match the naming:

    sudo cp -R /usr/share/locale/es_ES /usr/share/locale/es_AR
    

    Also I checked on a few of my Linux hosts, and the sha256 sum for these locales are the same, so it looks like the Linux developers have done the same exact thing that Apple has basically done.

    $ sha256sum /usr/share/locale/es_ES/LC_MESSAGES/libvisual-0.4.mo 
    20848a8a8d6ddca454825b3b4102393699850d156d7157535850556e110fb891
    
    $ sha256sum /usr/share/locale/es_AR/LC_MESSAGES/libvisual-0.4.mo 
    20848a8a8d6ddca454825b3b4102393699850d156d7157535850556e110fb891