summaryrefslogtreecommitdiffstats
path: root/etc/tool/translate_readme.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-02-26 11:30:31 +0100
committerGitHub <noreply@github.com>2024-02-26 11:30:31 +0100
commitc2f29271485b53e3398b907788dc9a62249c403d (patch)
tree65dc5f0591a2f70041d20993547bb0917cd42092 /etc/tool/translate_readme.py
parentMerge pull request #1633 from hlohaus/flow (diff)
parentChange uses of whitelist to allowlist in translate_readme.py. (diff)
downloadgpt4free-0.2.2.2.tar
gpt4free-0.2.2.2.tar.gz
gpt4free-0.2.2.2.tar.bz2
gpt4free-0.2.2.2.tar.lz
gpt4free-0.2.2.2.tar.xz
gpt4free-0.2.2.2.tar.zst
gpt4free-0.2.2.2.zip
Diffstat (limited to 'etc/tool/translate_readme.py')
-rw-r--r--etc/tool/translate_readme.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/tool/translate_readme.py b/etc/tool/translate_readme.py
index 43bfdcde..e0a9b1f1 100644
--- a/etc/tool/translate_readme.py
+++ b/etc/tool/translate_readme.py
@@ -18,12 +18,12 @@ Don't translate or change inline code examples.
```md
"""
keep_note = "Keep this: [!Note] as [!Note].\n"
-blacklist = [
+blocklist = [
'## Šī¸ Copyright',
'## 🚀 Providers and Models',
'## 🔗 Related GPT4Free Projects'
]
-whitelist = [
+allowlist = [
"### Other",
"### Models"
]
@@ -52,15 +52,15 @@ async def translate(text):
return result
async def translate_part(part, i):
- blacklisted = False
- for headline in blacklist:
+ blocklisted = False
+ for headline in blocklist:
if headline in part:
- blacklisted = True
- if blacklisted:
+ blocklisted = True
+ if blocklisted:
lines = part.split('\n')
lines[0] = await translate(lines[0])
part = '\n'.join(lines)
- for trans in whitelist:
+ for trans in allowlist:
if trans in part:
part = part.replace(trans, await translate(trans))
else: