Pass helpers into strings.load_strings instead of importing it, so fix issue with cx_Freeze in Windows

This commit is contained in:
Micah Lee 2016-09-04 20:09:18 -07:00
parent 7e8b3e1750
commit dbf4af02ac
3 changed files with 3 additions and 6 deletions

View File

@ -102,7 +102,7 @@ def main(cwd=None):
The main() function implements all of the logic that the command-line version of
onionshare uses.
"""
strings.load_strings()
strings.load_strings(helpers)
print(strings._('version_string').format(helpers.get_version()))
# onionshare CLI in OSX needs to change current working directory (#132)

View File

@ -19,12 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import json, locale, os
from . import helpers
strings = {}
def load_strings(default="en"):
def load_strings(helpers, default="en"):
"""
Loads translated strings and fallback to English
if the translation does not exist.

View File

@ -284,7 +284,7 @@ def main():
"""
The main() function implements all of the logic that the GUI version of onionshare uses.
"""
strings.load_strings()
strings.load_strings(helpers)
print(strings._('version_string').format(helpers.get_version()))
# start the Qt app