Skip to content

Wrapping of PO file should take into account the East Asian Width (wide/fullwidth) #4452

@alvinhochun

Description

@alvinhochun

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/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions