diff options
| author | nytpu <alex@nytpu.com> | 2021-05-11 18:35:33 -0600 |
|---|---|---|
| committer | nytpu <alex@nytpu.com> | 2021-05-11 18:35:33 -0600 |
| commit | 60da14d1d3c61e715abed710d66e13b32f261382 (patch) | |
| tree | 3f18a04e4601fe491a92c5754c4eba346b8f8ebe | |
| parent | c6b4cad199e211cf0a1c11870d9e38b0cc14a2dc (diff) | |
add translation for writing files in comitium.json (I didn't notice them before)
| -rw-r--r-- | comitium.go | 15 | ||||
| -rw-r--r-- | localizations_src/en-US/errors.yaml | 1 | ||||
| -rw-r--r-- | localizations_src/fr-FR/errors.yaml | 1 |
3 files changed, 14 insertions, 3 deletions
diff --git a/comitium.go b/comitium.go index 0d3af19..ce5bc5e 100644 --- a/comitium.go +++ b/comitium.go @@ -118,17 +118,26 @@ func main() { } err = core.Data.WriteSubs(dataPath) if err != nil { - fmt.Fprintf(os.Stderr, "Error saving subscriptions: %v\n", err) + fmt.Fprintf(os.Stderr, core.TranslateString( + "%s\n", "errors.saving", + &localizations.Replacements{"file": "subscriptions.gmi", "error": err}, + )) os.Exit(1) } err = core.Data.WriteFeed(dataPath) if err != nil { - fmt.Fprintf(os.Stderr, "Error writing feed: %v\n", err) + fmt.Fprintf(os.Stderr, core.TranslateString( + "%s\n", "errors.saving", + &localizations.Replacements{"file": "feed.gmi", "error": err}, + )) os.Exit(1) } err = core.Data.WriteJSON(dataPath) if err != nil { - fmt.Fprintf(os.Stderr, "Error saving subscriptions json: %v\n", err) + fmt.Fprintf(os.Stderr, core.TranslateString( + "%s\n", "errors.saving", + &localizations.Replacements{"file": "comtitium.json", "error": err}, + )) os.Exit(1) } } diff --git a/localizations_src/en-US/errors.yaml b/localizations_src/en-US/errors.yaml index 52f9cf6..6a53211 100644 --- a/localizations_src/en-US/errors.yaml +++ b/localizations_src/en-US/errors.yaml @@ -8,6 +8,7 @@ no_url_add: Please provide a URL to add. no_url_remove: Please provide a URL to remove. url_parse: 'Error parsing URL: {{.error}}' url_add: 'Error adding URL: {{.error}}' +saving: 'Error writing ''{{.file}}'': {{.error}}' no_argument: '{{.command}} doesn''t take an argument!' diff --git a/localizations_src/fr-FR/errors.yaml b/localizations_src/fr-FR/errors.yaml index 327a56b..5a5cfef 100644 --- a/localizations_src/fr-FR/errors.yaml +++ b/localizations_src/fr-FR/errors.yaml @@ -8,6 +8,7 @@ no_url_add: Merci d'indiquer une URL à ajouter. no_url_remove: Merci d'indiquer une URL à supprimer. url_parse: 'Erreur lors de l''analyse de l''URL: {{.error}}' url_add: 'Erreur lors de l''ajout de l''URL: {{.error}}' +saving: 'erreur lors de l''écriture de ''{{.file}}'': {{.error}}' no_argument: '{{.command}} ne prend pas d''argument!' |
