Fix single string
This commit is contained in:
parent
429f2e5c97
commit
4e57093dfd
14 changed files with 303 additions and 160 deletions
|
|
@ -419,7 +419,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -434,7 +437,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -544,15 +550,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -360,7 +360,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -375,7 +378,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -485,15 +491,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -403,7 +403,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -418,7 +421,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -528,15 +534,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -419,7 +419,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -434,7 +437,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -544,15 +550,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -419,7 +419,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -434,7 +437,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -544,15 +550,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -343,7 +343,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -358,7 +361,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -468,15 +474,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -2475,7 +2475,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -2490,7 +2493,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -2600,15 +2606,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ CODE405 = True
|
|||
CODE102 = True
|
||||
|
||||
# Optional
|
||||
CODE101 = False # Turn this one when names exist in 101
|
||||
CODE101 = True # Turn this one when names exist in 101
|
||||
CODE408 = False # Warning, translates comments and can inflate costs.
|
||||
|
||||
# Variables
|
||||
|
|
@ -617,10 +617,8 @@ def searchNames(data, pbar, context):
|
|||
# Messages
|
||||
number = 1
|
||||
while number < 5:
|
||||
if f"message{number}" in data[i]:
|
||||
if len(data[i][f"message{number}"]) > 0 and data[i][f"message{number}"][
|
||||
0
|
||||
] in ["は", "を", "の", "に", "が"]:
|
||||
if f"message{number}" in data[i] and data[i][f"message{number}"]:
|
||||
if data[i][f"message{number}"][0] in ["は", "を", "の", "に", "が"]:
|
||||
msgResponse = translateGPT(
|
||||
"Taro" + data[i][f"message{number}"],
|
||||
"reply with only the gender neutral "
|
||||
|
|
@ -680,10 +678,11 @@ def searchNames(data, pbar, context):
|
|||
totalTokens[1] += response[1][1]
|
||||
|
||||
# Nickname
|
||||
response = translateGPT(nicknameList, newContext, True)
|
||||
translatedNicknameBatch = response[0]
|
||||
totalTokens[0] += response[1][0]
|
||||
totalTokens[1] += response[1][1]
|
||||
if nicknameList:
|
||||
response = translateGPT(nicknameList, newContext, True)
|
||||
translatedNicknameBatch = response[0]
|
||||
totalTokens[0] += response[1][0]
|
||||
totalTokens[1] += response[1][1]
|
||||
|
||||
# Profile
|
||||
response = translateGPT(profileList, "", True)
|
||||
|
|
@ -2464,7 +2463,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -2479,7 +2481,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -2589,15 +2594,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -334,7 +334,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -349,7 +352,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -459,15 +465,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -334,7 +334,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -349,7 +352,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -459,15 +465,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -410,7 +410,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -425,7 +428,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -535,15 +541,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -2272,7 +2272,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -2287,7 +2290,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -2397,15 +2403,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
|
|
@ -377,7 +377,10 @@ Output ONLY the {LANGUAGE} translation in the following format: `Translation: <{
|
|||
{VOCAB}\n\
|
||||
"
|
||||
)
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
if format == "json":
|
||||
user = f"```json\n{subbedT}\n```"
|
||||
else:
|
||||
user = subbedT
|
||||
return system, user
|
||||
|
||||
|
||||
|
|
@ -392,7 +395,10 @@ def translateText(system, user, history, penalty, format, model=MODEL):
|
|||
msg.append({"role": "system", "content": history})
|
||||
|
||||
# Response Format
|
||||
responseFormat = {"type": "json_object"}
|
||||
if format == "json":
|
||||
responseFormat = {"type": "json_object"}
|
||||
else:
|
||||
responseFormat = {"type": "text"}
|
||||
|
||||
# Content to TL
|
||||
msg.append({"role": "user", "content": f"{user}"})
|
||||
|
|
@ -502,15 +508,17 @@ def translateGPT(text, history, fullPromptFlag):
|
|||
|
||||
for index, tItem in enumerate(tList):
|
||||
# Before sending to translation, if we have a list of items, add the formatting
|
||||
if not isinstance(tItem, list):
|
||||
tItem = [tItem]
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
if isinstance(tItem, list):
|
||||
for j in range(len(tItem)):
|
||||
if not tItem[j]:
|
||||
tItem[j] = tItem[j].replace("", "Placeholder Text")
|
||||
payload = {f"Line{i+1}": string for i, string in enumerate(tItem)}
|
||||
payload = json.dumps(payload, indent=4, ensure_ascii=False)
|
||||
varResponse = [payload, []]
|
||||
subbedT = varResponse[0]
|
||||
else:
|
||||
varResponse = [tItem, []]
|
||||
subbedT = varResponse[0]
|
||||
|
||||
# Things to Check before starting translation
|
||||
if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT):
|
||||
|
|
|
|||
56
vocab.txt
56
vocab.txt
|
|
@ -1,14 +1,10 @@
|
|||
Here are some vocabulary and terms so that you know the proper spelling and translation.
|
||||
```
|
||||
# Game Characters
|
||||
ルカミラ ハル ロッシュ (Lukamilla Harre Roche) - Female
|
||||
マリアーヌ ローエン グリン (Marianne Roen Green) - Female
|
||||
リアン (Rianne) - Female
|
||||
スカーレット ルンベルク (Scarlet Lumberg) - Female
|
||||
ソフィア (Sofia) - Female
|
||||
アグファス ブロウニン (Agfas Blonin) - Male
|
||||
マルック スタンレー (Marc Stanley) - Male
|
||||
モノキオス (Monokios) - Male
|
||||
エレッタ (Eretta) - Female
|
||||
セッカ (Sekka) - Female
|
||||
新宮寧々 (Nene Shingu) - Female
|
||||
辰野伊吹 (Ibuki Tatsuno) - Female
|
||||
|
||||
# Lewd Terms
|
||||
マンコ (pussy)
|
||||
|
|
@ -93,4 +89,48 @@ w ((lol))
|
|||
巫女 (Shrine Maiden)
|
||||
コイツ (this bastard)
|
||||
メナスフィア (Menacephere)
|
||||
|
||||
# Armor
|
||||
ガードストーン (Guard Stone)
|
||||
ガードリング (Guard Ring)
|
||||
パワーストーン (Power Stone)
|
||||
パワーリング (Power Ring)
|
||||
スピードストーン (Speed Stone)
|
||||
スピードリング (Speed Ring)
|
||||
ラッキーストーン (Lucky Stone)
|
||||
ラッキーリング (Lucky Ring)
|
||||
マジカルストーン (Magical Stone)
|
||||
マジカルリング (Magical Ring)
|
||||
シューターストーン (Shooter Stone)
|
||||
シューターリング (Shooter Ring)
|
||||
|
||||
# Classes
|
||||
キュバリエエレッタ (Cavalier Eretta)
|
||||
|
||||
#Enemies
|
||||
ガーゴットン (Gargoton)
|
||||
スライム (Slime)
|
||||
スライム(エロなし) (Slime (No Lewd))
|
||||
群体スライム(中ボス) (Swarm Slime (Mid-Boss))
|
||||
スライム(黄) (Slime (Yellow))
|
||||
ボスウナズ (Boss Unaz)
|
||||
スライム(道中エロ補助用) (Slime (On the Way for Lewd Support))
|
||||
スライム(取り巻き) (Slime (Minion))
|
||||
ゴブリンリーダー (Goblin Leader)
|
||||
ゴブリンシャーマン (Goblin Shaman)
|
||||
ゴブリンソルジャー (Goblin Soldier)
|
||||
ゴブリン(取り巻き) (Goblin (Minion))
|
||||
オーク (Orc)
|
||||
ボストロ (Bostro)
|
||||
アイリス (Iris)
|
||||
アラクネ (Arachne)
|
||||
テレビフレーム (TV Frame)
|
||||
コカトリス (Cockatrice)
|
||||
シュトリア (Shtoria)
|
||||
シュトリアビット (Shtoria Bit)
|
||||
シュトリアビット2 (Shtoria Bit 2)
|
||||
ボスウナズ (Boss Unaz)
|
||||
|
||||
# Locations
|
||||
ハレイシア (Haleisia)
|
||||
```
|
||||
Loading…
Reference in a new issue