@@ -383,10 +383,10 @@ def validate_translations():
383
383
384
384
This function performs two main validation steps:
385
385
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.
387
387
388
388
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.
390
390
391
391
Returns:
392
392
bool: True if all validations pass, False otherwise.
@@ -404,7 +404,7 @@ def validate_translations():
404
404
405
405
print ('' )
406
406
print ('' )
407
- print ('Validate _ () and _local () uses in .py files' )
407
+ print ('Validate global_translation () and local_translation () uses in .py files' )
408
408
file_is_valid = validate_python_files (root_folder , msg_ids )
409
409
410
410
is_valid = is_valid and file_is_valid
@@ -490,7 +490,7 @@ def validate_python_file(current_file, msg_ids):
490
490
n_of_errors = 0
491
491
492
492
file_py_content = get_file_content (current_file )
493
- regex = r"[^_]_( local){0,1} \(['\"](?P<msgid>[^\"']+)[\"']\)"
493
+ regex = r"(global| local)_translation \(['\"](?P<msgid>[^\"']+)[\"']\)"
494
494
matches = re .finditer (
495
495
regex , file_py_content , re .MULTILINE )
496
496
for _ , match in enumerate (matches , start = 1 ):
0 commit comments