diff options
| author | Nippy <nippy@rp1.hu> | 2026-05-09 13:33:09 +0200 |
|---|---|---|
| committer | Nippy <nippy@rp1.hu> | 2026-05-09 13:33:09 +0200 |
| commit | a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5 (patch) | |
| tree | 1a8769217f84bfe9d6216fafaadaf8cdd876d457 /raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/translations/replace_qstr.py | |
| parent | 34b9c34f982b2596cfa9e368a2d7f74e9a17477c (diff) | |
| download | RaveOS-PKGBUILD-a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5.tar.gz RaveOS-PKGBUILD-a2b924d7e9492b978ad6dc33b6c1ffcb304b4bc5.zip | |
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/translations/replace_qstr.py')
| -rwxr-xr-x | raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/translations/replace_qstr.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/translations/replace_qstr.py b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/translations/replace_qstr.py deleted file mode 100755 index b1ae17e..0000000 --- a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/translations/replace_qstr.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python3 -import os -import re -from pathlib import Path - -def replace_qstr_in_file(file_path, root_dir): - with open(file_path, 'r', encoding='utf-8') as f: - content = f.read() - - original_content = content - relative_path = file_path.relative_to(root_dir) - - qstr_pattern = re.compile(r'qsTr\("([^"]+)"\)') - - def replacement(match): - term = match.group(1) - context = term - return f'I18n.tr("{term}", "{context}")' - - content = qstr_pattern.sub(replacement, content) - - if content != original_content: - with open(file_path, 'w', encoding='utf-8') as f: - f.write(content) - return True - return False - -def main(): - script_dir = Path(__file__).parent - root_dir = script_dir.parent - - modified_count = 0 - - for qml_file in root_dir.rglob('*.qml'): - if 'translations' in str(qml_file): - continue - - try: - if replace_qstr_in_file(qml_file, root_dir): - modified_count += 1 - print(f"Modified: {qml_file.relative_to(root_dir)}") - except Exception as e: - print(f"Error processing {qml_file}: {e}") - - print(f"\nTotal files modified: {modified_count}") - -if __name__ == '__main__': - main() |