mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
@@ -18,9 +18,18 @@ ROOT_DIR = SCRIPT_DIR.parent
|
||||
FREEZE_FILE = SCRIPT_DIR / 'term_freeze.json'
|
||||
|
||||
|
||||
|
||||
# dms-plugins is a separate checkout with its own release cadence; the freeze
|
||||
# only guards this repo's terms. Catalog extraction still includes plugins.
|
||||
def shell_terms(translations):
|
||||
return {
|
||||
term: info for term, info in translations.items()
|
||||
if any(not occ['file'].startswith('dms-plugins/') for occ in info['occurrences'])
|
||||
}
|
||||
|
||||
def main():
|
||||
if '--update' in sys.argv:
|
||||
translations = extract_qstr_strings(ROOT_DIR)
|
||||
translations = shell_terms(extract_qstr_strings(ROOT_DIR))
|
||||
FREEZE_FILE.write_text(json.dumps(sorted(translations), indent=2, ensure_ascii=False) + '\n', encoding='utf-8')
|
||||
print(f"Froze {len(translations)} terms to {FREEZE_FILE}")
|
||||
return 0
|
||||
@@ -30,7 +39,7 @@ def main():
|
||||
return 0
|
||||
|
||||
frozen = set(json.loads(FREEZE_FILE.read_text(encoding='utf-8')))
|
||||
translations = extract_qstr_strings(ROOT_DIR)
|
||||
translations = shell_terms(extract_qstr_strings(ROOT_DIR))
|
||||
new_terms = sorted(term for term in translations if term not in frozen)
|
||||
if not new_terms:
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user