Skip to content

Commit

Permalink
remove nwg-bar autotranslation
Browse files Browse the repository at this point in the history
  • Loading branch information
nwg-piotr committed Aug 21, 2024
1 parent 11fc5e7 commit 8085aa9
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions nwg_shell_config/autotranslate.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,27 @@ def main():
print(f"Saving {path}")
save_json(panels, path)

# Translate nwg-bar template
config_dir = os.path.join(config_home, "nwg-bar")
for template in ["bar.json", "hyprland.json"]:
path = os.path.join(config_dir, template)

bar = load_json(path)
for item in bar:
if item["label"] == "Lock" or item["label"] == "Loc_k":
item["label"] = translation["lock"]

if item["label"] == "Logout" or item["label"] == "_Logout":
item["label"] = translation["logout"]

if item["label"] == "Reboot" or item["label"] == "_Reboot":
item["label"] = translation["reboot"]

if item["label"] == "Shutdown" or item["label"] == "_Shutdown":
item["label"] = translation["shutdown"]

print(f"Saving {path}")
save_json(bar, path)
# Translate nwg-bar template (no longer in use)
# config_dir = os.path.join(config_home, "nwg-bar")
# for template in ["bar.json", "hyprland.json"]:
# path = os.path.join(config_dir, template)
#
# bar = load_json(path)
# for item in bar:
# if item["label"] == "Lock" or item["label"] == "Loc_k":
# item["label"] = translation["lock"]
#
# if item["label"] == "Logout" or item["label"] == "_Logout":
# item["label"] = translation["logout"]
#
# if item["label"] == "Reboot" or item["label"] == "_Reboot":
# item["label"] = translation["reboot"]
#
# if item["label"] == "Shutdown" or item["label"] == "_Shutdown":
# item["label"] = translation["shutdown"]
#
# print(f"Saving {path}")
# save_json(bar, path)

print("Marking autotranslation done.")
shell_data["autotranslated"] = True
Expand Down

0 comments on commit 8085aa9

Please sign in to comment.