From 12ca7aa085a826302c9f983936bacb2e93b10704 Mon Sep 17 00:00:00 2001 From: Paul Stenius Date: Tue, 4 Mar 2025 19:26:21 -0500 Subject: [PATCH] feat: add a make add string command to add new localized strings --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 0925237f..b5a79f09 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,16 @@ run: clean: @ rm -f $(APP)-* $(APP) $(APP)*.rpm $(APP)*.deb $(APP)*.exe $(APP)*.sha256 +.PHONY: add-string +add-string: + cd internal/locale/translations && \ + for file in *.json; do \ + jq --indent 4 --arg key "$(KEY)" --arg val "$(VAL)" \ + '. + {($$key): $$val} | to_entries | sort_by(.key) | from_entries' "$$file" > tmp && \ + mv tmp "$$file"; \ + done + + test: go test -cover -race -count=1 ./...