Rewrite PO headers parsing and handling. Implement correct GNU gettext headers format. Fix tests. Fixes #10

This commit is contained in:
Leonel Quinteros
2017-09-08 18:08:56 -03:00
parent 1bb93891f4
commit 1fc8dec04d
4 changed files with 166 additions and 109 deletions

View File

@@ -9,8 +9,8 @@ import (
func TestLocale(t *testing.T) {
// Set PO content
str := `
# msgid ""
# msgstr ""
msgid ""
msgstr ""
# Initial comment
# Headers below
"Language: en\n"
@@ -38,8 +38,6 @@ msgstr[abc] "Wrong index"
msgstr[1 "Forgot to close brackets"
msgstr[0] "Badly formatted string'
msgid "Invalid formatted id[] with no translations
msgctxt "Ctx"
msgid "One with var: %s"
msgid_plural "Several with vars: %s"