Fix #417 - bad relative path breaks translations #733

Merged
digital-dreamer merged 1 commits from fix-417-relative-path into master 2014-11-13 22:35:37 +01:00
digital-dreamer commented 2014-11-12 11:53:58 +01:00 (Migrated from github.com)

Problem: Translations don't work when user launches bitmessagemain.py from another directory, like “src/bimessagmain.py”.

This problem was caused by incorrect fallback to an empty string when _MEIPASS is not present. This happens when bitmessage is not running from a onefile executable. In that case, PyInstaller's variable _MEIPASS is not defined, and because empty string is chosen as root path, the path to translations can only work by accident - if user happens to be in that directory.

Solution: if _MEIPASS is not present, fall back to sys.path[0](the location of bitmessagemain.py) so that it works in both modes.

Problem: Translations don't work when user launches bitmessagemain.py from another directory, like “src/bimessagmain.py”. This problem was caused by incorrect fallback to an empty string when _MEIPASS is not present. This happens when bitmessage is not running from a onefile executable. In that case, PyInstaller's variable _MEIPASS is not defined, and because empty string is chosen as root path, the path to translations can only work by accident - if user happens to be in that directory. Solution: if _MEIPASS is not present, fall back to sys.path[0](the location of bitmessagemain.py) so that it works in both modes.
Atheros1 commented 2014-11-13 22:35:48 +01:00 (Migrated from github.com)

Thank you!

Thank you!
This repo is archived. You cannot comment on pull requests.
No description provided.