Comments (9)
Indeed, looks like a bug in translate-toolkit, but I will look deeper at it tomorrow.
from weblate.
If I give project_id=limnoria.pk
instead of project=limnoria
, I get the same traceback, with TypeError: 'dict' object is not callable
from weblate.
Actually it might be bug on Weblate side - can you try whether using SubProjects.objects.create(...) instead of SubProject(...) + .save would work?
from weblate.
It does not change anything.
from weblate.
Okay, I was able to reproduce and it looks still pretty weird:
- interactive interpreter sets _ to last return value
- translate-toolkit uses _ function without defining it
Combining this leads to this bug. It is not exposed when using web interface because it of course does not use interactive interpreter.
As workaround you can create dummy function:
>>> def _(x):
... return x
...
I'll try to find proper solution for this.
from weblate.
It looks like when _ is not defined, ttkit automatically creates one:
Python 2.7.3rc2 (default, Apr 5 2012, 14:36:30)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import storage.factory
>>> x = storage.factory.getobject('../locale/cs/LC_MESSAGES/django.po')
>>> _
<bound method NullTranslations.ugettext of <gettext.NullTranslations instance at 0xd6a1b8>>
>>>
Python 2.7.3rc2 (default, Apr 5 2012, 14:36:30)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import storage.factory
>>> 'foo'
'foo'
>>> x = storage.factory.getobject('../locale/cs/LC_MESSAGES/django.po')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "storage/factory.py", line 180, in getobject
storeclass = getclass(storefile, ignore, classes=classes, classes_str=classes_str, hiddenclasses=hiddenclasses)
File "storage/factory.py", line 159, in getclass
module = __import__("translate.storage.%s" % _module, globals(), {}, _module)
File "/usr/lib/python2.7/dist-packages/translate/storage/po.py", line 43, in <module>
from translate.storage.pypo import * # pylint: disable-msg=W0401
File "/usr/lib/python2.7/dist-packages/translate/storage/pypo.py", line 33, in <module>
from translate.storage import pocommon, base, poparser
File "/usr/lib/python2.7/dist-packages/translate/storage/pocommon.py", line 191, in <module>
class pofile(poheader.poheader, base.TranslationStore):
File "/usr/lib/python2.7/dist-packages/translate/storage/pocommon.py", line 192, in pofile
Name = _("Gettext PO file") # pylint: disable-msg=E0602
TypeError: 'str' object is not callable
>>> _
'foo'
from weblate.
Workarounded in git, thanks for reporting this.
from weblate.
_ is automatically created when gettext.install() is called.
I thought it was only in the current module, through
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
from weblate.
It is created by translate.i18n when it does not exist. However interactive interpreter creates _ as return value of last command, what breaks the things. Anyway there should be workaround for that now.
from weblate.
Related Issues (20)
- Placeholder mismatch detection HOT 2
- More optimization options HOT 2
- Problem creating new components. HOT 2
- Low Accessibility rate HOT 3
- Server error upon commit/push HOT 2
- Glossary screenshots enhancement HOT 3
- Time to use `build` from `setuptools` instead of `distutils`? HOT 3
- Cannot add project-wide Add-on 'Squash Git commits' HOT 2
- Word counter HOT 3
- Java Properties components fail with project-wide JSON Customize Add-on HOT 2
- Add support for Apple XLIFF HOT 5
- Had to disable Sentry when upgrading to Weblate 5.5 HOT 3
- Components list stays empty in team creation dialog even after choosing a project HOT 3
- All add-ons have been removed HOT 4
- Make development easier HOT 1
- assigning component lists to teams HOT 3
- Add component filtering based on key HOT 3
- Exception upon clicking on the 'Add User' button HOT 2
- Cannot add users HOT 1
- Broken layout on the glossary HOT 1
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 weblate.