File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ def extract_strings_from_shell_file(file_path: str) -> List[Dict[str, any]]:
7979 # Pattern to match the three add_*_entry functions and extract the 3rd parameter
8080 # These functions have format: add_*_entry "param1" "param2" "param3" ...
8181 # We want to extract param3 (the translatable string)
82+ # Pattern to match variables named "class" is also included
8283 patterns = [
8384 # Match add_plain_info_entry with 3rd parameter in double quotes
8485 r'add_plain_info_entry\s+(?:"[^"]*"|\'[^\']*\'|\$\w+)\s+(?:"[^"]*"|\'[^\']*\'|\$\w+)\s+"([^"]+)"' ,
@@ -92,6 +93,9 @@ def extract_strings_from_shell_file(file_path: str) -> List[Dict[str, any]]:
9293 r'add_bar_info_entry\s+(?:"[^"]*"|\'[^\']*\'|\$\w+)\s+(?:"[^"]*"|\'[^\']*\'|\$\w+)\s+"([^"]+)"' ,
9394 # Match add_bar_info_entry with 3rd parameter in single quotes
9495 r"add_bar_info_entry\s+(?:\"[^\"]*\"|'[^']*'|\$\w+)\s+(?:\"[^\"]*\"|'[^']*'|\$\w+)\s+'([^']+)'" ,
96+ # Match with all variable named "class" parameters e.g. class="Base Info"
97+ r"class\s*=\s*\"([^\"]+)\"" ,
98+ r"class\s*=\s*'([^']+)'" ,
9599 ]
96100
97101 for line_num , line in enumerate (lines , start = 1 ):
You can’t perform that action at this time.
0 commit comments