mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-26 09:57:24 +03:00
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:
parent
35c1da5382
commit
5b45478319
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user