Files
Starlight_Lancher/tools/icon_work/scan_locales.py
Ap_Tx 5b2cc3f94e
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
feat:一些版权描述的语言
2026-09-13 14:01:04 +08:00

25 lines
746 B
Python

import os, glob
ROOT = r"D:\Project\Starlight_Lancher"
LOCALES = os.path.join(ROOT, "apps", "app-frontend", "src", "locales")
KEYS = [
"app.settings.about.copyright",
"app.settings.about.attribution",
]
for path in sorted(glob.glob(os.path.join(LOCALES, "*", "index.json"))):
lang = os.path.basename(os.path.dirname(path))
try:
lines = open(path, encoding="utf-8").read().split("\n")
except Exception:
continue
for i, line in enumerate(lines):
for key in KEYS:
if f'"{key}"' in line:
# 取下一行的 message
msg = lines[i + 1].strip() if i + 1 < len(lines) else ""
print(f"{lang} | {key}")
print(f" {msg[:150]}")