mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-04-26 00:01:59 +08:00
21 lines
573 B
Python
Executable file
21 lines
573 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
# Copyright © Michal Čihař <michal@weblate.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import sys
|
|
from glob import glob
|
|
|
|
from translate.storage.pypo import pofile
|
|
|
|
for filename in glob("weblate/locale/*/LC_MESSAGES/*.po"):
|
|
print(filename)
|
|
storage = pofile.parsefile(filename)
|
|
for unit in storage.units:
|
|
if not unit.istranslatable():
|
|
continue
|
|
if sys.argv[1] in unit.source:
|
|
print(unit.source)
|
|
if unit.istranslated() and sys.argv[1] in unit.target:
|
|
print(unit.target)
|