diff --git a/examples/demo1-i18n/demo1.go.en.json b/examples/demo1-i18n/demo1.go.en.json index 56ea448..67c7101 100644 --- a/examples/demo1-i18n/demo1.go.en.json +++ b/examples/demo1-i18n/demo1.go.en.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Hello from Goffer land and i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Version {{.Arg0}}\n", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Hello from Goffer land and i18n4go" + }, + { + "id": "Version {{.Arg0}}n", + "translation": "Version {{.Arg0}}n" + } +] diff --git a/examples/demo1-i18n/en.all.json b/examples/demo1-i18n/en.all.json index 56ea448..6dbebc4 100644 --- a/examples/demo1-i18n/en.all.json +++ b/examples/demo1-i18n/en.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Hello from Goffer land and i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Version {{.Arg0}}\n", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Hello from Goffer land and i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "Version {{.Arg0}}\n" + } +] diff --git a/examples/demo1-i18n/i18n/resources/de.all.json b/examples/demo1-i18n/i18n/resources/de.all.json index 9ab902d..d9134e6 100644 --- a/examples/demo1-i18n/i18n/resources/de.all.json +++ b/examples/demo1-i18n/i18n/resources/de.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Hallo von Goffer Land und i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Version {{.Arg0}}", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Hallo von Goffer Land und i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "Version {{.Arg0}}" + } +] diff --git a/examples/demo1-i18n/i18n/resources/de_DE.all.json b/examples/demo1-i18n/i18n/resources/de_DE.all.json index 9ab902d..d9134e6 100644 --- a/examples/demo1-i18n/i18n/resources/de_DE.all.json +++ b/examples/demo1-i18n/i18n/resources/de_DE.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Hallo von Goffer Land und i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Version {{.Arg0}}", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Hallo von Goffer Land und i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "Version {{.Arg0}}" + } +] diff --git a/examples/demo1-i18n/i18n/resources/en_US.all.json b/examples/demo1-i18n/i18n/resources/en_US.all.json index 56ea448..6dbebc4 100644 --- a/examples/demo1-i18n/i18n/resources/en_US.all.json +++ b/examples/demo1-i18n/i18n/resources/en_US.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Hello from Goffer land and i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Version {{.Arg0}}\n", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Hello from Goffer land and i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "Version {{.Arg0}}\n" + } +] diff --git a/examples/demo1-i18n/i18n/resources/es.all.json b/examples/demo1-i18n/i18n/resources/es.all.json index 78d61b3..cb679c5 100644 --- a/examples/demo1-i18n/i18n/resources/es.all.json +++ b/examples/demo1-i18n/i18n/resources/es.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Saludos desde la tierra Goffer y i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Versión {{.Arg0}}", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Saludos desde la tierra Goffer y i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "Versión {{.Arg0}}" + } +] diff --git a/examples/demo1-i18n/i18n/resources/es_ES.all.json b/examples/demo1-i18n/i18n/resources/es_ES.all.json index 78d61b3..cb679c5 100644 --- a/examples/demo1-i18n/i18n/resources/es_ES.all.json +++ b/examples/demo1-i18n/i18n/resources/es_ES.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Saludos desde la tierra Goffer y i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Versión {{.Arg0}}", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Saludos desde la tierra Goffer y i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "Versión {{.Arg0}}" + } +] diff --git a/examples/demo1-i18n/i18n/resources/fr.all.json b/examples/demo1-i18n/i18n/resources/fr.all.json index c82316a..586b9f2 100644 --- a/examples/demo1-i18n/i18n/resources/fr.all.json +++ b/examples/demo1-i18n/i18n/resources/fr.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Bonjour de la terre et Goffer i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Version {{.Arg0}}", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Bonjour de la terre et Goffer i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "Version {{.Arg0}}" + } +] diff --git a/examples/demo1-i18n/i18n/resources/fr_FR.all.json b/examples/demo1-i18n/i18n/resources/fr_FR.all.json index e4138c4..13c4e61 100644 --- a/examples/demo1-i18n/i18n/resources/fr_FR.all.json +++ b/examples/demo1-i18n/i18n/resources/fr_FR.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "Bonjour de la terre des Goffer land et de i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "Version {{.Arg0}}\n", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "Bonjour de la terre des Goffer land et de i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "Version {{.Arg0}}\n" + } +] diff --git a/examples/demo1-i18n/i18n/resources/zh.all.json b/examples/demo1-i18n/i18n/resources/zh.all.json index 58042c7..96ac193 100644 --- a/examples/demo1-i18n/i18n/resources/zh.all.json +++ b/examples/demo1-i18n/i18n/resources/zh.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "你好,从高佛尔的土地和i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "版本{{.Arg0}}", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "你好,从高佛尔的土地和i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "版本{{.Arg0}}" + } +] diff --git a/examples/demo1-i18n/i18n/resources/zh_Hans.all.json b/examples/demo1-i18n/i18n/resources/zh_Hans.all.json index 58042c7..96ac193 100644 --- a/examples/demo1-i18n/i18n/resources/zh_Hans.all.json +++ b/examples/demo1-i18n/i18n/resources/zh_Hans.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Hello from Goffer land and i18n4go", - "translation": "你好,从高佛尔的土地和i18n4go", - "modified": false - }, - { - "id": "Version {{.Arg0}}\n", - "translation": "版本{{.Arg0}}", - "modified": false - } -] \ No newline at end of file + { + "id": "Hello from Goffer land and i18n4go", + "translation": "你好,从高佛尔的土地和i18n4go" + }, + { + "id": "Version {{.Arg0}}\n", + "translation": "版本{{.Arg0}}" + } +] diff --git a/i18n4go/cmds/fixup.go b/i18n4go/cmds/fixup.go index 67f891d..13861f4 100644 --- a/i18n4go/cmds/fixup.go +++ b/i18n4go/cmds/fixup.go @@ -388,7 +388,7 @@ func updateTranslations(localMap map[string]common.I18nStringInfo, localeFile st if locale == "en_US" { localMap[value] = common.I18nStringInfo{ID: value, Translation: value} } else { - localMap[value] = common.I18nStringInfo{ID: value, Translation: localMap[key].Translation, Modified: true} + localMap[value] = common.I18nStringInfo{ID: value, Translation: localMap[key].Translation} } delete(localMap, key) } diff --git a/i18n4go/common/cmd.go b/i18n4go/common/cmd.go index 9506cac..b011b02 100644 --- a/i18n4go/common/cmd.go +++ b/i18n4go/common/cmd.go @@ -58,7 +58,6 @@ type Options struct { type I18nStringInfo struct { ID string `json:"id"` Translation string `json:"translation"` - Modified bool `json:"modified"` } type StringInfo struct { diff --git a/integration/extract_strings/s_option_test.go b/integration/extract_strings/s_option_test.go index eeeee14..7636df3 100644 --- a/integration/extract_strings/s_option_test.go +++ b/integration/extract_strings/s_option_test.go @@ -79,13 +79,11 @@ var _ = Describe("extract-strings -s filePath", func() { Ω(translations).To(ContainElement(common.I18nStringInfo{ ID: "a string", Translation: "a string", - Modified: false, })) Ω(translations).To(ContainElement(common.I18nStringInfo{ ID: "show the app details", Translation: "show the app details", - Modified: false, })) }) }) @@ -119,13 +117,11 @@ var _ = Describe("extract-strings -s filePath", func() { Ω(translations).To(ContainElement(common.I18nStringInfo{ ID: "a string", Translation: "a string", - Modified: false, })) Ω(translations).To(ContainElement(common.I18nStringInfo{ ID: "show the app details", Translation: "show the app details", - Modified: false, })) }) }) diff --git a/integration/fixup/fixup_test.go b/integration/fixup/fixup_test.go index ef3d3f3..b05ffa0 100644 --- a/integration/fixup/fixup_test.go +++ b/integration/fixup/fixup_test.go @@ -267,14 +267,13 @@ var _ = Describe("fixup", func() { mappedTranslations, err := common.CreateI18nStringInfoMap(translations) Ω(err).ShouldNot(HaveOccurred()) - Ω(mappedTranslations["I like apples."].Modified).Should(BeTrue()) Ω(mappedTranslations["I like apples."].Translation).ShouldNot(Equal("I like apples.")) }) }) Context("When the user says the translation is new", func() { var ( - apple = common.I18nStringInfo{ID: "I like apples.", Translation: "I like apples.", Modified: false} + apple = common.I18nStringInfo{ID: "I like apples.", Translation: "I like apples."} ) JustBeforeEach(func() { @@ -315,7 +314,7 @@ var _ = Describe("fixup", func() { mappedTranslations, err := common.CreateI18nStringInfoMap(translations) Ω(err).ShouldNot(HaveOccurred()) Ω(mappedTranslations["I'm the extra key"]).Should(Equal( - common.I18nStringInfo{ID: "I'm the extra key", Translation: "I'm the extra key", Modified: false}, + common.I18nStringInfo{ID: "I'm the extra key", Translation: "I'm the extra key"}, )) }) }) diff --git a/integration/merge_strings/d_option_test.go b/integration/merge_strings/d_option_test.go index a2d4b13..9a8179c 100644 --- a/integration/merge_strings/d_option_test.go +++ b/integration/merge_strings/d_option_test.go @@ -15,10 +15,12 @@ package merge_strings_test import ( + "encoding/json" "io/ioutil" "os" "path/filepath" + "github.com/maximilien/i18n4go/i18n4go/common" . "github.com/maximilien/i18n4go/integration/test_helpers" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -73,7 +75,20 @@ var _ = Describe("merge-strings -d dirName", func() { Ω(err).Should(BeNil()) Ω(actualBytes).ShouldNot(BeNil()) - Ω(string(expectedBytes)).Should(Equal(string(actualBytes))) + expectedTranslations := []common.I18nStringInfo{} + err = json.Unmarshal(expectedBytes, &expectedTranslations) + Ω(err).Should(BeNil()) + + actualTranslations := []common.I18nStringInfo{} + err = json.Unmarshal(actualBytes, &actualTranslations) + Ω(err).Should(BeNil()) + + Ω(len(actualTranslations)).Should(Equal(len(expectedTranslations))) + for idx := range actualTranslations { + Ω(actualTranslations[idx].ID).Should(Equal(expectedTranslations[idx].ID)) + Ω(actualTranslations[idx].Translation).Should(Equal(expectedTranslations[idx].Translation)) + } + }) }) @@ -101,7 +116,19 @@ var _ = Describe("merge-strings -d dirName", func() { Ω(err).Should(BeNil()) Ω(actualBytes).ShouldNot(BeNil()) - Ω(string(expectedBytes)).Should(Equal(string(actualBytes))) + expectedTranslations := []common.I18nStringInfo{} + err = json.Unmarshal(expectedBytes, &expectedTranslations) + Ω(err).Should(BeNil()) + + actualTranslations := []common.I18nStringInfo{} + err = json.Unmarshal(actualBytes, &actualTranslations) + Ω(err).Should(BeNil()) + + Ω(len(actualTranslations)).Should(Equal(len(expectedTranslations))) + for idx := range actualTranslations { + Ω(actualTranslations[idx].ID).Should(Equal(expectedTranslations[idx].ID)) + Ω(actualTranslations[idx].Translation).Should(Equal(expectedTranslations[idx].Translation)) + } }) }) }) @@ -140,7 +167,19 @@ var _ = Describe("merge-strings -d dirName", func() { Ω(err).Should(BeNil()) Ω(actualBytes).ShouldNot(BeNil()) - Ω(string(expectedBytes)).Should(Equal(string(actualBytes))) + expectedTranslations := []common.I18nStringInfo{} + err = json.Unmarshal(expectedBytes, &expectedTranslations) + Ω(err).Should(BeNil()) + + actualTranslations := []common.I18nStringInfo{} + err = json.Unmarshal(actualBytes, &actualTranslations) + Ω(err).Should(BeNil()) + + Ω(len(actualTranslations)).Should(Equal(len(expectedTranslations))) + for idx := range actualTranslations { + Ω(actualTranslations[idx].ID).Should(Equal(expectedTranslations[idx].ID)) + Ω(actualTranslations[idx].Translation).Should(Equal(expectedTranslations[idx].Translation)) + } }) }) @@ -168,7 +207,19 @@ var _ = Describe("merge-strings -d dirName", func() { Ω(err).Should(BeNil()) Ω(actualBytes).ShouldNot(BeNil()) - Ω(string(expectedBytes)).Should(Equal(string(actualBytes))) + expectedTranslations := []common.I18nStringInfo{} + err = json.Unmarshal(expectedBytes, &expectedTranslations) + Ω(err).Should(BeNil()) + + actualTranslations := []common.I18nStringInfo{} + err = json.Unmarshal(actualBytes, &actualTranslations) + Ω(err).Should(BeNil()) + + Ω(len(actualTranslations)).Should(Equal(len(expectedTranslations))) + for idx := range actualTranslations { + Ω(actualTranslations[idx].ID).Should(Equal(expectedTranslations[idx].ID)) + Ω(actualTranslations[idx].Translation).Should(Equal(expectedTranslations[idx].Translation)) + } }) }) }) diff --git a/test_fixtures/extract_strings/s_option/expected_output/app.go.en.json b/test_fixtures/extract_strings/s_option/expected_output/app.go.en.json index ffe328c..d89edb2 100644 --- a/test_fixtures/extract_strings/s_option/expected_output/app.go.en.json +++ b/test_fixtures/extract_strings/s_option/expected_output/app.go.en.json @@ -1,12 +1,10 @@ [ - { - "id": "a string", - "translation": "a string", - "modified": false - }, - { - "id": "show the app details", - "translation": "show the app details", - "modified": false - } -] \ No newline at end of file + { + "id": "a string", + "translation": "a string" + }, + { + "id": "show the app details", + "translation": "show the app details" + } +] diff --git a/test_fixtures/fixup/notsogood/extra_foreign_key/translations/zh_CN.all.json b/test_fixtures/fixup/notsogood/extra_foreign_key/translations/zh_CN.all.json index 1d1de48..7cfafb8 100644 --- a/test_fixtures/fixup/notsogood/extra_foreign_key/translations/zh_CN.all.json +++ b/test_fixtures/fixup/notsogood/extra_foreign_key/translations/zh_CN.all.json @@ -1,17 +1,14 @@ [ - { - "id": "Translated hello world!", - "translation": "你好世界!", - "modified": false - }, - { - "id": "For you and for me", - "translation": "为你,为我", - "modified": false - }, - { - "id": "I'm the extra key", - "translation": "I'm the extra key", - "modified": false - } + { + "id": "Translated hello world!", + "translation": "你好世界!" + }, + { + "id": "For you and for me", + "translation": "为你,为我" + }, + { + "id": "I'm the extra key", + "translation": "I'm the extra key" + } ] diff --git a/test_fixtures/fixup/notsogood/missing_foreign_key/translations/en_US.all.json b/test_fixtures/fixup/notsogood/missing_foreign_key/translations/en_US.all.json index d54ec66..25b2eb4 100644 --- a/test_fixtures/fixup/notsogood/missing_foreign_key/translations/en_US.all.json +++ b/test_fixtures/fixup/notsogood/missing_foreign_key/translations/en_US.all.json @@ -1,15 +1,14 @@ [ - { - "id": "Translated hello world!", - "translation": "Translated hello world!" - }, - { - "id": "And the entire human race", - "translation": "And the entire human race" - }, - { - "id": "I'm the extra key", - "translation": "I'm the extra key", - "modified": false - } + { + "id": "Translated hello world!", + "translation": "Translated hello world!" + }, + { + "id": "And the entire human race", + "translation": "And the entire human race" + }, + { + "id": "I'm the extra key", + "translation": "I'm the extra key" + } ] diff --git a/test_fixtures/fixup/notsogood/missing_foreign_key/translations/zh_CN.all.json b/test_fixtures/fixup/notsogood/missing_foreign_key/translations/zh_CN.all.json index c499400..90b0963 100644 --- a/test_fixtures/fixup/notsogood/missing_foreign_key/translations/zh_CN.all.json +++ b/test_fixtures/fixup/notsogood/missing_foreign_key/translations/zh_CN.all.json @@ -1,12 +1,10 @@ [ - { - "id": "Translated hello world!", - "translation": "你好世界!", - "modified": false - }, - { - "id": "And the entire human race", - "translation": "为你,为我", - "modified": false - } + { + "id": "Translated hello world!", + "translation": "你好世界!" + }, + { + "id": "And the entire human race", + "translation": "为你,为我" + } ] diff --git a/test_fixtures/fixup/notsogood/update/translations/en_US.all.json b/test_fixtures/fixup/notsogood/update/translations/en_US.all.json index 36eba90..1d8a5fd 100644 --- a/test_fixtures/fixup/notsogood/update/translations/en_US.all.json +++ b/test_fixtures/fixup/notsogood/update/translations/en_US.all.json @@ -1,17 +1,14 @@ [ - { - "id": "Translated hello world!", - "translation": "Translated hello world!", - "modified": false - }, - { - "id": "And the entire human race", - "translation": "And the entire human race", - "modified": false - }, - { - "id": "I like bananas.", - "translation": "I like bananas.", - "modified": false - } + { + "id": "Translated hello world!", + "translation": "Translated hello world!" + }, + { + "id": "And the entire human race", + "translation": "And the entire human race" + }, + { + "id": "I like bananas.", + "translation": "I like bananas." + } ] diff --git a/test_fixtures/fixup/notsogood/update_add/translations/en_US.all.json b/test_fixtures/fixup/notsogood/update_add/translations/en_US.all.json index 36eba90..1d8a5fd 100644 --- a/test_fixtures/fixup/notsogood/update_add/translations/en_US.all.json +++ b/test_fixtures/fixup/notsogood/update_add/translations/en_US.all.json @@ -1,17 +1,14 @@ [ - { - "id": "Translated hello world!", - "translation": "Translated hello world!", - "modified": false - }, - { - "id": "And the entire human race", - "translation": "And the entire human race", - "modified": false - }, - { - "id": "I like bananas.", - "translation": "I like bananas.", - "modified": false - } + { + "id": "Translated hello world!", + "translation": "Translated hello world!" + }, + { + "id": "And the entire human race", + "translation": "And the entire human race" + }, + { + "id": "I like bananas.", + "translation": "I like bananas." + } ] diff --git a/test_fixtures/merge_strings/d_option/expected_output/en.all.json b/test_fixtures/merge_strings/d_option/expected_output/en.all.json index da85694..5b4082c 100644 --- a/test_fixtures/merge_strings/d_option/expected_output/en.all.json +++ b/test_fixtures/merge_strings/d_option/expected_output/en.all.json @@ -1,107 +1,88 @@ [ { "id": "An unexpected type of error", - "translation": "An unexpected type of error", - "modified": false + "translation": "An unexpected type of error" }, { "id": "Potato", - "translation": "Potato bananana cream pie", - "modified": false + "translation": "Potato bananana cream pie" }, { "id": "Total extracted strings:", - "translation": "Total extracted strings:", - "modified": false + "translation": "Total extracted strings:" }, { "id": "Total files parsed:", - "translation": "Total files parsed:", - "modified": false + "translation": "Total files parsed:" }, { "id": "Total time:", - "translation": "Total time:", - "modified": false + "translation": "Total time:" }, { "id": "a perl-style regular expression for files to ignore, e.g., \".*test.*\"", - "translation": "a perl-style regular expression for files to ignore, e.g., \".*test.*\"", - "modified": false + "translation": "a perl-style regular expression for files to ignore, e.g., \".*test.*\"" }, { "id": "create translation files for different languages using a source file", - "translation": "create translation files for different languages using a source file", - "modified": false + "translation": "create translation files for different languages using a source file" }, { "id": "generate standard .po file for translation", - "translation": "generate standard .po file for translation", - "modified": false + "translation": "generate standard .po file for translation" }, { "id": "generated files are created in directory to match the package name", - "translation": "generated files are created in directory to match the package name", - "modified": false + "translation": "generated files are created in directory to match the package name" }, { "id": "generated files are created in the specified output directory", - "translation": "generated files are created in the specified output directory", - "modified": false + "translation": "generated files are created in the specified output directory" }, { "id": "output directory where the translation files will be placed", - "translation": "output directory where the translation files will be placed", - "modified": false + "translation": "output directory where the translation files will be placed" }, { "id": "prevents any output files from being created", - "translation": "prevents any output files from being created", - "modified": false + "translation": "prevents any output files from being created" }, { "id": "prints the usage", - "translation": "prints the usage", - "modified": false + "translation": "prints the usage" }, { "id": "recursively extract strings from all files in the same directory as filename or dirName", - "translation": "recursively extract strings from all files in the same directory as filename or dirName", - "modified": false + "translation": "recursively extract strings from all files in the same directory as filename or dirName" + }, { "id": "the dir name for which all .go files will have their strings extracted", - "translation": "the dir name for which all .go files will have their strings extracted", - "modified": false + "translation": "the dir name for which all .go files will have their strings extracted" + }, { "id": "the excluded JSON file name, all strings there will be excluded", - "translation": "the excluded JSON file name, all strings there will be excluded", - "modified": false + "translation": "the excluded JSON file name, all strings there will be excluded" }, { "id": "the file name for which strings are extracted", - "translation": "the file name for which strings are extracted", - "modified": false + "translation": "the file name for which strings are extracted" }, { "id": "the source language of the file, typically also part of the file name, e.g., \"en_US\"", - "translation": "the source language of the file, typically also part of the file name, e.g., \"en_US\"", - "modified": false + "translation": "the source language of the file, typically also part of the file name, e.g., \"en_US\"" }, { "id": "verbose mode where lots of output is generated during execution", - "translation": "verbose mode where lots of output is generated during execution", - "modified": false + "translation": "verbose mode where lots of output is generated during execution" }, { "id": "want to extract strings from file or directory", - "translation": "want to extract strings from file or directory", - "modified": false + "translation": "want to extract strings from file or directory" }, { "id": "your public Google Translate API key which is used to generate translations (charge is applicable)", - "translation": "your public Google Translate API key which is used to generate translations (charge is applicable)", - "modified": false + "translation": "your public Google Translate API key which is used to generate translations (charge is applicable)" } -] \ No newline at end of file +] diff --git a/test_fixtures/rewrite_package/d_option/expected_output/doption/en.all.json b/test_fixtures/rewrite_package/d_option/expected_output/doption/en.all.json index 164f92a..75d4f51 100644 --- a/test_fixtures/rewrite_package/d_option/expected_output/doption/en.all.json +++ b/test_fixtures/rewrite_package/d_option/expected_output/doption/en.all.json @@ -1,22 +1,18 @@ [ - { - "id": "cruel", - "translation": "cruel", - "modified": false - }, - { - "id": "Evil", - "translation": "Evil", - "modified": false - }, - { - "id": "Bye from {{.Arg0}}", - "translation": "Bye from {{.Arg0}}", - "modified": false - }, - { - "id": "Hello {{.Arg0}} world!", - "translation": "Hello {{.Arg0}} world!", - "modified": false - } -] \ No newline at end of file + { + "id": "cruel", + "translation": "cruel" + }, + { + "id": "Evil", + "translation": "Evil" + }, + { + "id": "Bye from {{.Arg0}}", + "translation": "Bye from {{.Arg0}}" + }, + { + "id": "Hello {{.Arg0}} world!", + "translation": "Hello {{.Arg0}} world!" + } +] diff --git a/test_fixtures/rewrite_package/d_option/expected_output/doption/test.go.en.json b/test_fixtures/rewrite_package/d_option/expected_output/doption/test.go.en.json index afa4c1d..9346f84 100644 --- a/test_fixtures/rewrite_package/d_option/expected_output/doption/test.go.en.json +++ b/test_fixtures/rewrite_package/d_option/expected_output/doption/test.go.en.json @@ -1,22 +1,18 @@ [ - { - "id": "cruel", - "translation": "cruel", - "modified": false - }, - { - "id": "Bye from {{.Arg0}}", - "translation": "Bye from {{.Arg0}}", - "modified": false - }, - { - "id": "Evil", - "translation": "Evil", - "modified": false - }, - { - "id": "Hello {{.Arg0}} world!", - "translation": "Hello {{.Arg0}} world!", - "modified": false - } -] \ No newline at end of file + { + "id": "cruel", + "translation": "cruel" + }, + { + "id": "Bye from {{.Arg0}}", + "translation": "Bye from {{.Arg0}}" + }, + { + "id": "Evil", + "translation": "Evil" + }, + { + "id": "Hello {{.Arg0}} world!", + "translation": "Hello {{.Arg0}} world!" + } +] diff --git a/test_fixtures/rewrite_package/d_option/expected_output/doption/test2.go.en.json b/test_fixtures/rewrite_package/d_option/expected_output/doption/test2.go.en.json index 1a85dc3..e619fd7 100644 --- a/test_fixtures/rewrite_package/d_option/expected_output/doption/test2.go.en.json +++ b/test_fixtures/rewrite_package/d_option/expected_output/doption/test2.go.en.json @@ -1,22 +1,18 @@ [ - { - "id": "cruel", - "translation": "cruel", - "modified": false - }, - { - "id": "Hello {{.Arg0}} world!", - "translation": "Hello {{.Arg0}} world!", - "modified": false - }, - { - "id": "Evil", - "translation": "Evil", - "modified": false - }, - { - "id": "Bye from {{.Arg0}}", - "translation": "Bye from {{.Arg0}}", - "modified": false - } -] \ No newline at end of file + { + "id": "cruel", + "translation": "cruel" + }, + { + "id": "Hello {{.Arg0}} world!", + "translation": "Hello {{.Arg0}} world!" + }, + { + "id": "Evil", + "translation": "Evil" + }, + { + "id": "Bye from {{.Arg0}}", + "translation": "Bye from {{.Arg0}}" + } +]