Skip to content

Commit 4cf3c46

Browse files
committed
use correct lowercase url for translation faq
1 parent 316138c commit 4cf3c46

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

tools/cc0_update.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import lang_tag_to
3434

3535

36-
FAQ_TRANSLATION_LINK = "/FAQ#officialtranslations"
36+
FAQ_TRANSLATION_LINK = "/faq#officialtranslations"
3737
FOOTER_COMMENTS = [
3838
"<!-- Language Footer Start - DO NOT DELETE -->",
3939
"<!-- Language Footer End - - DO NOT DELETE -->",
@@ -205,17 +205,17 @@ def normalize_faq_translation_link(args, filename, content):
205205
re_pattern = re.compile(
206206
r"""
207207
(?P<prefix>
208-
HREF="
208+
href=['"]
209209
)
210210
(?P<target>
211211
# Matches various translation FAQ URLs
212-
[^"]*CREATIVECOMMONS.ORG/FAQ[^"]*
212+
[^'"]*/[Ff][Aa][Qq][#][^'"]*
213213
)
214214
(?P<suffix>
215-
"
215+
['"]
216216
)
217217
""",
218-
re.DOTALL | re.IGNORECASE | re.MULTILINE | re.VERBOSE,
218+
re.DOTALL | re.MULTILINE | re.VERBOSE,
219219
)
220220
matches = re_pattern.search(content)
221221
if matches is None:

tools/cc4_update.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
},
159159
}
160160
)
161-
FAQ_TRANSLATION_LINK = "/FAQ#officialtranslations"
161+
FAQ_TRANSLATION_LINK = "/faq#officialtranslations"
162162

163163

164164
class ToolError(Exception):
@@ -387,17 +387,17 @@ def normalize_faq_translation_link(args, filename, content):
387387
re_pattern = re.compile(
388388
r"""
389389
(?P<prefix>
390-
href="
390+
href=['"]
391391
)
392392
(?P<target>
393393
# Matches various translation FAQ URLs
394-
[^'"]*/faq[#][^'"]*
394+
[^'"]*/[Ff][Aa][Qq][#][^'"]*
395395
)
396396
(?P<suffix>
397-
"
397+
['"]
398398
)
399399
""",
400-
re.DOTALL | re.IGNORECASE | re.MULTILINE | re.VERBOSE,
400+
re.DOTALL | re.MULTILINE | re.VERBOSE,
401401
)
402402
matches = re_pattern.search(content)
403403
if matches is None:

0 commit comments

Comments
 (0)