<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi everyone,<br>
<br>
The documentation is a little sketchy, but I'm not sure that
gettext.find is behaving the way it should. It's definitely not
behaving how I want it to.<br>
<br>
To illustrate, I've created two directories in /tmp/gettext called
'en_US' and just 'en'. Each contains an LC_MESSAGES directory, which in
turn contain test.mo and test.po.<br>
<br>
When I run this:<br>
<blockquote><font face="monospace">gettext.find('test', '/tmp/gettext',
['en','en_US'], True)</font><br>
</blockquote>
<br>
the results I get are this:<br>
<blockquote><font face="monospace">['/tmp/gettext/en_US/LC_MESSAGES/test.mo',
'/tmp/gettext/en/LC_MESSAGES/test.mo']</font><br>
</blockquote>
<br>
The documentation states that it should return 'a list
of all file names, in the order in which they appear in the languages
list', but it's actually doing the exact opposite. The upshot is that
when I specify just 'en', I'm still getting en_US translations.<br>
<br>
I think one of three things is happening:<br>
<ol>
  <li>I'm misunderstanding something, despite searching this forum and
doing a lot of Googling<br>
  </li>
  <li>When searching for the 'en' locale, <font face="monospace">find</font>
just grabs the first English locale it comes across, regardless of the
territory&#8212;it probably depends on their order in the file system<br>
  </li>
  <li>When searching for the 'en' locale, <font face="monospace">find</font>
defaults to U.S. English, a poor choice because U.S. English has far
more spelling and formatting variations than any other version of
English (there are far fewer differences between, say, en_AU and en_GB,
or even en_ZA and en_CA, than en_US and any other)</li>
</ol>
If it's number 1, could somebody help me out? If it's number 2 or 3,
does anybody know of an elegant workaround, and should it be considered
a bug?<br>
<br>
What I want is for U.S. English users to see messages from en_US, and
users who prefer other forms of English (Australian English, Canadian
English, British English, etc.) to see just en. Creating separate
locales for each of them&#8212;there are a dozen or so&#8212;seems impractical.<br>
<br>
Advice?<br>
<br>
Thanks,<br>
Michael Scheper.<br>
<br>
P.S: Changing the system locale doesn't seem to make any difference.<br>
</body>
</html>