mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
chore(mobile): remove unused translation keys (#13335)
This commit is contained in:
parent
4ce49e4666
commit
ee461e5910
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,24 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import json
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
with open('assets/i18n/en-US.json', 'r') as f:
|
with open('assets/i18n/en-US.json', 'r+') as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
keys_to_delete = []
|
||||||
|
|
||||||
for k in data.keys():
|
for k in data.keys():
|
||||||
print(k)
|
sp = subprocess.run(['sh', '-c', f'grep -q -r --include="*.dart" "{k}"'])
|
||||||
sp = subprocess.run(['sh', '-c', f'grep -r --include="*.dart" "{k}"'])
|
|
||||||
|
|
||||||
if sp.returncode != 0:
|
if sp.returncode != 0:
|
||||||
print("Not found in source code!")
|
print("Not found in source code, key:", k)
|
||||||
return 1
|
keys_to_delete.append(k)
|
||||||
|
|
||||||
|
for k in keys_to_delete:
|
||||||
|
del data[k]
|
||||||
|
|
||||||
|
f.seek(0)
|
||||||
|
f.truncate()
|
||||||
|
json.dump(data, f, indent=4)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
@ -1,31 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import json
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
def main():
|
|
||||||
print("CHECK GERMAN TRANSLATIONS")
|
|
||||||
with open('assets/i18n/de-DE.json', 'r') as f:
|
|
||||||
data = json.load(f)
|
|
||||||
|
|
||||||
for k in data.keys():
|
|
||||||
print(k)
|
|
||||||
sp = subprocess.run(['sh', '-c', f'grep -r --include="./assets/i18n/en-US.json" "{k}"'])
|
|
||||||
|
|
||||||
if sp.returncode != 0:
|
|
||||||
print(f"Outdated Key! {k}")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
print("CHECK FRENCH TRANSLATIONS")
|
|
||||||
with open('assets/i18n/fr-FR.json', 'r') as f:
|
|
||||||
data = json.load(f)
|
|
||||||
|
|
||||||
for k in data.keys():
|
|
||||||
print(k)
|
|
||||||
sp = subprocess.run(['sh', '-c', f'grep -r --include="./assets/i18n/en-US.json" "{k}"'])
|
|
||||||
|
|
||||||
if sp.returncode != 0:
|
|
||||||
print(f"Outdated Key! {k}")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
Loading…
Reference in New Issue
Block a user