pages/*: update links and more info link script (#11390)
* pages/*: update links and more info link script Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * cleanup: reformat code * ax-webapp: fix link * curl: fix false positive Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> --------- Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
c059eb1c19
commit
5c26174aa9
@@ -18,6 +18,7 @@ labels = {
|
||||
"de": "Weitere Informationen:",
|
||||
"es": "Más información:",
|
||||
"fa": "اطلاعات بیشتر:",
|
||||
"fi": "Lisätietoja:",
|
||||
"fr": "Plus d'informations :",
|
||||
"sh": "Više informacija:",
|
||||
"hi": "अधिक जानकारी:",
|
||||
@@ -64,7 +65,7 @@ def get_tldr_root():
|
||||
|
||||
|
||||
def set_link(file, link):
|
||||
with open(file) as f:
|
||||
with open(file, encoding="utf-8") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
desc_start = 0
|
||||
@@ -86,7 +87,7 @@ def set_link(file, link):
|
||||
locale = "en"
|
||||
|
||||
# build new line
|
||||
if locale == "hi":
|
||||
if locale in ["bn", "hi", "ne"]:
|
||||
new_line = f"> {labels[locale]} <{link}>।\n"
|
||||
elif locale in ["ja", "th"]:
|
||||
new_line = f"> {labels[locale]} <{link}>\n"
|
||||
@@ -108,14 +109,14 @@ def set_link(file, link):
|
||||
lines.insert(desc_end + 1, new_line)
|
||||
status = "\x1b[36mlink added"
|
||||
|
||||
with open(file, "w") as f:
|
||||
with open(file, "w", encoding="utf-8") as f:
|
||||
f.writelines(lines)
|
||||
|
||||
return status
|
||||
|
||||
|
||||
def get_link(file):
|
||||
with open(file) as f:
|
||||
with open(file, encoding="utf-8") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
desc_start = 0
|
||||
|
Reference in New Issue
Block a user