Skip to content

Commit b79cfbf

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a1dfbe1 commit b79cfbf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

scripts/export-languages-po.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ def extract_names(data):
7676

7777
with open(f"languages-po/{language_code}.po", "w") as handle:
7878
handle.write(HEADER.format(language_code))
79-
for msgid, msgstr in sorted(result.items()):
80-
handle.write(ROW.format(msgid, msgstr))
79+
handle.writelines(
80+
ROW.format(msgid, msgstr) for msgid, msgstr in sorted(result.items())
81+
)

scripts/generate-language-data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ def get_population(code):
163163
output.write("from .utils import gettext_noop as _\n\n")
164164
output.write("# Language definitions\n")
165165
output.write(f"LANGUAGES: {TYPE_HINT} = (\n")
166-
for row in LANGUAGES:
167-
output.write(TEMPLATE.format(row[0], escape(row[1]), row[2], row[3]))
166+
output.writelines(
167+
TEMPLATE.format(row[0], escape(row[1]), row[2], row[3]) for row in LANGUAGES
168+
)
168169
output.write(")\n")
169170
with open("weblate_language_data/population.py", "w") as output:
170171
output.write(HEADER)

0 commit comments

Comments
 (0)