From 2e90e5171054626163caeb24038babe04442c2a1 Mon Sep 17 00:00:00 2001 From: Goutte Date: Tue, 4 Apr 2023 04:46:33 +0200 Subject: [PATCH] feat(i18n): add `make i18n_extract` and `make i18n_merge` Flow is as follows: make i18n_extract make i18n_merge ? --- .gitignore | 3 +++ Makefile | 7 +++++++ translations/active.en.toml | 4 ++++ translations/active.fr.toml | 7 +++++++ 4 files changed, 21 insertions(+) diff --git a/.gitignore b/.gitignore index c7b459e4..ed0966fe 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ _cgo_export.* _testmain.go +# Translation files +translations/translate.*.toml + # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore # swap [._]*.s[a-w][a-z] diff --git a/Makefile b/Makefile index 0da8d7aa..7098c2d8 100644 --- a/Makefile +++ b/Makefile @@ -33,3 +33,10 @@ install_deps: clean: rm -rf $(BIN) + +i18n_extract: + goi18n extract -outdir translations + goi18n merge -outdir translations translations/* + +i18n_merge: + goi18n merge -outdir translations translations/* diff --git a/translations/active.en.toml b/translations/active.en.toml index 212e2007..8484267e 100644 --- a/translations/active.en.toml +++ b/translations/active.en.toml @@ -5,3 +5,7 @@ other = "Error" [ExclusiveFlagsValidationError] description = "error shown when multiple exclusive flags are provided (group flags, offending flags)" other = "if any flags in the group [%v] are set none of the others can be; %v were all set" + +[RunHelpTip] +description = "tip shown when a command fails (command path)" +other = "Run '%v --help' for usage." diff --git a/translations/active.fr.toml b/translations/active.fr.toml index 10d2aa24..a869d332 100644 --- a/translations/active.fr.toml +++ b/translations/active.fr.toml @@ -1,7 +1,14 @@ [Error] description = "prefix of error messages" +hash = "sha1-7dcb56355a3ddc7ff7e5ccd6522507999ca7f238" other = "Erreur" [ExclusiveFlagsValidationError] description = "error shown when multiple exclusive flags are provided (group flags, offending flags)" +hash = "sha1-221b98bada52cfc2932f9aa5142b653b46baded6" other = "les options [%v] sont exclusives, mais les options %v ont été fournies" + +[RunHelpTip] +description = "tip shown when a command fails (command path)" +hash = "sha1-e1d2c4cccd484df365c3249347d5172981929b88" +other = "Essayez '%v --help' pour obtenir de l'aide."