We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If msgstr is empty msgstr "" shouldn't the original string, untranslated version, be returned?
msgstr ""
After some tests this looks for me the right checks to handle the empty case
func (t *translation) get() string { // Look for translation index 0 if _, ok := t.trs[0]; ok { // handle empty msgstr if len(t.trs[0]) == 0 { return t.id } return t.trs[0] } // Return unstranlated id by default return t.id } func (t *translation) getN(n int) string { // Look for translation index if _, ok := t.trs[n]; ok { // handle empty msgstr if len(t.trs[n]) == 0 { if len(t.pluralID) == 0 { return t.id } return t.pluralID } return t.trs[n] } // Return unstranlated plural by default return t.pluralID }
The text was updated successfully, but these errors were encountered:
756045a
You're right, as defined in https://www.gnu.org/software/gettext/manual/html_node/Untranslated-Entries.html empty translation strings should be handled as "untranslated".
I've pushed a fix for this and will do a small release for it.
Thanks for reporting!
Sorry, something went wrong.
Hi,
The issue is not fixed 100%.
For GetD you do GetND with plural set to 1 but pluralID doesn't get set.
GetD
GetND
1
pluralID
So for empty msgstr you still get "", make sense?
""
4b94e83
leonelquinteros
No branches or pull requests
If msgstr is empty
msgstr ""
shouldn't the original string, untranslated version, be returned?After some tests this looks for me the right checks to handle the empty case
The text was updated successfully, but these errors were encountered: