mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-28 03:19:38 +00:00
test: add translation validation system with CI integration (#4306)
* feat: add translation validation script and update JSON files Introduced a new script `validate-translations.sh` to validate the structure of JSON translation files against an English reference. This script checks for missing and extra translation keys, ensuring consistency across language files. Additionally, several JSON files were updated to include new keys and improve existing translations, enhancing the overall localization efforts for the application. Signed-off-by: Deluan <deluan@navidrome.org> * feat: enhance translation validation script Updated the translation validation script to improve its functionality and usability. The script now validates JSON translation files against a reference English file, checking for JSON syntax, structural integrity, and reporting missing or extra keys. It also integrates with GitHub Actions for CI/CD, providing annotations for errors and warnings. Additionally, the usage instructions have been clarified, and verbose output options have been added for better debugging. Signed-off-by: Deluan <deluan@navidrome.org> * revert translations Signed-off-by: Deluan <deluan@navidrome.org> * fix: Hungarian translation JSON structure Signed-off-by: Deluan <deluan@navidrome.org> * chore: update testall target in Makefile Modified the 'testall' target in the Makefile to include 'test-i18n' in the test sequence. This change ensures that internationalization tests are run alongside other tests, improving the overall testing process and ensuring that translation-related issues are caught early in the development cycle. Signed-off-by: Deluan <deluan@navidrome.org> * run validation with verbose output Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
9b3d3d15a1
commit
c583ff57a3
4 changed files with 268 additions and 21 deletions
19
Makefile
19
Makefile
|
|
@ -41,14 +41,21 @@ test: ##@Development Run Go tests
|
|||
go test -tags netgo $(PKG)
|
||||
.PHONY: test
|
||||
|
||||
testrace: ##@Development Run Go tests with race detector
|
||||
go test -tags netgo -race -shuffle=on ./...
|
||||
.PHONY: test
|
||||
|
||||
testall: testrace ##@Development Run Go and JS tests
|
||||
@(cd ./ui && npm run test)
|
||||
testall: test-race test-i18n test-js ##@Development Run Go and JS tests
|
||||
.PHONY: testall
|
||||
|
||||
test-race: ##@Development Run Go tests with race detector
|
||||
go test -tags netgo -race -shuffle=on ./...
|
||||
.PHONY: test-race
|
||||
|
||||
test-js: ##@Development Run JS tests
|
||||
@(cd ./ui && npm run test)
|
||||
.PHONY: test-js
|
||||
|
||||
test-i18n: ##@Development Validate all translations files
|
||||
./.github/workflows/validate-translations.sh
|
||||
.PHONY: test-i18n
|
||||
|
||||
install-golangci-lint: ##@Development Install golangci-lint if not present
|
||||
@PATH=$$PATH:./bin which golangci-lint > /dev/null || (echo "Installing golangci-lint..." && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s v2.1.6)
|
||||
.PHONY: install-golangci-lint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue