Skip to content

Commit

Permalink
🐛 Fix #9, remove str.format
Browse files Browse the repository at this point in the history
Remove shebang of .pre-commit-config.yaml
  • Loading branch information
Freed-Wu committed Jan 23, 2023
1 parent 7c6c971 commit 21f12f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env -S pre-commit run -ac
---
exclude: ^assets/txt/.*\.txt$
repos:
Expand Down
9 changes: 3 additions & 6 deletions scripts/generate-translator.md.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@

from translate_shell.translators import TRANSLATORS

# disable any error about unimplemented modules
logging.basicConfig(level="CRITICAL")

STRING = "translate_shell.translators"
print(
"\n".join(
"- [{k}]({v})".format(
k=k,
v=v().__class__.__module__.replace(
"builtins", "translate_shell.translators"
),
)
f"- [{k}]({v().__class__.__module__.replace('builtins', STRING)})"
for k, v in TRANSLATORS.items()
)
)
7 changes: 3 additions & 4 deletions src/translate_shell/translators/online/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ def get_url(self, sl: str, tl: str, qry: str) -> str:
http_host = self._cnhost if "zh" in tl else self._host
qry = quote_plus(qry)
url = (
"https://{}/translate_a/single?client=gtx&sl={}&tl={}&dt=at&dt=bd&"
"dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&q={}".format(
http_host, sl, tl, qry
)
f"https://{http_host}/translate_a/single?client=gtx&sl={sl}"
"&tl={tl}&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss"
"&dt=t&q={qry}"
)
return url

Expand Down

0 comments on commit 21f12f3

Please sign in to comment.