Previously reported on WeblateOrg/weblate#6350
Characters with the East Asian Width property being "Fullwidth" or "Wide" shall be counted as two "characters" wide when wrapping messages in gettext files.
Looking at the code for a bit, since PoWrapper inherits textwrap.TextWrapper, it appears that achieving this will require an alternative implementation of textwrap.TextWrapper. https://bugs.python.org/issue24665 and python/cpython#89 contain some discussions and patches to implement this in TextWrapper, but the changes were rejected by upstream. The author also published it as an external library: https://gitlab.com/fgallaire/cjkwrap | https://pypi.org/project/CJKwrap/
Previously reported on WeblateOrg/weblate#6350
Characters with the East Asian Width property being "Fullwidth" or "Wide" shall be counted as two "characters" wide when wrapping messages in gettext files.
Looking at the code for a bit, since
PoWrapperinheritstextwrap.TextWrapper, it appears that achieving this will require an alternative implementation oftextwrap.TextWrapper. https://bugs.python.org/issue24665 and python/cpython#89 contain some discussions and patches to implement this inTextWrapper, but the changes were rejected by upstream. The author also published it as an external library: https://gitlab.com/fgallaire/cjkwrap | https://pypi.org/project/CJKwrap/