Is it possible to make two or more msgids matching one msgstr?
For example, both (‘list.empty’) and (‘list.null’) return "There is no any objects yet."
If I write this way in po file:
msgid "list.empty"
msgid "list.null"
msgstr "There is no any objects yet."
It 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."
Looks and works fine but stupid, because once I change one msgstr without another, they return different result.
Does anyone have any better hacks?
You are approaching
gettextin the wrong way, here is how it works:msgidis required for each entrymsgctxtis optional and is used to differentiate between twomsgidrecords with same content that may have different translations.(msgid, msgctxt)is the unique key for the dictionary, ifmsgctxtis missing you can consider itnull.You should read the gettext documentation before implementing as it’s not always straightforward.
In your case, this is how you are supposed to implement it: