Closed chbeltz closed 7 years ago
Oh, right!
I didn't even notice it looking for the wrong name because it still worked. Is the Linux file system case-sensitive?
Yes and the manifest part only gets tested/used if you're not installing with the --editable flag. Thanks.
I noticed in testing that no matter the case of the language part of the messages_. files, the language part comes out in caps when installed. Looking at locale info on Ubuntu, I saw Spanish represented as es_ES. So made the following change and it "just worked" after that. Can you try that same change on Windows? If that works, then that would be the final update to this before it can be merged.
diff --git a/rein/lib/localization.py b/rein/lib/localization.py
index c5833af..c216edb 100644
--- a/rein/lib/localization.py
+++ b/rein/lib/localization.py
@@ -8,7 +8,7 @@ def init_localization():
'''prepare l10n'''
# Extract system locale identifier
loc = locale.getdefaultlocale()[0]
- file_name = "messages-%s.mo" % loc.split('_')[0]
+ file_name = "messages-%s.mo" % loc.split('_')[1]
So you're saying the second part of the file name is still upper-case despite pulling in the most recent changes?
If so, try the following
git config core.ignorecase false
before pulling again. Theoretically, people who pull it now should get the lower-case file names so we should try that before going with your solution.
Tried that but have same issue. Git seems to be checking it out right with the lower case. It's just that python setup.py install
is upper casing the last two letters as it installs it to system. The in-place pip install is unlikely to have the same issue.
Next question is probably if setuptools has some locale-awareness causing it to do that.
Out of pure curiosity, did you try deleting your build folder before re-installing after pulling in the lower-case files? It installed lower-case filenames even after I'd upper-cased them because I hadn't cleared the previous build.
This one should work though. I simply upper-cased the locale that's fetched by the script aswell as the file names. I decided to not take your approach of grabbing the second part of the locale as I believe that part sometimes represents a country as opposed to a language (eg: en_GB).
Do try it out and let me know though!
Did a bit of testing and found a few things:
The MANIFEST.in needs to include the locale folder.
I must have included it by mistake but you can git rm the rein/maybe/ folder. I was toying with an idea to require hashcash style hashing as a kind of spam protection.
The other thing is at least my system is looking for messages-es.mo rather than messages-ES.mo so lower casing all of those may make sense. I'm curious if you had a different experience with that. This was on my Ubuntu vm made via https://github.com/ReinProject/devsetup