Skip to content

Commit 07ccc1e

Browse files
committed
v1.7.5 released
1 parent bf376bb commit 07ccc1e

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

OU Dictionary Editor/OpenUtau_Dictionary_Editor.pyw

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class Dictionary(TkinterDnD.Tk):
132132
self.local_var = tk.StringVar(value=self.current_local)
133133
self.selected_g2p = config.get('Settings', 'g2p', fallback="Arpabet-Plus G2p")
134134
self.g2p_var = tk.StringVar(value=self.selected_g2p)
135-
self.current_version = "v1.7.0"
135+
self.current_version = "v1.7.5"
136136

137137
# Set window title
138138
self.base_title = "OpenUTAU Dictionary Editor"
@@ -188,6 +188,7 @@ class Dictionary(TkinterDnD.Tk):
188188
self.icon()
189189
# Start update check in a non-blocking way
190190
threading.Thread(target=self.bg_updates, daemon=True).start()
191+
threading.Thread(target=self.update_localization_files, daemon=True).start()
191192
self.load_whats_new_state()
192193
self.check_and_update_version()
193194
# Check if "What's New" should be displayed
@@ -4806,6 +4807,49 @@ class Dictionary(TkinterDnD.Tk):
48064807
with open(self.config_file, 'w') as configfile:
48074808
config.write(configfile)
48084809
print(f"'What's New' state {state} and version {self.current_version} saved to config file.")
4810+
4811+
def update_localization_files(self):
4812+
if not self.is_connected():
4813+
return
4814+
4815+
try:
4816+
api_url = "https://api.github.com/repos/Cadlaxa/OpenUtau-Dictionary-Editor/contents/OU%20Dictionary%20Editor/Templates/Localizations"
4817+
response = requests.get(api_url)
4818+
response.raise_for_status()
4819+
files = response.json()
4820+
4821+
updated = False
4822+
local_dir = os.path.join("Templates", "Localizations")
4823+
os.makedirs(local_dir, exist_ok=True)
4824+
4825+
for file_info in files:
4826+
file_name = file_info['name']
4827+
download_url = file_info['download_url']
4828+
remote_sha = file_info['sha']
4829+
local_file_path = os.path.join(local_dir, file_name)
4830+
sha_file_path = local_file_path + ".sha"
4831+
4832+
local_sha = None
4833+
if os.path.exists(local_file_path) and os.path.exists(sha_file_path):
4834+
with open(sha_file_path, 'r', encoding='utf-8') as f:
4835+
local_sha = f.read().strip()
4836+
4837+
if local_sha != remote_sha:
4838+
file_response = requests.get(download_url)
4839+
file_response.raise_for_status()
4840+
with open(local_file_path, 'wb') as local_file:
4841+
local_file.write(file_response.content)
4842+
with open(sha_file_path, 'w', encoding='utf-8') as sha_file:
4843+
sha_file.write(remote_sha)
4844+
updated = True
4845+
4846+
if updated:
4847+
messagebox.showinfo("Localization Updated", self.localization.get(
4848+
'localization_updated', 'Localization files have been updated successfully.'))
4849+
4850+
except requests.RequestException as e:
4851+
messagebox.showerror("Localization Error", self.localization.get(
4852+
'localization_err', 'Failed to update localization files: ') + str(e))
48094853

48104854
def check_and_update_version(self):
48114855
# Check if the app version is updated and update the config

OU Dictionary Editor/Readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Changelog
22
---
3-
**`(6/8/25)`**
3+
**`(6/6/25)`**
44
- Replacements now support phoneme list
55
- Regex replacement bug fix
66
- Support CSV and TSV file drag and drop and export
77
- Localization Updater
8+
- Bug fixes
89

910
**`(4/8/25)`**
1011
- Revamped UI Accent colors

OU Dictionary Editor/plugin.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
name=Dictionary Editor v1.7.0
1+
name=Dictionary Editor v1.7.5
22
execute=OpenUtau_Dictionary_Editor.exe

0 commit comments

Comments
 (0)