[PATCH 1 of 2] merge: use labels in prompts to the user

Yuya Nishihara yuya at tcha.org
Sat Aug 13 21:08:20 EDT 2016


On Sat, 13 Aug 2016 21:54:11 +0900, FUJIWARA Katsunori wrote:
> Making labels more descriptive would resolve this problem (e.g.
> "destination revision" instead of "destination"). But it makes
> prompting message in English very redundant, doesn't it ?
> 
> Or introducing "gettext with context" ? :-)
> 
>   # i18n: "destination" at merging. omit after "@" at translation
>   l10ntext = _c('destination at merging')
>   # _c() returns "destination", if there is no translation
>   # corresponded to "destination at merging" msgid

You can specify msgctxt by 2nd argument of _() for example, and pass
"--keyword=_:1,2c" or "--keyword=_:1,2c,2t" to xgettext to collect them.

https://developer.mozilla.org/en-US/docs/gettext#Using_context_with_msgctxt
https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/xgettext-Invocation.html

msgctxt is concatenated with '\004'.

https://github.com/django/django/blob/master/django/utils/translation/trans_real.py#L346


More information about the Mercurial-devel mailing list