-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gettext.translation error while running with Python3.6 #2
Comments
Sorry for coming back to this but is there anybody out there who got PyTone working with python3? |
It seems that your locales are missing. Try adjusting the paths and then running the gettext.sh script in the top level directory of the repository. In a properly released version, the generated files are contained. When running directly from the repository, however, you need to do this translation by yourself. |
That's good to know! I'm indeed running PyTone directly from the repository and had no idea that I have to create the locales myself ;-) diff --git a/src/pytone.py b/src/pytone.py
index 6462dbf..a380182 100755
--- a/src/pytone.py
+++ b/src/pytone.py
@@ -138,7 +138,7 @@ try:
config.finishconfigsection(pluginconfig)
pluginconfig = pluginconfig()
plugins.append((pluginmodule, pluginconfig))
- log.info(_("Plugin '%s' loaded" % name))
+ log.info(_("Plugin '%s' loaded") % name)
except Exception as e:
log.error(_("Cannot load plugin '%s': %s") % (name, e))
log.debug_traceback() But I still get the same error message as above 🤔 |
diff --git a/gettext.sh b/gettext.sh
index 7cb9ca5..da1d38f 100755
--- a/gettext.sh
+++ b/gettext.sh
@@ -4,8 +4,10 @@ POTFILE=locale/PyTone.pot
LOCALES="de it pl fr"
# Adjust the following paths as necessary
-PYGETTEXTPATH=/Library/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/i18n
-GETTEXTPATH=/usr/local/opt/gettext/bin
+# PYGETTEXTPATH=/Library/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/i18n
+PYGETTEXTPATH=/home/altendky/.pyenv/source/3.8.0/Python-3.8.0/Tools/i18n
+# GETTEXTPATH=/usr/local/opt/gettext/bin
+GETTEXTPATH=/usr/bin
$PYGETTEXTPATH/pygettext.py -o $POTFILE src/*.py src/services/*.py src/services/songdbs/*.py src/services/players/*.py
for locale in $LOCALES; do
diff --git a/src/pytone.py b/src/pytone.py
index 6462dbf..4e044cc 100755
--- a/src/pytone.py
+++ b/src/pytone.py
@@ -38,7 +38,7 @@ import importlib, importlib.util
import gettext
locallocaledir = os.path.join(os.path.dirname(sys.argv[0]), "../locale")
-gettext.translation("PyTone", locallocaledir).install()
+gettext.translation("PyTone", locallocaledir, languages=['it']).install()
##############################################################################
# locale initialization Above patch to 7bb928f got past the error for me. My machine would be setup for English and I do not know my way around Note that Looks like maybe |
Adding But a new problem arises: the bufferedao extension. If I keep it enabled in |
Some notes on the previous comments.
|
Wow, I did read that deprecation much too quickly. Thank you for the correction. And yes, it is odd that |
Oh I wasn't aware that those scripts where in place for me - thank you for that! And sorry for mentioning the problem with the bufferedao extension. I wasn't sure indeed whether to place it in this issue (with the title "Error running with Python 3.6") or open another issue for it. I've changed the title for this issue to make it more specific and I will open another issue for the bufferedao extension. Thank you so much guys for keeping this (for me so precious) app alive!!! :) |
I'm getting the following error when I try to run PyTone under Python3.6:
Is the Python3 port already usable or am I just too early with my wishful thinking? ;-)
The text was updated successfully, but these errors were encountered: