Commit 06acc58 1 parent e5d771f commit 06acc58 Copy full SHA for 06acc58
File tree 3 files changed +34
-1
lines changed
3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Validate the po files to ensure translation files are compilable.
2
+
3
+ name : Validate translation PO files
4
+
5
+ on :
6
+ - pull_request
7
+
8
+ jobs :
9
+ validate-po-files :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ # Clones the openedx-translations repo
13
+ - name : clone openedx/openedx-translations
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Install gettext
17
+ run : |
18
+ sudo apt install -y gettext
19
+
20
+ - name : Validate translation files
21
+ id : validate_translation_files
22
+ run : |
23
+ make validate_translation_files
Original file line number Diff line number Diff line change 1
1
__pycache__
2
2
.pytest_cache
3
3
4
+ # msgfmt sometimes leaves these behind in the root directory
5
+ /* .mo
Original file line number Diff line number Diff line change 1
- .PHONY : piptools upgrade fix_transifex_resource_names transifex_resources_requirements
1
+ .PHONY : piptools upgrade fix_transifex_resource_names transifex_resources_requirements validate_translation_files
2
2
3
3
piptools :
4
4
pip install -q -r requirements/pip_tools.txt
@@ -29,3 +29,11 @@ test_requirements: ## Installs test.txt requirements
29
29
30
30
test : # # Run scripts tests
31
31
pytest -v -s scripts/tests
32
+
33
+ validate_translation_files : # # Run basic validation to ensure files are compilable
34
+ find translations/ -name ' *.po' \
35
+ | grep -v ' /en/LC_MESSAGES/' \
36
+ | xargs -I{} msgfmt -v --strict --check {}
37
+ @echo ' -----------------------------------------'
38
+ @echo ' Congratulations! Translation files are valid.'
39
+ @echo ' -----------------------------------------'
You can’t perform that action at this time.
0 commit comments