[LinuxCNC/linuxcnc PR#532] Change the string “Home” to “home” to distinguish translations.

未分类 bolang 5个月前 (10-15) 27次浏览

Issue #532 | 状态: 已关闭 | 作者: Solitarily | 创建时间: 2018-11-26


There are several places where the code uses the “Home” string, but they represent different meanings, such as “machine reference point” and the keyboard “Home” button. So I changed it to “home” so that I can distinguish when translating. This change will not affect translations in other countries, because “home” is already used in “tklinuxcnc.tcl”, which has the same meaning as the string I changed, and stands for “machine reference point”.


评论 (4)

#1 – jepler 于 2018-11-27

I looked into the issue of translation “context” a little bit. In GNU gettext, there are functions such as ‘pgettext’ which take two arguments, with one of them being a context: https://www.gnu.org/software/gettext/manual/html_node/Contexts.html — read the link for more info about how this works.

Unfortunately, in Python’s wrapping of gettext, a similar function is not supported.

The implementation of ‘pgettext’ is to concatenate , look it up in the catalog. If it’s there, that string is returned; otherwise, the original is returned.

It is possible to “monkey patch” python’s gettext module to support pgettext, and this is definitely something to consider, but it is also very expedient to adopt a convention like this if it helps improve the quality of the translations with such a small amount of effort.


#2 – jepler 于 2018-11-27

so e.g., for instance if someone contributed an implementation of pgettext, we would establish that there is a ‘keycap name’ context, so you would pgettext(“keycap”, “Home”) instead of just writing _(“Home”)


#3 – jepler 于 2018-11-27

@c-morley any objection to merging this?


#4 – c-morley 于 2018-11-28

I agree long term something better would be nicer. Pncconf’s life span is coming to an end fairly soon.
This change is a good compromise.
Thank you.


原始Issue: https://github.com/LinuxCNC/linuxcnc/pull/532

喜欢 (0)