Last modified: 2014-06-18 14:50:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64269, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62269 - locale.setlocale(locale.LC_ALL, "ca_AD") doesn't work
locale.setlocale(locale.LC_ALL, "ca_AD") doesn't work
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Tim Landscheidt
:
Depends on:
Blocks: 53704
  Show dependency treegraph
 
Reported: 2014-03-05 20:27 UTC by Igor Remolar @ Betxí
Modified: 2014-06-18 14:50 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Igor Remolar @ Betxí 2014-03-05 20:27:50 UTC
Can some one install locale for Python?

I can run the archivebot.py because locale.setlocale() doesn't support changes.

I'm interested to implement the char set for Catalan, but I've seen that doesn't work for many other language sets. I tried with:
* locale.setlocale(locale.LC_ALL, "ca_AD") 
* locale.setlocale(locale.LC_ALL, "ca_ES")
* locale.setlocale(locale.LC_ALL, "es_ES")
Comment 1 Igor Remolar @ Betxí 2014-06-17 13:36:34 UTC
Sorry, it it possible to get any answer about this topic?
Comment 2 Gerrit Notification Bot 2014-06-17 22:17:23 UTC
Change 140239 had a related patch set uploaded by Tim Landscheidt:
Tools: Install Catalan locale

https://gerrit.wikimedia.org/r/140239
Comment 3 Tim Landscheidt 2014-06-17 22:23:03 UTC
NB: On Ubuntu, the locales are named "ca_AD.UTF8" & Co.:

| scfc@tools-dev:~$ LANG=ca_AD date
| Tue Jun 17 22:20:21 UTC 2014
| scfc@tools-dev:~$ LANG=ca_AD.UTF8 date
| dt jun 17 22:20:26 UTC 2014
| scfc@tools-dev:~$

I don't know if Python adds ".UTF8" automatically, so, if it does not you'll need to change the names (after the referenced patch gets merged).
Comment 4 Igor Remolar @ Betxí 2014-06-17 23:26:33 UTC
I have tried "LANG=ca_AD date" and it works fine. But when I type "locale -a", ca_AD and other stuffs don't appear. Then in python console when I type "import locale;locale.setlocale(locale.LC_ALL, "ca_AD"), it returns:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/locale.py", line 539, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

As far away as I know this behavior requires to add the ca_AD locale. As it is said on http://askubuntu.com/questions/76013/how-do-i-add-locale-to-ubuntu-server it can be fix with the command "locale-gen ca_AD"
Comment 5 Gerrit Notification Bot 2014-06-18 10:26:00 UTC
Change 140239 merged by Alexandros Kosiaris:
Tools: Install Catalan locale

https://gerrit.wikimedia.org/r/140239
Comment 6 Yuvi Panda 2014-06-18 10:29:16 UTC
Has been merged, should be present in the nodes in about 30minutes. Can you test and verify after that? Thanks!
Comment 7 Yuvi Panda 2014-06-18 14:50:33 UTC
Verified in the other bug.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links