Change uses of whitelist to allowlist in translate_readme.py.

Change uses of blacklist to blocklist in translate_readme.py.
Change uses of blacklisted to blocklisted in translate_readme.py.
This commit is contained in:
JSon 2024-02-26 15:28:28 +08:00
parent 35c1da5382
commit 5b45478319

View File

@ -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: