Closed JustinWingChungHui closed 4 years ago
HI @JustinWingChungHui,
From the description it appears that the bug is related to compilemessages & we can't do much about it.
Although, I would be interested in finding the root cause. It may take some time due to my other commitments.
It happens when it gets put through Google translate. %
becomes %
and (
becomes (
which are different Unicode characters.
You can see what happens if you input %(placeholder)s
on the online Google translate site.
So either compilemessages needs to also recognise these two other characters to denote a placeholder or django-autotranslate needs to do something clever (not sure what!) with the placeholder for Asian languages.
Ah! I remember @generalov did some exceptional work & handled it here.
Ran the tests with these strings:
#: test_project/settings.py:16
#, python-format
msgid "Hello %(placeholder)s"
msgstr "你好 %(placeholder)s"
#: test_project/urls.py:27
#, python-format
msgid "Hello %(World)s"
msgstr "你好,世界__" <---------- 'World' got translated :/
There is definite need for improvement here. :+1: I'll try to work on the issue this weekend.
Meanwhile, a PR is always welcomed :smile:
Stale issue message
When converting something like
Hello %(placeholder)s
To Chinese becomes:
您好%(占位符)
The
%
symbol becomes a different Unicode character%
. The(
character also becomes a different Unicode character(
. Also sometimes thes
disappears or moves.And so this unfortunately fails at the
compilemessages
stage