Comments (8)
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.
from pytone.
Some notes on the previous comments.
- gettext.sh and msgftm.sh are part of my pre-release scripts that I added for Stefan's convenience to the repository. They were actually never intended to be run by users.
- gettext.translation() is not deprecated in Python 3.8, only one of its arguments.
- Fallback=true is a reasonable solution if no locale corresponding to the locale settings is available. I am a bit surprised that this issue only pops up now, but maybe there was a change in the gettext module that I am not aware of.
- Please open separate, specific issues for unrelated problems. Thanks!
from pytone.
Sorry for coming back to this but is there anybody out there who got PyTone working with python3?
from pytone.
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 ;-)
I've modified the paths in both scripts gettext.sh
and msgfmt.sh
and ran both scripts.
gettext.sh
first ended with an error and I had to modify src/pytone.py
to run it successfully. Not that I understand a thing about Python but the script ran afterwards ... ;-)
Here are the changes that I made:
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
from pytone.
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 gettext
. But, it seems to just be a matter of getting a default language set or somesuch.
Note that gettext.translate()
was just deprecated with 3.8.
https://docs.python.org/3/library/gettext.html#gettext.translation
Looks like maybe fallback=True
is what is wanted. I'll file a PR and reference this issue so others can easily try it out.
from pytone.
Adding fallback=True
resolves indeed the problem with the gettext.translation
error I've reported.
But a new problem arises: the bufferedao extension. If I keep it enabled in setup.py
and run python3 ./setup.py build_ext -i
I get a segfault running the application. The logfile for the segfault is attached below.
2019-11-26-segfault-with-bufferedao.log
from pytone.
Wow, I did read that deprecation much too quickly. Thank you for the correction. And yes, it is odd that fallback=True
hasn't been needed before unless this has only been run with de/fr/it/pl locales and never en etc. I looked and a quick glance over the py2 docs for gettext.translation() at least showed the same option and default. But, I've never actually used gettext so I have no real knowledge in the area.
from pytone.
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!!! :)
from pytone.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytone.