[PATCH] mercurial: i18n-ja: extra white spaces at line ending

Martin Geisler mg at aragost.com
Mon Nov 1 09:44:47 CDT 2010


FUJIWARA Katsunori <fujiwara at ascade.co.jp> writes:

Hi Katsunori,

> I think that I18N-ready TextWrap should:
>
>   - know not only BYTES but also COLUMNS of specified text and encoding
>
>       for example in Japanese text, FULL-WIDTH(= 2 columns) characters
>       consist of:
>
>       - 2-bytes in CP932(for Win)/EUC-JP(for old UNIX) encoding
>       - 3-bytes in UTF-8(for Mac/recent UNIX) encoding
>
>   - split text by locale sensitive ways
>
>       for example in ordinary Japanese text:
>
>       - there are less whitespaces, even if it is complex one
>
>       - but, in other hand, you can split text anywhere you want,
>         without special characters(e.g.: "-"), even in the middle of
>         word
>
>       - as same as English text, there are some prohibition about the
>         beginning- and end-of-line
>
>       - English text splitting rule should be applied on included
>         English text (e.g.: 'hg command --option' in Japanese help)
>
>       I do not know whether such can be found in other languages, so
>       please teach me if you know such ! > devels
>
>       # I think Chinese does so, does not it ?
>
> but current TextWrap implementatio seems not to be able.

Yeah, I agree. The above requirements are much more complex than what
the naive textwrap module can handle today...

If there are some more or less simple things we can do to make our text
wrapper subclass better, then we should add them, but we can probably
not get 100% perfect output.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list