From efa1197af3d59d7cd2ecf8652ee08d81a72f049b Mon Sep 17 00:00:00 2001 From: aitzol76 Date: Sun, 16 Oct 2022 16:34:39 +0200 Subject: [PATCH] test --- po2json/po2json.go | 2 -- po2json/po2json_test.go | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 po2json/po2json_test.go diff --git a/po2json/po2json.go b/po2json/po2json.go index 5ad339f..d8ed7ac 100644 --- a/po2json/po2json.go +++ b/po2json/po2json.go @@ -8,8 +8,6 @@ import "strings" type msgIdStrPairs map[string]string type localesMsg map[string]msgIdStrPairs -//const pattern = `msgid "(.+)"\nmsgstr "(.+)"` -//const patternP = `msgid "(.+)"\nmsgid_plural "(.+)"\nmsgstr\[.\] "(.+)"\nmsgstr\[.\] "(.+)"` var pattern = [2] string {`msgid "(.+)"\nmsgstr "(.+)"`,`msgid "(.+)"\nmsgid_plural "(.+)"\nmsgstr\[.\] "(.+)"\nmsgstr\[.\] "(.+)"`} func getPOPath(locale, domain, localedir string) string { diff --git a/po2json/po2json_test.go b/po2json/po2json_test.go new file mode 100644 index 0000000..e453103 --- /dev/null +++ b/po2json/po2json_test.go @@ -0,0 +1,14 @@ +package po2json + +import "testing" + +func TestAll(t *testing.T) { + locales := []string{"en_UK", "eu_ES"} + const domain = "base" + const localedir = "locales" + + t.Log(getPOPath(locales[0], domain, localedir)) + t.Log(getPOPath(locales[1], domain, localedir)) + + t.Log(PO2JSON(locales, domain, localedir)) +} \ No newline at end of file