Gettext: Is it a good idea for the message ID to be the english text?

后端 未结 11 1352
春和景丽
春和景丽 2020-12-07 16:45

We\'re getting ready to translate our PHP website into various languages, and the gettext support in PHP looks like the way to go.

All the tutorials I see recommend

11条回答
  •  無奈伤痛
    2020-12-07 17:26

    In addition to the considerations above, there are many cases where you'd want the "key" (msgid) to be different from the source text (English). For example, in the HTML view, I might want to say [yyyy] where the destination and label of that anchor tag depend on the locale of the user. E.g. it might be a link to a social network, and in US it would be Facebook but in China it would be Weibo. So the MsgIds might be something like socialSiteUrl and socialSiteLabel.

    I use a mix.

    For basic strings that I don't think will have conflicts/changes/weird meanings, I'll make the key be the same as the English.

提交回复
热议问题