Skip to content

Commit

Permalink
fix mac binary & make translator can handle error
Browse files Browse the repository at this point in the history
  • Loading branch information
skps2010 committed Sep 23, 2023
1 parent ed06385 commit a2816f5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
3 changes: 2 additions & 1 deletion build/makeDistributionMacOSX
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ cp -r $3 $framework_folder
cp /usr/local/lib/libfreetype.6.dylib $framework_folder
cp /usr/local/opt/libpng/lib/libpng16.16.dylib $framework_folder
cp /usr/local/opt/sdl12-compat/lib/libSDL-1.2.0.dylib $framework_folder
cp /usr/local/Cellar/sdl2/2.28.3/lib/libSDL2-2.0.0.dylib $framework_folder

install_name_tool -change /usr/local/lib/libfreetype.6.dylib @executable_path/../Frameworks/libfreetype.6.dylib $onelife_app
install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @executable_path/libpng16.16.dylib $framework_folder/libfreetype.6.dylib
install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @executable_path/../Frameworks/libfreetype.6.dylib $framework_folder/libfreetype.6.dylib
install_name_tool -id @executable_path/libpng16.16.dylib $framework_folder/libpng16.16.dylib
install_name_tool -change /usr/local/opt/sdl12-compat/lib/libSDL-1.2.0.dylib @executable_path/../Frameworks/libSDL-1.2.0.dylib $onelife_app

Expand Down
2 changes: 1 addition & 1 deletion gameSource/ExistingAccountPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ void ExistingAccountPage::actionPerformed( GUIComponent *inTarget ) {
system("open translator; sleep 1.0; while pgrep -f translator >/dev/null; do sleep 1.0; done");
}
else
system("open translator.py -a Terminal; sleep 1.0; while pgrep -f translator.py >/dev/null; do sleep 1.0; done");
system("open translator.py -a Terminal; sleep 1.0; while pgrep -f translator >/dev/null; do sleep 1.0; done");

#elif defined(WIN32)
char fullscreen = SettingsManager::getIntSetting("fullscreen", 0);
Expand Down
28 changes: 18 additions & 10 deletions scripts/skps2010Scripts/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ def main():
for i in range(len(data['key'])):
translated = data['value'][i]
if translated != '':
with open(f'objects/{data["key"][i]}', encoding='utf-8') as f:
content = f.readlines()
try:
with open(f'objects/{data["key"][i]}', encoding='utf-8') as f:
content = f.readlines()
except FileNotFoundError as e:
print(e)
continue

if is_append and data2['value'][i] != '':
content[1] = translated.split('#')[0].split(
Expand All @@ -79,14 +83,18 @@ def main():
f.writelines(content)

menuItems = {}
with open('languages/English.txt', encoding='utf-8') as f:
datas = f.readlines()
for data in datas:
if data == '\n':
continue
name = data.split(' ')[0]
value = data[data.index('"') + 1:-2]
menuItems[name] = value
try:
with open('languages/English.txt', encoding='utf-8') as f:
datas = f.readlines()
for data in datas:
if data == '\n':
continue
name = data.split(' ')[0]
value = data[data.index('"') + 1:-2]
menuItems[name] = value

except FileNotFoundError as e:
print(e)

print("Translating Menu...")

Expand Down

0 comments on commit a2816f5

Please sign in to comment.