开发者

gettext usage for 2 strings that are the same

开发者 https://www.devze.com 2023-04-10 08:05 出处:网络
Is there a more compact way if I want 2 keys have the same value? This works: 开发者_如何学Cmsgid \"Next\"

Is there a more compact way if I want 2 keys have the same value? This works:

开发者_如何学Cmsgid "Next"
msgstr "Pág. seguinte"

msgid "Next page"
msgstr "Pág. seguinte"

I could imagine writing it like this instead but is it legal?

msgid "Next", "Next page"
msgstr "Pág. seguinte"

I have more questions about gettext, what do you recommend? I.e. how to do with html in translations and escape characters.


i think best option is split words in code like:

a = _('next')
b = '%s %s' % ( _('next'), _('page') )

and in .po

msgid "Next"
msgstr "seguinte"
msgid "page"
msgstr "Pág."

why you need to translate html special characters ? For example, © on all languages ©

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号