Msgstr "for msgstr" in gettext

Is it possible to make two or more msgid corresponding to one of msgstr?

For example, like ('list.empty') and ('list.null') return"There is no any objects yet."

If I write this path in the po file:

msgid "list.empty"
msgid "list.null"
msgstr "There is no any objects yet."

These are just errors with "missing" msgstr ":

However

msgid "list.empty"
msgstr "There is no any objects yet."

msgid "list.null"
msgstr "There is no any objects yet."

It looks and works fine, but stupid, because as soon as I change one of msgstr without the other, they return different results.

Does anyone have the best hacks?

+3
source share
1 answer

You are approaching gettextwrong, here's how it works:

  • msgid required for each entry
  • msgctxt msgid , .
  • (msgid, msgctxt) - , msgctxt , null.

gettext documentation , .

:

msgctxt "list.empty"
msgid "There is no any objects yet."

msgctxt "list.null"
msgid "There is no any objects yet."
+7

All Articles