Skip to content

Commit

Permalink
ref(locale): rename i18n to locale (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Aug 11, 2024
1 parent 3b5f1d7 commit 8421a4e
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
24 changes: 12 additions & 12 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tasks:

ti:
cmds:
- go test ./i18n
- go test ./locale

dry:
cmds:
Expand Down Expand Up @@ -72,7 +72,7 @@ tasks:

watchvi:
cmds:
- ginkgo watch -v -r -p ./i18n
- ginkgo watch -v -r -p ./locale

watch:
cmds:
Expand Down Expand Up @@ -105,44 +105,44 @@ tasks:

clear:
cmds:
- rm ./i18n/out/* --recursive
- rm ./locale/out/* --recursive

# extract i18m messages
extract:
cmds:
- goi18n extract
-format json
-sourceLanguage "en-GB"
-outdir ./i18n/out/l10n
-outdir ./locale/out/l10n

# new translation
newt:
deps: [extract]
cmds:
- touch ./i18n/out/l10n/translate.en-US.json
- touch ./locale/out/l10n/translate.en-US.json

# derive a translation from the default
merge:
cmds:
- goi18n merge
-format json
-sourceLanguage "en-GB"
-outdir ./i18n/out
./i18n/out/active.en-GB.json ./i18n/out/l10n/translate.en-US.json
-outdir ./locale/out
./locale/out/active.en-GB.json ./locale/out/l10n/translate.en-US.json

# update existing translations
# after running this task, the translation file generated will
# contain only the new translations. Update the active file,
# with the new translations. Also, need to copy the default
# file (active.en-GB.json) back into ./i18n/default
# file (active.en-GB.json) back into ./locale/default
update:
deps: [extract]
cmds:
- goi18n merge
-format json
-sourceLanguage "en-GB"
-outdir ./i18n/out
./i18n/out/active.en-GB.json ./i18n/deploy/active.en-US.json
-outdir ./locale/out
./locale/out/active.en-GB.json ./locale/deploy/active.en-US.json

# run this after manual translation has occurred to integrate it
# back into the translation file. Unfortunately, this task doesn't
Expand All @@ -154,5 +154,5 @@ tasks:
- goi18n merge
-format json
-sourceLanguage "en-US"
-outdir ./i18n/temp
./i18n/out/translate.en-US.json ./i18n/deploy/active.en-US.json
-outdir ./locale/temp
./locale/out/translate.en-US.json ./locale/deploy/active.en-US.json
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions i18n/i18n_suite_test.go β†’ locale/locale_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package i18n_test
package locale_test

import (
"testing"
Expand All @@ -7,7 +7,7 @@ import (
. "github.com/onsi/gomega" //nolint:revive // gomega ok
)

func TestI18n(t *testing.T) {
func TestLocale(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "I18n Suite")
RunSpecs(t, "locale Suite")
}
2 changes: 1 addition & 1 deletion i18n/messages-errors.go β†’ locale/messages-errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package i18n
package locale

import (
"github.com/snivilised/extendio/i18n"
Expand Down
2 changes: 1 addition & 1 deletion i18n/messages-general.go β†’ locale/messages-general.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package i18n
package locale

import (
"github.com/snivilised/extendio/i18n"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package i18n_test
package locale_test

import (
"github.com/snivilised/extendio/i18n"
Expand Down
2 changes: 1 addition & 1 deletion i18n/translate-defs.go β†’ locale/translate-defs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package i18n
package locale

// CLIENT-TODO: Should be updated to use url of the implementing project,
// so should not be left as astrolib. (this should be set by auto-check)
Expand Down

0 comments on commit 8421a4e

Please sign in to comment.