diff --git a/modules/rpgmakermvmz.py b/modules/rpgmakermvmz.py index 93c84ea..b73c32d 100644 --- a/modules/rpgmakermvmz.py +++ b/modules/rpgmakermvmz.py @@ -405,6 +405,12 @@ def parseScenario(data, filename): def searchThings(name, pbar): totalTokens = [0, 0] + # If there isn't any Japanese in the text just skip + if IGNORETLTEXT == True: + if not re.search(r'[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+', name['name']) and re.search(r'[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+', name['description']): + pbar.update(1) + return totalTokens + # Name nameResponse = translateGPT(name['name'], 'Reply with only the english translation of the RPG item name.', False) if 'name' in name else '' @@ -1654,7 +1660,7 @@ def subVars(jaString): iconList = set(iconList) if len(iconList) != 0: for icon in iconList: - jaString = jaString.replace(icon, '[Ascii_' + str(count) + ']') + jaString = jaString.replace(icon, '{Ascii_' + str(count) + '}') count += 1 # Colors @@ -1663,7 +1669,7 @@ def subVars(jaString): colorList = set(colorList) if len(colorList) != 0: for color in colorList: - jaString = jaString.replace(color, '[Color_' + str(count) + ']') + jaString = jaString.replace(color, '{Color_' + str(count) + '}') count += 1 # Names @@ -1672,7 +1678,7 @@ def subVars(jaString): nameList = set(nameList) if len(nameList) != 0: for name in nameList: - jaString = jaString.replace(name, '[N_' + str(count) + ']') + jaString = jaString.replace(name, '{N_' + str(count) + '}') count += 1 # Variables @@ -1681,7 +1687,7 @@ def subVars(jaString): varList = set(varList) if len(varList) != 0: for var in varList: - jaString = jaString.replace(var, '[Var_' + str(count) + ']') + jaString = jaString.replace(var, '{Var_' + str(count) + '}') count += 1 # Formatting @@ -1692,7 +1698,7 @@ def subVars(jaString): formatList = set(formatList) if len(formatList) != 0: for var in formatList: - jaString = jaString.replace(var, '[FCode_' + str(count) + ']') + jaString = jaString.replace(var, '{FCode_' + str(count) + '}') count += 1 # Put all lists in list and return @@ -1711,35 +1717,35 @@ def resubVars(translatedText, allList): count = 0 if len(allList[0]) != 0: for var in allList[0]: - translatedText = translatedText.replace('[Ascii_' + str(count) + ']', var) + translatedText = translatedText.replace('{Ascii_' + str(count) + '}', var) count += 1 # Colors count = 0 if len(allList[1]) != 0: for var in allList[1]: - translatedText = translatedText.replace('[Color_' + str(count) + ']', var) + translatedText = translatedText.replace('{Color_' + str(count) + '}', var) count += 1 # Names count = 0 if len(allList[2]) != 0: for var in allList[2]: - translatedText = translatedText.replace('[N_' + str(count) + ']', var) + translatedText = translatedText.replace('{N_' + str(count) + '}', var) count += 1 # Vars count = 0 if len(allList[3]) != 0: for var in allList[3]: - translatedText = translatedText.replace('[Var_' + str(count) + ']', var) + translatedText = translatedText.replace('{Var_' + str(count) + '}', var) count += 1 # Formatting count = 0 if len(allList[4]) != 0: for var in allList[4]: - translatedText = translatedText.replace('[FCode_' + str(count) + ']', var) + translatedText = translatedText.replace('{FCode_' + str(count) + '}', var) count += 1 # Remove Color Variables Spaces @@ -1774,13 +1780,15 @@ def translateGPT(t, history, fullPromptFlag): return(t, [0,0]) # Characters - context = '```\ - Game Characters:\ - Character: ソル == Sol - Gender: Female\ - Character: ェニ先生 == Eni-sensei - Gender: Female\ - Character: 神泉 理央 == Kamiizumi Rio - Gender: Female\ - Character: 吉祥寺 アリサ == Kisshouji Arisa - Gender: Female\ - ```' + context = 'Game Characters:\ + Character: 莉音 == Rio - Gender: Female\ + Character: 結衣 == Yui - Gender: Female\ + Character: 美雪 == Miyuki - Gender: Female\ + Character: あかり == Akari - Gender: Female\ + Character: カガミ == Kagami - Gender: Female\ + Character: ミズキ == Mizuki - Gender: Female\ + Character: スズカ == Suzuka - Gender: Female\ + Character: シズク == Shizuku - Gender: Female' # Prompt if fullPromptFlag: diff --git a/prompt.example b/prompt.example index 741fa55..7874f6d 100644 --- a/prompt.example +++ b/prompt.example @@ -1,36 +1,30 @@ You are an expert Eroge Game translator and localizer who translates Japanese text to English. You are going to be translating text from a videogame. I will give you some lines and you must translate them to the best of your ability. -There are 2 pieces of information I will give you to help with translation: -- "Past Translated Text" - Previously translated text. This will help you understand everything that has happened in the conversation so far in order to come up with the best English translation. It will help you avoid making mistakes with subjects, possessives, genders, etc. +There are 2 pieces of information the user will give you to help with translation: - "Game Characters" - The names, nicknames, and genders of the game characters. Reference this to know the names, nicknames, and gender of characters in the game. +- "Past Translated Text" - Previously translated text. This is past text you translated. Use this to come up with the best translation paying special attention to subjects and genders. Use the following step-by-step instructions to respond to user inputs. -Step 1 - The user will give you a line of text to translate in the following format: +Step 1 - Receive Text +You receive a line of text to translate everything in the following format: -`Line to Translate = ` -or -`Line to Translate = : ` +`Line to Translate = ` or `Line to Translate = | ` -Note: Some English text may be a part of the translation. +Step 2 - Output Text +You output in English the translation in the following format: -Step 2 - Reference the given information to understand everything that has happened in the conversation so far and come up with the best English translation. - -Step 3 - Output ONLY english in your translation in the following format: - -`Translation: ` -or -`Translation: : ` +`Translation: ` or `Translation: | ` Other Notes: -- Make zero assumptions and try to always be correct. -- Take your time and try to come up with the most readable translation. Double check your work and make sure the subjects and possesives in the sentence are correct. -- Pay attention to the gender of the subjects and characters. Avoid misgendering them. +- If the speaker is '???' then they are unknown so leave it as is. +- Pay attention to the gender of the subjects and characters. Avoid misgendering characters. - Maintain any spacing in the translation - Never include any notes, explanations, dislaimers, or anything similar in your response. - Maintain Japanese Honorifics. For example: 'サクラねえちゃん' == 'Sakura Onee-san' - "--" is intentional and indicates a blank in the text. Leave it as is. +- If there is no speaker, do not add one. - Translate 'おまんこ' as 'pussy'. - Translate 'お尻' as 'butt' - Translate '尻' as 'ass' @@ -42,11 +36,11 @@ Other Notes: - Translate 'よかった' as 'thank goodness' - Translate 'ヒク' as 'biku' - Translate 'ムク' as 'muku' -- Translate '〇' as '*' -Maintain the following code in your translation. They are NOT variables: -- [Ascii_] == Ascii. -- [Color_] == Color. -- [N_] == Name. -- [Var_] == Unknown. -- [FCode_] == Formatting. \ No newline at end of file +Maintain the following codes in your translation if they exist: +- {Nested_} - Nested +- {Ascii_} - Ascii +- {Color_} - Color +- {N_} - Noun +- {Vars_} - Var +- {FCode_} - Format \ No newline at end of file