diff --git a/modules/javascript.py b/modules/javascript.py index f167580..cfb2dfa 100644 --- a/modules/javascript.py +++ b/modules/javascript.py @@ -145,7 +145,7 @@ def translateJS(data, pbar): i = 0 # Regex & Plugin Name - regex = r'Description[\\]+":[\\]+"(.*?)[\\]+"' + regex = r'ObjectiveContent[\\]+":[\\]+"[\\]+"(.*?)[\\]+"' # Find Plugin while i < len(data): @@ -158,7 +158,7 @@ def translateJS(data, pbar): # Remove Wordwrap [Optional] for j in range(len(modifiedStringList)): - modifiedStringList[j] = modifiedStringList[j].replace(r'\\\\n', r' ') + modifiedStringList[j] = modifiedStringList[j].replace(r'\\\\\\\\n', r' ') # Translate response = translateGPT(modifiedStringList, f'Reply with the {LANGUAGE} translation', True, pbar) @@ -170,11 +170,11 @@ def translateJS(data, pbar): if len(translatedList) == len(modifiedStringList): for j in range(len(translatedList)): # Add escape for ' - translatedList[j] = translatedList[j].replace("'", "\\'") + translatedList[j] = re.sub(r"[^\\](')", "\\'", translatedList[j]) # Wordwrap [Optional] translatedList[j] = textwrap.fill(translatedList[j], LISTWIDTH) - translatedList[j] = translatedList[j].replace('\n', r'\\\\n') + translatedList[j] = translatedList[j].replace('\n', r'\\\\\\\\n') # Set data[i] = data[i].replace(stringList[j], translatedList[j]) @@ -307,14 +307,12 @@ def batchList(input_list, batch_size): def createContext(fullPromptFlag, subbedT): characters = 'Game Characters:\n\ -シラス ティア ナナシユエル (Silas Tia Nanasiyuel) - Female\n\ -レイラ プラム ナナシユエル (Leila Plum Nanasiyuel) - Female\n\ -アリア グランツ (Aria Granz) - Female\n\ -ソフィー グリーンウッド (Sophie Greenwood) - Female\n\ -ヨウコ マッカーシー (Yoko McCarthy) - Female\n\ -ルフィナ アリーニア (Rufina Arinia) - Female\n\ -ヘレナ ルオ アルバネル (Helena Luo Albaner) - Female\n\ -アウローラ パパス (Aurora Pappas) - Female\n\ +皆月 (Minazuki)\n\ +さやか (Sayaka)\n\ +皆月 さやか (Minazuki Sayaka) - Female\n\ +広瀬 (Hirose)\n\ +智恵 (Chie) - Female\n\ +広瀬 智恵 (Hirose Chie) - Female\n\ ' system = PROMPT + VOCAB if fullPromptFlag else \ diff --git a/modules/rpgmakermvmz.py b/modules/rpgmakermvmz.py index d375bd3..11ba241 100644 --- a/modules/rpgmakermvmz.py +++ b/modules/rpgmakermvmz.py @@ -56,24 +56,24 @@ POSITION = 0 LEAVE = False # Dialogue / Scroll -CODE401 = True -CODE405 = True +CODE401 = False +CODE405 = False CODE408 = False # Choices -CODE102 = True +CODE102 = False # Variables CODE122 = False # Names -CODE101 = True +CODE101 = False # Other CODE355655 = False CODE357 = False CODE657 = False -CODE356 = False +CODE356 = True CODE320 = False CODE324 = False CODE111 = False @@ -228,7 +228,7 @@ def parseMap(data, filename): if event is not None: # This translates ID of events. (May break the game) if '') + response = translateNoteOmitSpace(event, r'