Skip to content

Commit e545d83

Browse files
authoredMar 24, 2024··
Merge pull request Webperf-se#340 from cockroacher/i330
I330
2 parents 5d8a824 + 80723c8 commit e545d83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2138
-1994
lines changed
 

‎.github/workflows/update-software.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [windows-latest]
20-
config: ["software_github_adadvisory_database_path=advisory_database"]
20+
config: ["SOFTWARE_GITHUB_ADADVISORY_DATABASE_PATH=advisory_database"]
2121
steps:
2222
- name: Check out repository code
2323
uses: actions/checkout@v4
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup dependencies using pip
3030
run: pip install -r requirements.txt
3131
- name: Setup config (using SAMPLE-config.py as config.py)
32-
run: python .github\workflows\verify_result.py -c ${{ matrix.config }},github_api_key=${{ secrets.GITHUB_TOKEN }}
32+
run: python .github\workflows\verify_result.py -c ${{ matrix.config }},GITHUB_API_KEY=${{ secrets.GITHUB_TOKEN }}
3333
- name: Checkout advisory-database repo
3434
uses: actions/checkout@v4
3535
with:

‎.github/workflows/verify_result.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,10 @@ def validate_translations():
383383
384384
This function performs two main validation steps:
385385
1. Validates the existence and correctness of .po and .mo files in the project.
386-
2. Validates the usage of _() and _local() in .py files in the project.
386+
2. Validates the usage of global_translation() and local_translation() in .py files in the project.
387387
388388
The function uses the `validate_locales` function to validate .po and .mo files,
389-
and the `validate_python_files` function to validate _() and _local() usage.
389+
and the `validate_python_files` function to validate global_translation() and local_translation() usage.
390390
391391
Returns:
392392
bool: True if all validations pass, False otherwise.
@@ -404,7 +404,7 @@ def validate_translations():
404404

405405
print('')
406406
print('')
407-
print('Validate _() and _local() uses in .py files')
407+
print('Validate global_translation() and local_translation() uses in .py files')
408408
file_is_valid = validate_python_files(root_folder, msg_ids)
409409

410410
is_valid = is_valid and file_is_valid
@@ -490,7 +490,7 @@ def validate_python_file(current_file, msg_ids):
490490
n_of_errors = 0
491491

492492
file_py_content = get_file_content(current_file)
493-
regex = r"[^_]_(local){0,1}\(['\"](?P<msgid>[^\"']+)[\"']\)"
493+
regex = r"(global|local)_translation\(['\"](?P<msgid>[^\"']+)[\"']\)"
494494
matches = re.finditer(
495495
regex, file_py_content, re.MULTILINE)
496496
for _, match in enumerate(matches, start=1):

0 commit comments

Comments
 (0)
Please sign in to comment.