Skip to content

Commit

Permalink
<fix> fix error when use unpack or runtime extract in a newer version…
Browse files Browse the repository at this point in the history
… of renpy and fix unable to translate with local glossary

update version to v2.2.7
  • Loading branch information
anonymousException committed May 7, 2024
1 parent b98c318 commit 154fd9a
Show file tree
Hide file tree
Showing 32 changed files with 47 additions and 37 deletions.
17 changes: 12 additions & 5 deletions src/hook_extract.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ init python:
default_translates = translator.default_translates
dic = dict()
for identifier,value in default_translates.items():
say = value.block[0]
if not hasattr(say,'what'):
continue
what = say.what
who = say.who
if hasattr(value,"block"):
say = value.block[0]
if not hasattr(say,'what'):
continue
what = say.what
who = say.who
else:
if not hasattr(value,'what') or not hasattr(value,"who"):
continue
what = value.what
who = value.who

filename = value.filename
linenumber = value.linenumber
if filename not in dic:
Expand Down
7 changes: 5 additions & 2 deletions src/hook_unrpa.rpy
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
init python early hide:
import renpy.loader
import threading
from renpy.loader import file_open_callbacks,load_from_archive,SubFile
import io
from renpy.loader import file_open_callbacks,load_from_archive

def my_load_from_archive(name):
rv = load_from_archive(name)
if rv is None:
return rv
if isinstance(rv,SubFile):
if hasattr(renpy.loader,"SubFile") and isinstance(rv,renpy.loader.SubFile):
_read = rv.read()
elif isinstance(rv,io.BufferedReader):
_read = rv.read()
elif 'RWops' in str(type(rv)):
_read = rv.readall()
Expand Down
Binary file modified src/qm/arabic.qm
Binary file not shown.
Binary file modified src/qm/bengali.qm
Binary file not shown.
Binary file modified src/qm/chinese.qm
Binary file not shown.
Binary file modified src/qm/french.qm
Binary file not shown.
Binary file modified src/qm/german.qm
Binary file not shown.
Binary file modified src/qm/hindi.qm
Binary file not shown.
Binary file modified src/qm/japanese.qm
Binary file not shown.
Binary file modified src/qm/korean.qm
Binary file not shown.
Binary file modified src/qm/portuguese.qm
Binary file not shown.
Binary file modified src/qm/russian.qm
Binary file not shown.
Binary file modified src/qm/spanish.qm
Binary file not shown.
Binary file modified src/qm/turkish.qm
Binary file not shown.
Binary file modified src/qm/urdu.qm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/renpy_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def TranslateFile(self, p, lang_target, lang_source, is_gen_bak, local_glossary,
target = current
else:
target = original
dic['target'] = target
if is_skip_translated and original != current:
continue
if local_glossary is not None and len(local_glossary) > 0:
Expand All @@ -128,7 +129,6 @@ def TranslateFile(self, p, lang_target, lang_source, is_gen_bak, local_glossary,
continue
if not isAllPunctuations(d['encoded'].strip('"')):
transList.append(d['encoded'].strip('"'))
dic['target'] = target
dic['d'] = d
trans_ori_dic.append((dic, d['encoded'].strip('"')))

Expand Down
4 changes: 2 additions & 2 deletions src/ts/arabic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>الإصدار2.2.6</translation>
<source>Version 2.2.7</source>
<translation>الإصدار2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/bengali.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>সংস্করণ 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>সংস্করণ 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/chinese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,8 +1178,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>版本 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>版本 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
2 changes: 1 addition & 1 deletion src/ts/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<source>Version 2.2.7</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/french.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>Version 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>Version 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/german.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>Version 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>Version 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/hindi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>संस्करण 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>संस्करण 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/japanese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>バージョン2.2.6</translation>
<source>Version 2.2.7</source>
<translation>バージョン2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/korean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>버전 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>버전 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/portuguese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>Versão 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>Versão 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/russian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>Версия 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>Версия 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/spanish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>Versión 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>Versión 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/turkish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1265,8 +1265,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>Sürüm 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>Sürüm 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/urdu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.2.6</source>
<translation>ورژن 2.2.6</translation>
<source>Version 2.2.7</source>
<translation>ورژن 2.2.7</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
2 changes: 1 addition & 1 deletion src/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def retranslateUi(self, MainWindow):
self.actionpack_game_files.setText(QCoreApplication.translate("MainWindow", u"pack game files", None))
self.clearLogBtn.setText(QCoreApplication.translate("MainWindow", u"clear log", None))
self.copyrightLabel.setText(QCoreApplication.translate("MainWindow", u"\u00a92024 Last moment,All rights reserved.", None))
self.versionLabel.setText(QCoreApplication.translate("MainWindow", u"Version 2.2.6", None))
self.versionLabel.setText(QCoreApplication.translate("MainWindow", u"Version 2.2.7", None))
self.translateBtn.setText(QCoreApplication.translate("MainWindow", u"translate", None))
self.selectFilesBtn.setText(QCoreApplication.translate("MainWindow", u"...", None))
self.label_2.setText(QCoreApplication.translate("MainWindow", u"directory", None))
Expand Down
2 changes: 1 addition & 1 deletion src/ui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</size>
</property>
<property name="text">
<string>Version 2.2.6</string>
<string>Version 2.2.7</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit 154fd9a

Please sign in to comment.