File tree 4 files changed +31
-27
lines changed
4 files changed +31
-27
lines changed Original file line number Diff line number Diff line change 1
- compare-locales == 9.0.*
2
- jsonschema == 4.23.*
3
- lxml == 5.3.*
4
- moz-l10n == 0.6.0
5
- polib = =1.2.0
6
- requests == 2.32.3
1
+ compare-locales ~= 9.0.0
2
+ jsonschema ~= 4.23.0
3
+ lxml ~= 5.3.0
4
+ moz-l10n ~= 0.6.1
5
+ polib ~ =1.2.0
6
+ requests ~= 2.32.0
Original file line number Diff line number Diff line change @@ -63,20 +63,23 @@ def extractStringsToml(self):
63
63
if not locales :
64
64
print ("No locales defined in the project configuration." )
65
65
66
+ all_files = [
67
+ (ref_path , tgt_path )
68
+ for (ref_path , tgt_path ), _ in project_config_paths .all ().items ()
69
+ ]
66
70
for locale in locales :
67
71
print (f"Extracting strings for locale: { locale } ." )
68
- file_list = [
69
- (
70
- os .path .abspath (
71
- tgt_path .format (android_locale = get_android_locale (locale ))
72
- ),
73
- os .path .abspath (ref_path .format (android_locale = None )),
72
+ locale_files = [
73
+ (os .path .abspath (ref_path ), os .path .abspath (tgt_path ))
74
+ for (ref_path , raw_tgt_path ) in all_files
75
+ if os .path .exists (
76
+ tgt_path := project_config_paths .format_target_path (
77
+ raw_tgt_path , locale
78
+ )
74
79
)
75
- for (ref_path , tgt_path ), locales in project_config_paths .all ().items ()
76
- if locale in locales
77
80
]
78
81
79
- for l10n_file , ref_file in file_list :
82
+ for ref_file , l10n_file in locale_files :
80
83
# Ignore missing files in locale
81
84
if not os .path .exists (l10n_file ):
82
85
# print(f"Ignored missing file for {locale}: {l10n_file}")
Original file line number Diff line number Diff line change 1
1
{
2
2
"HTML" : {
3
- "locales" : {
4
- "it" : [
5
- " app/src/main/res/values/strings.xml:your_rights_content5"
6
- ]
7
- },
3
+ "locales" : {},
8
4
"strings" : []
9
5
},
10
6
"ellipsis" : {
Original file line number Diff line number Diff line change @@ -119,18 +119,23 @@ def extractStringsToml(self):
119
119
120
120
read_references = []
121
121
122
+ all_files = [
123
+ (ref_path , tgt_path )
124
+ for (ref_path , tgt_path ), _ in project_config_paths .all ().items ()
125
+ ]
122
126
for locale in locales :
123
127
print (f"Extracting strings for locale: { locale } ." )
124
- file_list = [
125
- (
126
- os .path .abspath (tgt_path .format (locale = locale )),
127
- os .path .abspath (ref_path .format (locale = None )),
128
+ locale_files = [
129
+ (os .path .abspath (ref_path ), os .path .abspath (tgt_path ))
130
+ for (ref_path , raw_tgt_path ) in all_files
131
+ if os .path .exists (
132
+ tgt_path := project_config_paths .format_target_path (
133
+ raw_tgt_path , locale
134
+ )
128
135
)
129
- for (ref_path , tgt_path ), locales in project_config_paths .all ().items ()
130
- if locale in locales
131
136
]
132
137
133
- for l10n_file , ref_file in file_list :
138
+ for ref_file , l10n_file in locale_files :
134
139
# Ignore missing files in locale
135
140
if not os .path .exists (l10n_file ):
136
141
# print(f"Ignored missing file for {locale}: {l10n_file}")
You can’t perform that action at this time.
0 commit comments