diff options
| author | 2025-09-03 00:50:24 -0400 | |
|---|---|---|
| committer | 2025-09-03 06:50:24 +0200 | |
| commit | 8a59dc3402bb3d200f74e7d1ea06d77124ccc492 (patch) | |
| tree | 0b1f2e866457ddcecf956271215f4f4bc3c2aa3e /Makefile | |
| parent | 94c53ae1fbb98b9f287e9112ebf73363cbcbb467 (diff) | |
add target to generate the translation progress (#7905)
* add target to generate the translation progress
* replace short options by long options
This adds a little bit of explanation for someone looking at the code without knowing
how the underlying script is working.
* sort test targets
* sort i18n targets
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 88 |
1 files changed, 46 insertions, 42 deletions
@@ -54,18 +54,18 @@ stop: ## Stop FreshRSS container if any docker network rm $(NETWORK) || true ##@ Tests and linter -.PHONY: test -test: bin/phpunit ## Run the test suite - $(PHP) bin/phpunit --bootstrap ./tests/bootstrap.php ./tests - .PHONY: lint -lint: bin/phpcs ## Run the linter on the PHP files +lint: bin/phpcs ## Run the linter on PHP files $(PHP) bin/phpcs . -p -s .PHONY: lint-fix lint-fix: bin/phpcbf ## Fix the errors detected by the linter $(PHP) bin/phpcbf . -p -s +.PHONY: test +test: bin/phpunit ## Run the test suite + $(PHP) bin/phpunit --bootstrap ./tests/bootstrap.php ./tests + bin/composer: mkdir -p bin/ wget 'https://raw.githubusercontent.com/composer/getcomposer.org/9e43d8a9b16fffa4dc9b090b9104dab7d815424a/web/installer' -O - -q | php -- --quiet --install-dir='./bin/' --filename='composer' @@ -95,19 +95,6 @@ node_modules/.bin/rtlcss: npm install ##@ I18n -.PHONY: i18n-format -i18n-format: ## Format I18N files - @$(PHP) ./cli/manipulate.translation.php -a format - @echo Files formatted. - -.PHONY: i18n-add-language -i18n-add-language: ## Add a new supported language -ifndef lang - $(error To add a new language, you need to provide one in the "lang" variable) -endif - $(PHP) ./cli/manipulate.translation.php -a add -l $(lang) -o $(ref) - @echo Language added. - .PHONY: i18n-add-key i18n-add-key: ## Add a translation key to all supported languages ifndef key @@ -116,27 +103,21 @@ endif ifndef value $(error To add a key, you need to provide its value in the "value" variable) endif - @$(PHP) ./cli/manipulate.translation.php -a add -k $(key) -v "$(value)" + @$(PHP) ./cli/manipulate.translation.php --action add --key $(key) --value "$(value)" @echo Key added. -.PHONY: i18n-remove-key -i18n-remove-key: ## Remove a translation key from all supported languages -ifndef key - $(error To remove a key, you need to provide one in the "key" variable) +.PHONY: i18n-add-language +i18n-add-language: ## Add a new supported language +ifndef lang + $(error To add a new language, you need to provide one in the "lang" variable) endif - @$(PHP) ./cli/manipulate.translation.php -a delete -k $(key) - @echo Key removed. + $(PHP) ./cli/manipulate.translation.php --action add --language $(lang) --origin-language $(ref) + @echo Language added. -.PHONY: i18n-update-key -i18n-update-key: ## Update a translation key in all supported languages -ifndef key - $(error To update a key, you need to provide one in the "key" variable) -endif -ifndef value - $(error To update a key, you need to provide its value in the "value" variable) -endif - @$(PHP) ./cli/manipulate.translation.php -a add -k $(key) -v "$(value)" -l en - @echo Key updated. +.PHONY: i18n-format +i18n-format: ## Format I18N files + @$(PHP) ./cli/manipulate.translation.php --action format + @echo Files formatted. .PHONY: i18n-ignore-key i18n-ignore-key: ## Ignore a translation key for the selected language @@ -146,7 +127,7 @@ endif ifndef key $(error To ignore a key, you need to provide one in the "key" variable) endif - @$(PHP) ./cli/manipulate.translation.php -a ignore -k $(key) -l $(lang) + @$(PHP) ./cli/manipulate.translation.php --action ignore --key $(key) --language $(lang) @echo Key ignored. .PHONY: i18n-ignore-unmodified-keys @@ -154,7 +135,7 @@ i18n-ignore-unmodified-keys: ## Ignore all unmodified translation keys for the s ifndef lang $(error To ignore unmodified keys, you need to provide a language in the "lang" variable) endif - @$(PHP) ./cli/manipulate.translation.php -a ignore_unmodified -l $(lang) + @$(PHP) ./cli/manipulate.translation.php --action ignore_unmodified --language $(lang) @echo Unmodified keys ignored. .PHONY: i18n-key-exists @@ -162,21 +143,44 @@ i18n-key-exists: ## Check if a translation key exists ifndef key $(error To check if a key exists, you need to provide one in the "key" variable) endif - @$(PHP) ./cli/manipulate.translation.php -a exist -k $(key) + @$(PHP) ./cli/manipulate.translation.php --action exist --key $(key) -##@ Tools -.PHONY: rtl -rtl: node_modules/.bin/rtlcss ## Generate RTL CSS files - npm run-script rtlcss +.PHONY: i18n-remove-key +i18n-remove-key: ## Remove a translation key from all supported languages +ifndef key + $(error To remove a key, you need to provide one in the "key" variable) +endif + @$(PHP) ./cli/manipulate.translation.php --action delete --key $(key) + @echo Key removed. +.PHONY: i18n-update-key +i18n-update-key: ## Update a translation key in all supported languages +ifndef key + $(error To update a key, you need to provide one in the "key" variable) +endif +ifndef value + $(error To update a key, you need to provide its value in the "value" variable) +endif + @$(PHP) ./cli/manipulate.translation.php --action add --key $(key) --value "$(value)" --language en + @echo Key updated. + +##@ Tools .PHONY: pot pot: ## Generate POT templates for docs cd docs && ../cli/translation-update.sh +.PHONY: readme +readme: ## Generate translation progress in README file + @$(PHP) ./cli/check.translation.php --generate-readme + .PHONY: refresh refresh: ## Refresh feeds by fetching new messages @$(PHP) ./app/actualize_script.php +.PHONY: rtl +rtl: node_modules/.bin/rtlcss ## Generate RTL CSS files + npm run-script rtlcss + ############################### ## New commands aligned on CI # ## Work in progress # |
