Skip to content

Support translation message contexts #1524

@nvaccessAuto

Description

@nvaccessAuto

Reported by jteh on 2011-05-26 00:47
There are necessarily a lot of short translatable strings in NVDA. However, some of these should be translated differently depending on the context. An example of this is the word "none", which is used for both symbol level and the eSpeak variant name.

Message contexts can be used to differentiate between these. In the code, we would write something like pgettext("symbol level", "none"). "symbol level" would then show up in the .po file in an msgctxt field. (See the Contexts section of the gettext manual for further details.)

Unfortunately, Python doesn't yet support this, and even when it does, it won't be in Python 2.x. However, it is fairly trivial for us to support fetching the right message in our code. The problem is that pygettext and msgfmt.py don't support this. There's a patch to update msgfmt.py, but I think we should just switch to the real gettext tools, as there are also other reasons to do this.

Notes:

One major problem is that poedit doesn't support viewing contexts yet and many of our translators rely on poedit.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions