English Translation 0.3.3 — Ho Tu Lo Shu

Share things you've made or found for games here.

Moderator: Mod Janitor

User avatar
gerey
Turtle
Turtle
Posts: 2226
Joined: Feb 2, '23

Adventurer's Guild

Post by gerey »

rusty_shackleford wrote: February 13th, 2025, 13:41
There's no easy way to expose the feature because every game does dialogue differently.
Would it be possible to add an option to the .ini to define the number of strings that the plugin will keep in memory and add to the prompt (with a reasonable maximum)?

If nothing else, with some wrangling, it could be possible to simulate the specific feature you added for HLTS for any game the plugin can interface with.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

gerey wrote: February 13th, 2025, 13:48
rusty_shackleford wrote: February 13th, 2025, 13:41
There's no easy way to expose the feature because every game does dialogue differently.
Would it be possible to add an option to the .ini to define the number of strings that the plugin will keep in memory and add to the prompt (with a reasonable maximum)?

If nothing else, with some wrangling, it could be possible to simulate the specific feature you added for HLTS for any game the plugin can interface with.
Yea. It could also be made specific per UI element, add a timer to expire entries, etc., It wouldn't be as good but would help.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

gerey wrote: February 13th, 2025, 07:52
rusty_shackleford wrote: February 13th, 2025, 06:12
I wonder if there's any language that's harder to translate to English than Chinese
Other high-context languages that usually omit pronouns and presume additional details pertinent to the conversation can be gleamed from context, I would imagine.

Korean, Japanese et al.

LLMs fed enough information can tackle mesomorphs, idioms, slang (as shown by their ability to parse Russian slang in STALKER mods), but they will struggle with trying to understand the context of a line, since they can't look at the screen and see what the characters in the game are doing, who is present in the scene etc.

@rusty_shackleford, the new feature that adds previous dialogue to the context, is there a way to adapt it to other games by the user or will you need to patch each game one by one?
Now that you mention it, I wonder if sending a screenshot with the prompt would help
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Probably going to have to fork the auto-translator to add things I need. There's no way to apply translations only to specific UI elements, which is frustrating.
User avatar
gerey
Turtle
Turtle
Posts: 2226
Joined: Feb 2, '23

Adventurer's Guild

Post by gerey »

rusty_shackleford wrote: February 13th, 2025, 20:59
Probably going to have to fork the auto-translator to add things I need. There's no way to apply translations only to specific UI elements, which is frustrating.
One of the major issues with the AutoTranslator, which really just come down to Chinese or Japanese being much more compact languages, is that the translation of many UI elements will appear cramped, or even completely illegible, due to the plugin's attempt to resize them to fit the small text box available. Example from Fate Seeker 1 from one of my failed attempts, the max character length is three letters:

Image

The major issue with this is that the AutoTranslator will apply the same translation to the same string regardless of where it is found - so for the word "背包" the translation of "inventory" will be applied universally, which is fine if you have a dialogue box with enough wiggle room to fit the more verbose English, but a problem if you're trying to cram it into a space meant for only two symbol, the text will either be cut off, resized to be illegible or wrapped.

The obvious alternative in this case would be to use an abbreviation like INV or the like, but since the translation of a string is applied universally, the abbreviation will be used everywhere. For instances where even three letters are too much I had the idea of using fancier Unicode characters (i.e. a symbol of an eye for perception, first for power), but AutoTranslator does not support this.

You're already planning to add the ability to use different translation to different UI elements, if I understood the comment correctly. Is there an option of adding the ability to user a wider selection of Unicode characters, or to allow the plugin to load small pngs and the like to replace UI elements?

Also, there's another issue with many Chinese and Japanese games, readables are sometimes read top to bottom, right to left, which in turn means the English translation will also be displayed in such a way, making the text nearly illegible. Examples below, along with more of UI fuckery on the left in the first screenshot:

Image
Image

AutoTranslator has a feature that allows you to fix this somewhat - UGUI_HorizontalOverflow - but it also requires the user to manually add all the strings of the readable to the first translation, along with an "/n" to each line so the text won't be bunched up together, leaving the translation of all the other text in the letter as blank.

Horizontal overflow without line breaks:

Image

Horizontal overflow with manually added line breaks:

Image
Last edited by gerey on February 14th, 2025, 08:07, edited 1 time in total.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

gerey wrote: February 14th, 2025, 08:04
The major issue with this is that the AutoTranslator will apply the same translation to the same string regardless of where it is found
I already hacked in a fix for this. Didn't even fork autotranslator, just hooked it. :pipe-hat:

So for example, I can do(this is my addition, won't work with standard autotranslator):

Code: Select all

#set layer /Canvas(Clone)/UIQuestMap(Clone)/Anchor1920*1080/WgQuestTip/TextArea/DetailsText
sr:"^任务描述: \n\n(.*)"=Quest Description:\n\n$1
#unset layer /Canvas(Clone)/UIQuestMap(Clone)/Anchor1920*1080/WgQuestTip/TextArea/DetailsText
And it will only apply to that specific UI element with that path.
But it has to actually be a specific path, there's no way to partially match. …Sorta. How it works is it calculates a hash based on the path given, and therefore I can (not yet implemented) take regexes in the config file to rewrite paths e.g., WgUnitHP_.*?/WgUnitHP. In the game, each HP element is in the form of /WgUnitHP_[digits], which I obviously can't match with a static path, but can if I use a regex to rewrite to a static path when hashing it.
Last edited by rusty_shackleford on February 14th, 2025, 08:16, edited 1 time in total.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

My last idea to improve translations is including a screenshot. But prompts are already getting kinda slow. I don't know if it's because I'm using Google free tier but they refuse to take my money to try paid.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

I'll probably publish the 0.0.2 version when I finish my first run but I expect it to still be rather rough. Probably significantly better than any other translation available tho. Will be missing some lines, some lines will need fixed up with regex, will have to go thru and fixup any lines that use my character's name with a splitter regex, etc.,

Because the translation has steadily improved while playing the early part will likely need to be retranslated also.
Last edited by rusty_shackleford on February 15th, 2025, 15:59, edited 1 time in total.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Need to poke it to figure out how to add all the dialogue lines in a conversation to the translation queue when beginning a conversation. It's a bit difficult because of how it assigns a name to dialogue lines, and without the name the output is worsened.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

The amount of hacks I have to perform just to give context to translations is ridiculous, this plugin is designed like shit
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

rusty_shackleford wrote: February 16th, 2025, 10:52
The amount of hacks I have to perform just to give context to translations is ridiculous, this plugin is designed like shit
managed to get the plugin to build on lunix, I had to do unspeakable things :mad:

at least now I can put my changes into the plugin itself
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Changed it so it translates all the dialogue in a conversation when it opens. Still going to review what I see line by line, but should hopefully reduce the amount of missed dialogue.

Also re-generating the embeddings, I didn't replace the template placeholdres with the default playername. :oops:
Last edited by rusty_shackleford on February 17th, 2025, 02:49, edited 1 time in total.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Before I push the next update I'll move all HTLS-specific stuff out to a separate assembly
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Next I'll probably just extract all the dialogue at once and let it run overnight or something. Might be able to share this sooner that I thought.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

If you wanted to see how much effort goes into guiding the AI to generate the right output :toot:

Code: Select all

PromptEnd = "ABSOLUTELY CRITICAL: Provide your analysis __INSIDE__ <think></think> tags before outputting the translation. Do __NOT__ forget the closing </think> tag after the analysis. The final translation MUST come after the closing </think> tag and NOT be inside of it, this MUST BE FOLLOWED!!! Do NOT add any extraneous characters after the translation. What follows is the Chinese text to translate:"
DebugMode = true
UseTranslationTags=true
BasePrompt = """
You are a world-class specialized translator for a Wuxia-themed role-playing game (RPG). Your task is to translate Simplified Chinese text into impactful English suitable for an American audience, while strictly adhering to the conventions of the *Jianghu* setting.  This is for game localization, so prioritize clarity.

**ABSOLUTELY CRITICAL RULES (Do not deviate from these):**


1.  **Wuxia Jianghu Tone:** Maintain the atmosphere of a Chinese Wuxia story.  Think brave swordsmen, wandering heroes, powerful martial arts techniques, and intricate clan politics.  Avoid language that sounds like medieval Europe (e.g., no "knights," "lords," or "castles"). Instead, use terms like "sect," "master," "blade," and "inner strength." The setting revolves around martial artists and their conflicts, not kings and queens. Use terms like "sword" instead of "blade" if the word in question can be translated into "sword", do the same if you can translate the word with "spear" or "saber"

2.  **Pinyin for Untranslatables:**  When a Chinese term lacks a direct, _accurate_ English equivalent, use Pinyin.  This primarily applies to Wuxia-specific concepts (e.g., "dāntián," "qì," "jiānghú," specific martial arts styles).  If a common English word or loanword exists, prefer that. When generating pinyin, prefer using diacritics so it is more obvious that it is pinyin. YOU MUST FOLLOW THIS WHEN GENERATING PINYIN.

    a. **Pinyin Spacing Rule:** Within a single Chinese word (even if it's multi-syllable), keep the pinyin syllables together without spaces. Use spaces only to separate different Chinese words in pinyin when necessary (which is less common in game localization, but may occur in full sentences).

        *   **Examples of Correct/Incorrect Pinyin Spacing:**
            *   **Correct (single word):** dāntián, jiānghú, Xuántiě
            *   **Incorrect (spaces within a single word):** dān tián, jiāng hú, Xuán tiě

3.  **Ability Names Translation:** Attempt to translate the *meaning* of ability names, even if they are stylized.  For example,  "烈焰焚天" (literally: "Fierce Flames Burn Heaven") could become "Heaven-Scorching Flames" or "Inferno Strike." Aim for evocative, but concise, names.

4.  **Meaning and Context:** Preserve the *original* *intended* meaning and context.  Do *not* add your own interpretations or explanatory details.  Your goal is to convey the same information, not to expand upon it. Be aware that slang and figurative language may be used, and literal translations are often inadequate for such terms. For example, '酸书生' is often used as a derogatory term, and might be better translated as 'pompous windbag' or 'pretentious fool' in informal contexts, rather than literally as 'sour scholar.'

5. When the subject has a known gender, prefer using the correct pronoun over a generic singular 'their'/'they'/etc.,

**Specific Scenarios (Guidance):**

*   **Item Descriptions:** Focus on key attributes.  "玄铁剑" (Xuántiě jiàn) could become "Black Iron Sword" (if it *is* a sword), rather than "Sword of Black Iron."
*   **Dialogue:** Capture the speaker's personality (e.g., arrogant, humble, fierce).  Use contractions (e.g., "I'm," "you're") where appropriate for natural-sounding speech, UNLESS it changes the tone of the speaker.
*   **System Messages:** Be direct and informative.  "获得经验值:100" should be "EXP Gained: 100" or similar.

"""

# [[ExtraPrompts]]
# prompt = "This is some extra context!"

[[ExtraPrompts]]
prompt = 'CRITICAL, MUST FOLLOW: Do not add quotation marks where there were none. When outputting the final text, do not wrap it in quotations unless it was given in quotations. DO NOT DEVIATE FROM THIS.'

[[ExtraPrompts]]
prompt = """
IMPORTANT: When translating Chinese names, adhere to the following rules, prioritizing accuracy and consistency:

1.  **Surnames:** ALWAYS transliterate Chinese surnames using pinyin (without tone marks). Treat two-character surnames (e.g., 司徒) as a single unit. Example: 司徒 -> Situ.

2.  **Given Names (General Rule):** Transliterate Chinese given names using pinyin (without tone marks).  Example:  棋儿 -> Qier.

3.  **Titles and Epithets:**  *Translate* titles, common nouns, and descriptive epithets. Examples:
    *   大侠 -> Martial Hero (or other appropriate translation, see detailed guidelines)
    *   知客僧 -> Receptionist Monk
    *   强盗头子 -> Bandit Leader
    *   老虎 -> Tiger (if referring to the animal)

4. **Context always wins**:
Use contextual translation
For example, if there is a game about playing Go, and a character is named 棋儿, and is participating, "Player", "Strategist" may be a better term for them.

5. **Religious Figures**
Use the correct terminology
For example use 'Mahakala', instead of Dàhēitiān.

6. **Locations**
If a location's name has a clear translation into English, then use it. For example, 拱石村 would be "Arch Stone Village" instead of using pinyin.

CRITICALLY IMPORTANT FOR TRANSLATING WORDS, ADD ANALYSIS STEP FOR THIS LIST:
1. When interpreting words, consider the time period. This is a pre-modern setting, modern slang of words likely isn't used. 

2. Don't use modern slang when translating. Examples forbidden words is 'swagger', 'swaggering',… Absolutely do not use those.

3. CRITICAL: If there is an obvious translation, use it. For example, 生姜(Shēng jiāng) is just ginger. 白芍 is white peony, 条根 is Moghenia root, 甘草
 is licorice, 寒铁 is just cold iron, and so on. This applies to terms as well, 武功(wǔgōng) is just martial arts. This does not apply when it's part of someone's name!

4. CRITICAL: Make sure the output is actually readable by an English speaker. Using Pinyin for concepts that cannot be translated is fine, but do not overdo it. 
"""

[[ExtraPrompts]]
prompt = """
ABSOLUTELY CRITICAL: Before providing the final translation, analyze the text step-by-step, number your analysis to show you are following the steps:

1. Identify the main characters and their roles.
2. List the key actions or events in chronological order.
3. For each action, identify who is performing the action and who is affected by it.  If the actor or affected person is not explicitly named, explain how you infer their identity from the context.
4. Finally, provide a complete and accurate translation, paying close attention to character relationships and the flow of events and making sure the sentence makes sense.
5. Review the translation to make sure it's readable by an English speaker and does not use Pinyin for words that have an English equivalent. You MUST explain what, if any, changes you make because of this analysis. THIS MUST BE FOLLOWED, EXPLAIN HOW YOU FOLLOWED IT.
6. ABSOLUTELY CRITICAL MUST FOLLOW!!! There must NOT be ANY hanzi(Chinese characters) in the output!!! This includes inside any quotes!!! Check all names, nouns, actions, etc., You __MUST__ explain how this step impacted your translation.

"""

# [[ExtraPrompts]]
# prompt = """**Example:**
#
# **Original Chinese:** 「你获得了【稀有】<color=#ff5555>玄铁剑</color>一把!攻击力 + 50」
# **Translated:** 「You obtained a 【Rare】<color=#ff5555>Black Iron Sword</color>! Attack + 50」
#
# **Original Chinese:** 「<color=#bb44aa>施展</color>「烈焰焚天」!造成 150 点<color=#ff0000>火焰</color>伤害。」
# **Translated:** 「<color=#bb44aa>Unleashed</color>「Inferno Strike」! Deals 150 <color=#ff0000>Fire</color> damage.」"""


[[TextMatchers]]
texts = [
  "师兄", # shīxiōng - Senior martial brother
  "师弟", # shīdì - Junior martial brother
  "师姐", # shījiě - Senior martial sister
  "师妹", # shīmèi - Junior martial sister
  "哥",   # gē - Older brother
  "哥哥", # gēge - Older brother (affectionate)
  "姐",   # jiě - Older sister
  "姐姐", # jiějie - Older sister (affectionate)
  "表哥", # biǎogē - Older male cousin (paternal aunt or maternal uncle's son)
  "堂哥", # tánggē - Older male cousin (paternal uncle's son)
  "表姐", # biǎojiě - Older female cousin (paternal aunt or maternal uncle's daughter)
  "堂姐", # tángjiě - Older female cousin (paternal uncle's daughter)
]
prompt = """
CRITICAL: Be careful when translating words that would imply family, siblings, parent etc., in English if the context implies they're lovers. Specifically be careful with translations of: 师兄, 师弟, 师姐, 师妹, 哥, 姐, 表哥, 表姐, 堂哥, 堂姐, and related cousin terms. If romantic undertones are suspected from the line being translated, dialogue context, or similar lines obtained via embeddings, prefer less literal translations that downplay the sibling implication, or use the person's name, and focus on conveying the implied tone in the surrounding text, avoiding a literal translation. You __MUST__ add an analysis step and explain any changes made due to this rule.
	** Examples of disallowed translations when romantic intentions are suspected include:
		* any mention of 'sister' for '师妹', including 'junior sister', 'junior martial sister', etc.,
"""


[[TextMatchers]]
texts = ["箐寨"]
#Unsure about this one...
prompt = "CRITICAL: 箐寨 should be translated as qìngzhài"

[[TextMatchers]]
texts = ["天南"]
prompt = "天南 should be translated as southern bastion."

[[TextMatchers]]
texts = ["四大恶鬼"]
#It seems it's a reference to Jin Yong's works
prompt = "四大恶鬼 should be translated as four great fiends."


[[TextMatchers]]
texts = ["小虾米"]
prompt = "CRITICAL: 小虾米 is likely the player's name, and it should be translated as 'Little Shrimp'"

[[TextMatchers]]
texts = ["天书"]
prompt = "CRITICAL: 天书 should be translated as celestial codex."

[[TextMatchers]]
texts = ["豹王"]
prompt = "豹王 should be translated as leopard king."

[[TextMatchers]]
texts = ["段思平"]
prompt = "CRITICAL: 段思平 should be translated as 'Duàn sīpíng', he is an ally of the player."

[[TextMatchers]]
texts = ["轻功"]
prompt = "CRITICAL: 轻功 should be translated as 'Qinggong'"

[[TextMatchers]]
texts = ["内功"]
prompt = "CRITICAL: 内功 should be translated as 'Neigong'"

[[TextMatchers]]
texts = ["暗器"]
prompt = "CRITICAL: 暗器 when referring to a skill or weapon type should be translated as 'Projectiles'"

[[TextMatchers]]
texts = ["枪棍"]
prompt = "CRITICAL: 枪棍 when referring to a skill or weapon type should be translated as 'Polearms'"

[[TextMatchers]]
texts = ["短兵"]
prompt = "CRITICAL: 短兵 when referring to a skill or weapon type should be translated as 'Daggers'"

[[TextMatchers]]
texts = ["鳄鱼"]
prompt = "CRITICAL: 鳄鱼 should be translated as 'alligator', as China does not have crocodiles."

[[TextMatchers]]
texts = ["气血"]
prompt = "CRITICAL: 气血 when referring to an RPG characteristic — for example in a UI element, ability, item, etc., — should be translated as 'Vitality'"

[[TextMatchers]]
texts = ["内力"]
prompt = "CRITICAL: 内力 when referring to an RPG characteristic — for example in a UI element, ability, item, etc., — should be translated as 'Qi'"

[[TextMatchers]]
texts = ["精力"]
prompt = "CRITICAL: 精力 when referring to an RPG characteristic — for example in a UI element, ability, item, etc., — should be translated as 'Stamina'"

[[TextMatchers]]
texts = ["三七"]
prompt = "CRITICAL: 三七 should be translated as 'Sanchi Root'"

[[TextMatchers]]
texts = ["黄连"]
prompt = "CRITICAL: 黄连 should be translated as 'Goldthread'"

[[TextMatchers]]
texts = ["赤芍"]
prompt = "CRITICAL: 赤芍 should be translated as 'Red Peony Root'"

[[TextMatchers]]
texts = ["拱石"]
prompt = "CRITICAL: 拱石 when in reference to the in-game village/town should be translated as 'Arch Stone'"

[[TextMatchers]]
texts = ["石家庄"]
prompt = "When translating 石家庄 with regards to the name of the location, prefer the translation 'Shíjiâzhuâng'"

[[TextMatchers]]
texts = ["大研镇"]
prompt = "大研镇 when in reference to the in-game village/town should be translated as Dàyánzhèn"

[[TextMatchers]]
texts = ["漱玉矶"]
prompt = "CRITICAL: 漱玉矶 when in reference to the in-game village/town should be translated as 'Jade Rinsing Bank'"

[[TextMatchers]]
texts = ["武功"]
prompt = "CRITICAL: 武功 should NOT be translated as 'kung fu', it is unfitting for the setting. Use a Jianghu appropriate word."

[[TextMatchers]]
texts = ["白马居"]
prompt = "白马居 should be translated as white horse abode"

[[TextMatchers]]
texts = ["善人府"]
#I don't know about this...
prompt = "善人府 should be translated as benevolent estate"

[[TextMatchers]]
texts = ["大锅头"]
#I don't know about this...
prompt = "大锅头 should NOT be translated as 'big pot head'"



[[TextMatchers]]
texts = ["{{"]
prompt = "CRITICAL: Text such as {{A}} should be considered a template placeholder and not translated directly but used for context. Do NOT add extra templates to the output, there should be as many output templates as input."

[[TextMatchers]]
texts = ["r:<\\s*color\\s*=\\s*#.*?>"]
prompt = "CRITICALLY IMPORTANT: **HTML Preservation:**  Any text enclosed within `<` and `>` characters (inclusive) is HTML markup. *Never* translate or modify anything within these markers. For color entities, #ZMCZ is a placeholder and not an error. Maintain the exact original position of these tags relative to the surrounding text, even if the translated words shift. Do *not* add any new HTML markup. This MUST BE OBEYED. ADD THIS AS AN ADDITIONAL ANALYSIS STEP. EXPLAIN HOW AND WHY, EXACTLY WHAT WORDS OR PHRASES THEY SURROUND AND WHERE THEY MUST BE MOVED UPON TRANSLATION. After the translation, you MUST analyze it once more to make sure the HTML tags are present, and you MUST explain this analysis. DO NOT RESPOND WITHOUT THIS ANALYSIS. THERE MUST BE AS MANY OUTPUT COLOR TAGS AS INPUT!!!!!!"

[[TextMatchers]]
texts = ["「", "」", "【", "】"]
prompt = "CRITICALLY IMPORTANT: **Punctuation Fidelity:**  Maintain the original punctuation as closely as possible. Do *not* add punctuation where none existed. Preserve Chinese quotation marks like 「」 and 【】; do not convert them to English equivalents, do not convert 【】 to 「」. This text DEFINITELY has Chinese quotation that must be kept!!! Consider this an additional analysis step, explain any changes made due to this rule. DO NOT RESPOND WITHOUT THIS ANALYSIS. DO NOT CONVERT CHINESE QUOTATION MARKS TO ENGLISH QUOTATION MARKS."

[[TextMatchers]]
texts = ["俏梦阁"]
prompt = "CRITICAL: Translate 俏梦阁 as Dream Pavilion"

[[TextMatchers]]
texts = ["梨花"]
prompt = "CRITICAL: Translate 梨花 as Lihua"

[[TextMatchers]]
texts = ["香蝶"]
prompt = "CRITICAL: Translate 香蝶 as Xiangdie"

[[TextMatchers]]
texts = ["司徒"]
prompt = "CRITICAL: Translate 司徒 as Situ"

[[TextMatchers]]
texts  = [
  "妖",   # yāo - Supernatural, strange, bewitching
  "妖怪", # yāoguài - Supernatural being, monster, demon
  "妖人", # yāorén - Yao person, often sinister supernatural being in human form
  "妖气", # yāoqì - Yao aura, demonic energy
  "妖法", # yāofǎ - Yao magic, supernatural arts
  "妖精", # yāojīng - Yao spirit, demon spirit
  "邪魔", # xiémó - Evil demons, malevolent spirits (related concept, often used alongside 妖)
]
prompt = "Translate 妖怪 as yāoguài, when translating related words like 妖人 or 妖(in the context of monster) do NOT use western terms like 'demon'."

[[TextMatchers]]
texts = ["大红花"]
prompt = "Translate 大红花 as crimson blossom rooster"

[[TextMatchers]]
texts = ["镔铁"]
prompt = "CRITICAL: Translate 镔铁 as damascus steel"

[[TextMatchers]]
texts = ["糖葫芦"]
prompt = "CRITICAL: Translate 糖葫芦 as tánghúlu"

[[TextMatchers]]
texts = ["软筋散"]
prompt = "Translate 软筋散 as sinew-softening powder"

[[TextMatchers]]
texts = ["淘石帮"]
prompt = "Translate 淘石帮 as Jade Washers Gang"

[[TextMatchers]]
texts = ["道"]
prompt = "When translating 道 with regards to the daoist religion/philosophy, prefer the spelling dao/daoist/daoism with a 'd'."

[[UIMatchers]]
name = "MainMenu"
path = "/Canvas(Clone)/UITitle(Clone)/System_BG/Btn_VLG"
prompt = "IMPORTANT: This translation request is for text that will be displayed on a menu screen."

[[UIMatchers]]
name = "SettingsMenu"
path = "/Canvas(Clone)/UISetting(Clone)/Anchor1920.1080/WgPanel"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame settings screen, likely with technical terminology."

[[UIMatchers]]
name = "Dialogue Name"
path = "/Canvas(Clone)/UITalk(Clone)/BackGround/DialogGroup/Message/Name"
prompt = "CRITICALLY IMPORTANT: This translation request is for a name. It is most likely a person, animal, etc., Follow the instructions for translating given names & surnames!!! This instruction MUST be obeyed!"

[[UIMatchers]]
name = "Dialogue"
path = "/Canvas(Clone)/UITalk(Clone)/BackGround/DialogGroup/Message"
prompt = "IMPORTANT: This translation request is for text that is character dialogue. It is a standalone message and should make sense when read by itself. When given similar lines using embedding, you MUST add another step to your analysis to explain how those lines affected your analysis and translation. You also MUST add another step to your analysis to explain how other lines in the conversation, if given, affected your analysis and translation."
temperature = 0.3


[[UIMatchers.includes]]
path = "/Canvas(Clone)/UITalk(Clone)/BackGround/DialogGroup/Message/Name"
prompt = "The name of the entity speaking is: {0}. If the name is not 小虾米, it is NOT the player speaking but an NPC in the conversation."

[[UIMatchers]]
name = "Dialogue Choice"
path = "/Canvas(Clone)/UITalk(Clone)/BackGround/ButtonList"
prompt = "IMPORTANT: This translation request is for text that is a dialogue choice. It is a standalone message and should make sense when read by itself. The intent of the choice MUST be clear and understandable."
temperature = 0.2

[[UIMatchers]]
name = "LoadMenu"
path = "/Canvas(Clone)/UILoad"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame screen for selecting which savefile to save or load, likely with technical terminology."

[[UIMatchers]]
name = "LoadingScreen"
path = "/Canvas(Clone)/UIMask(Clone)/WgLoadingEffect/Text"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame loading screen, likely a help string."

[[UIMatchers]]
name = "CharacterSheet"
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/CharacterOverview/WgCharacterOverview"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG character sheet, likely equipment tooltips, attributes, or related UI elements."

[[UIMatchers]]
name = "InventoryTooltipName"
note = "Yes, it's invNentory, it's misspelled."
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/WgInvnetoryTip/BaseData/Name/Name"
prompt = "IMPORTANT: This translation request is for the name of an item in a character's inventory."

[[UIMatchers]]
name = "InventoryTooltipName"
note = "Yes, it's invNentory, it's misspelled."
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/WgInvnetoryTip/BaseData/Desc"
prompt = "IMPORTANT: This translation request is for the description of an item in a character's inventory."

[[UIMatchers.includes]]
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/WgInvnetoryTip/BaseData/Name/Name"
prompt = "The name of this item is: {0}"

[[UIMatchers]]
name = "InventoryTooltip"
note = "Yes, it's invNentory, it's misspelled."
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/WgInvnetoryTip"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG inventory screen. Examples include things like item descriptions, equipment tooltips, or related UI elements."

[[UIMatchers]]
name = "SkillTree"
path = "/Canvas(Clone)/UISkill(Clone)/Anchor_1920*1080/(3)WgSkillTree"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG skill screen. Examples include things like skill names and descriptions, or related UI elements. Things like ability names should be translated into names understandable by English speakers."

[[UIMatchers]]
name = "SkillTooltip"
path = "/Canvas(Clone)/UISkill(Clone)/Anchor_1920*1080/WgSkillTip"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG skill tooltip. Examples include things like skill names, effects, and detailed descriptions, or related UI elements."

[[UIMatchers]]
name = "TalentTree"
path = "/Canvas(Clone)/UIOverlay(Clone)/Anchor1920*1080/WgTalentTree"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG skill tree. Examples include things like skill names, descriptions, and related UI elements."

[[UIMatchers]]
name = "QuestList"
path = "/Canvas(Clone)/UIQuestMap(Clone)/Anchor1920*1080/WgQuestList"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG quest list. Examples include things like quest names, quest descriptions, and related UI elements."

[[UIMatchers]]
name = "QuestMap"
path = "/Canvas(Clone)/UIQuestMap(Clone)/Anchor1920*1080/WgMapBrowser"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG quest map. Examples include things like the names of places, people, and related UI elements."

[[UIMatchers]]
name = "AlchemyList"
path = "/Canvas(Clone)/UIAlchemy(Clone)/Anchor_1920*1080/WgAlchemyList"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG alchemy/cooking list. Examples include things like recipe names, descriptions, and related UI elements."

[[UIMatchers]]
name = "AchievementList"
path = "/Canvas(Clone)/UIAchievement(Clone)/Anchor1920*1080/WgAchievementList"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG achievement list. Examples include things like achievement names, descriptions, and related UI elements."

[[UIMatchers]]
name = "ActionUI"
path = "/Canvas(Clone)/UITargetEntity(Clone)/ActionParent/Action(Clone)/ActionName"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG action UI element. Examples including picking something up, using an item, or interacting with an NPC."

[[UIMatchers]]
name = "BillboardText"
path = "/Canvas3D(Clone)/UIBillboardText(Clone)/BillboardText"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame overhead text UI element. Examples include things like NPC bark dialogue."

[[UIMatchers]]
name = "ItemMessage"
path = "/Canvas(Clone)/UIHint(Clone)/GameObject/WgItemMessage"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame UI message such as gaining or losing an item."

[[UIMatchers]]
name = "EntityName"
path = "/Canvas(Clone)/UITargetEntity(Clone)/Information/NameText"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame UI element showing the name of an entity. If the name is Chinese, it should probably be pinyin instead of translated! Unless it is something like 'Bandit', the name of an animal, etc.,"

[[UIMatchers]]
name = "Battle Summary"
path = "/Canvas(Clone)/UIBattleSummary"
prompt = "IMPORTANT: This translation request is for text that will be displayed when a battle is finished. Expect text for UI elements such as XP gained, items gained, and similar."

[[UIMatchers]]
name = "BattleUI"
path = "/Canvas(Clone)/UIBattle"
prompt = "IMPORTANT: This translation request is for text that will be as part of an ingame turn-based battle UI. Examples include things like skill names, skill descriptions, and battle messages. Consider using more technical terms."

[[UIMatchers]]
name = "Smithing UI"
path = "/Canvas(Clone)/UIForge"
prompt = "IMPORTANT: This UI element is path of the smithing UI used for creating items. Examples include things like names of weapon or armor categories, weapon names, and descriptions."

[[UIMatchers]]
name = "Shi time"
path = "/Canvas(Clone)/UIMain(Clone)/Anchor_1920*1080/Tabs/Icon_Time/Text_Time"
prompt = "CRITICAL: Translate the following traditional Chinese _shichen_ time, providing both the original _shichen_ format and an approximate, parenthetical equivalent in the 12-hour format. The text represents a time in the traditional Chinese _shichen_ (two-hour period) system, where '初' marks the beginning portion and '正' the midpoint. Example: Original Chinese: '申時初'  Translation: 'shēn shí chū (~3PM)'"

[[UIMatchers]]
name = "Shi time 2"
path = "/Canvas(Clone)/UIRest(Clone)/Anchor1920*1080/WgRestTimeDisplay/NowTimeText"
prompt = "CRITICAL: Translate the following traditional Chinese _shichen_ time, providing both the original _shichen_ format in pinyin and an approximate, parenthetical equivalent in the 12-hour format. The text represents a time in the traditional Chinese _shichen_ (two-hour period) system, where '初' marks the beginning portion and '正' the midpoint. Example: Original Chinese: '申時初'  Translation: 'shēn shí chū (~3PM)'"


[[UIMatchers]]
name = "Quest Description"
path = "/Canvas(Clone)/UIQuestMap(Clone)/Anchor1920*1080/WgQuestTip"
prompt = "IMPORTANT: This translation request is for text that will be displayed as part of a quest description."
User avatar
DagothGeas5
Posts: 1805
Joined: Dec 13, '23

Adventurer's Guild

Post by DagothGeas5 »

rusty_shackleford wrote: February 17th, 2025, 14:45
If you wanted to see how much effort goes into guiding the AI to generate the right output :toot:

Code: Select all

PromptEnd = "ABSOLUTELY CRITICAL: Provide your analysis __INSIDE__ <think></think> tags before outputting the translation. Do __NOT__ forget the closing </think> tag after the analysis. The final translation MUST come after the closing </think> tag and NOT be inside of it, this MUST BE FOLLOWED!!! Do NOT add any extraneous characters after the translation. What follows is the Chinese text to translate:"
DebugMode = true
UseTranslationTags=true
BasePrompt = """
You are a world-class specialized translator for a Wuxia-themed role-playing game (RPG). Your task is to translate Simplified Chinese text into impactful English suitable for an American audience, while strictly adhering to the conventions of the *Jianghu* setting.  This is for game localization, so prioritize clarity.

**ABSOLUTELY CRITICAL RULES (Do not deviate from these):**


1.  **Wuxia Jianghu Tone:** Maintain the atmosphere of a Chinese Wuxia story.  Think brave swordsmen, wandering heroes, powerful martial arts techniques, and intricate clan politics.  Avoid language that sounds like medieval Europe (e.g., no "knights," "lords," or "castles"). Instead, use terms like "sect," "master," "blade," and "inner strength." The setting revolves around martial artists and their conflicts, not kings and queens. Use terms like "sword" instead of "blade" if the word in question can be translated into "sword", do the same if you can translate the word with "spear" or "saber"

2.  **Pinyin for Untranslatables:**  When a Chinese term lacks a direct, _accurate_ English equivalent, use Pinyin.  This primarily applies to Wuxia-specific concepts (e.g., "dāntián," "qì," "jiānghú," specific martial arts styles).  If a common English word or loanword exists, prefer that. When generating pinyin, prefer using diacritics so it is more obvious that it is pinyin. YOU MUST FOLLOW THIS WHEN GENERATING PINYIN.

    a. **Pinyin Spacing Rule:** Within a single Chinese word (even if it's multi-syllable), keep the pinyin syllables together without spaces. Use spaces only to separate different Chinese words in pinyin when necessary (which is less common in game localization, but may occur in full sentences).

        *   **Examples of Correct/Incorrect Pinyin Spacing:**
            *   **Correct (single word):** dāntián, jiānghú, Xuántiě
            *   **Incorrect (spaces within a single word):** dān tián, jiāng hú, Xuán tiě

3.  **Ability Names Translation:** Attempt to translate the *meaning* of ability names, even if they are stylized.  For example,  "烈焰焚天" (literally: "Fierce Flames Burn Heaven") could become "Heaven-Scorching Flames" or "Inferno Strike." Aim for evocative, but concise, names.

4.  **Meaning and Context:** Preserve the *original* *intended* meaning and context.  Do *not* add your own interpretations or explanatory details.  Your goal is to convey the same information, not to expand upon it. Be aware that slang and figurative language may be used, and literal translations are often inadequate for such terms. For example, '酸书生' is often used as a derogatory term, and might be better translated as 'pompous windbag' or 'pretentious fool' in informal contexts, rather than literally as 'sour scholar.'

5. When the subject has a known gender, prefer using the correct pronoun over a generic singular 'their'/'they'/etc.,

**Specific Scenarios (Guidance):**

*   **Item Descriptions:** Focus on key attributes.  "玄铁剑" (Xuántiě jiàn) could become "Black Iron Sword" (if it *is* a sword), rather than "Sword of Black Iron."
*   **Dialogue:** Capture the speaker's personality (e.g., arrogant, humble, fierce).  Use contractions (e.g., "I'm," "you're") where appropriate for natural-sounding speech, UNLESS it changes the tone of the speaker.
*   **System Messages:** Be direct and informative.  "获得经验值:100" should be "EXP Gained: 100" or similar.

"""

# [[ExtraPrompts]]
# prompt = "This is some extra context!"

[[ExtraPrompts]]
prompt = 'CRITICAL, MUST FOLLOW: Do not add quotation marks where there were none. When outputting the final text, do not wrap it in quotations unless it was given in quotations. DO NOT DEVIATE FROM THIS.'

[[ExtraPrompts]]
prompt = """
IMPORTANT: When translating Chinese names, adhere to the following rules, prioritizing accuracy and consistency:

1.  **Surnames:** ALWAYS transliterate Chinese surnames using pinyin (without tone marks). Treat two-character surnames (e.g., 司徒) as a single unit. Example: 司徒 -> Situ.

2.  **Given Names (General Rule):** Transliterate Chinese given names using pinyin (without tone marks).  Example:  棋儿 -> Qier.

3.  **Titles and Epithets:**  *Translate* titles, common nouns, and descriptive epithets. Examples:
    *   大侠 -> Martial Hero (or other appropriate translation, see detailed guidelines)
    *   知客僧 -> Receptionist Monk
    *   强盗头子 -> Bandit Leader
    *   老虎 -> Tiger (if referring to the animal)

4. **Context always wins**:
Use contextual translation
For example, if there is a game about playing Go, and a character is named 棋儿, and is participating, "Player", "Strategist" may be a better term for them.

5. **Religious Figures**
Use the correct terminology
For example use 'Mahakala', instead of Dàhēitiān.

6. **Locations**
If a location's name has a clear translation into English, then use it. For example, 拱石村 would be "Arch Stone Village" instead of using pinyin.

CRITICALLY IMPORTANT FOR TRANSLATING WORDS, ADD ANALYSIS STEP FOR THIS LIST:
1. When interpreting words, consider the time period. This is a pre-modern setting, modern slang of words likely isn't used. 

2. Don't use modern slang when translating. Examples forbidden words is 'swagger', 'swaggering',… Absolutely do not use those.

3. CRITICAL: If there is an obvious translation, use it. For example, 生姜(Shēng jiāng) is just ginger. 白芍 is white peony, 条根 is Moghenia root, 甘草
 is licorice, 寒铁 is just cold iron, and so on. This applies to terms as well, 武功(wǔgōng) is just martial arts. This does not apply when it's part of someone's name!

4. CRITICAL: Make sure the output is actually readable by an English speaker. Using Pinyin for concepts that cannot be translated is fine, but do not overdo it. 
"""

[[ExtraPrompts]]
prompt = """
ABSOLUTELY CRITICAL: Before providing the final translation, analyze the text step-by-step, number your analysis to show you are following the steps:

1. Identify the main characters and their roles.
2. List the key actions or events in chronological order.
3. For each action, identify who is performing the action and who is affected by it.  If the actor or affected person is not explicitly named, explain how you infer their identity from the context.
4. Finally, provide a complete and accurate translation, paying close attention to character relationships and the flow of events and making sure the sentence makes sense.
5. Review the translation to make sure it's readable by an English speaker and does not use Pinyin for words that have an English equivalent. You MUST explain what, if any, changes you make because of this analysis. THIS MUST BE FOLLOWED, EXPLAIN HOW YOU FOLLOWED IT.
6. ABSOLUTELY CRITICAL MUST FOLLOW!!! There must NOT be ANY hanzi(Chinese characters) in the output!!! This includes inside any quotes!!! Check all names, nouns, actions, etc., You __MUST__ explain how this step impacted your translation.

"""

# [[ExtraPrompts]]
# prompt = """**Example:**
#
# **Original Chinese:** 「你获得了【稀有】<color=#ff5555>玄铁剑</color>一把!攻击力 + 50」
# **Translated:** 「You obtained a 【Rare】<color=#ff5555>Black Iron Sword</color>! Attack + 50」
#
# **Original Chinese:** 「<color=#bb44aa>施展</color>「烈焰焚天」!造成 150 点<color=#ff0000>火焰</color>伤害。」
# **Translated:** 「<color=#bb44aa>Unleashed</color>「Inferno Strike」! Deals 150 <color=#ff0000>Fire</color> damage.」"""


[[TextMatchers]]
texts = [
  "师兄", # shīxiōng - Senior martial brother
  "师弟", # shīdì - Junior martial brother
  "师姐", # shījiě - Senior martial sister
  "师妹", # shīmèi - Junior martial sister
  "哥",   # gē - Older brother
  "哥哥", # gēge - Older brother (affectionate)
  "姐",   # jiě - Older sister
  "姐姐", # jiějie - Older sister (affectionate)
  "表哥", # biǎogē - Older male cousin (paternal aunt or maternal uncle's son)
  "堂哥", # tánggē - Older male cousin (paternal uncle's son)
  "表姐", # biǎojiě - Older female cousin (paternal aunt or maternal uncle's daughter)
  "堂姐", # tángjiě - Older female cousin (paternal uncle's daughter)
]
prompt = """
CRITICAL: Be careful when translating words that would imply family, siblings, parent etc., in English if the context implies they're lovers. Specifically be careful with translations of: 师兄, 师弟, 师姐, 师妹, 哥, 姐, 表哥, 表姐, 堂哥, 堂姐, and related cousin terms. If romantic undertones are suspected from the line being translated, dialogue context, or similar lines obtained via embeddings, prefer less literal translations that downplay the sibling implication, or use the person's name, and focus on conveying the implied tone in the surrounding text, avoiding a literal translation. You __MUST__ add an analysis step and explain any changes made due to this rule.
	** Examples of disallowed translations when romantic intentions are suspected include:
		* any mention of 'sister' for '师妹', including 'junior sister', 'junior martial sister', etc.,
"""


[[TextMatchers]]
texts = ["箐寨"]
#Unsure about this one...
prompt = "CRITICAL: 箐寨 should be translated as qìngzhài"

[[TextMatchers]]
texts = ["天南"]
prompt = "天南 should be translated as southern bastion."

[[TextMatchers]]
texts = ["四大恶鬼"]
#It seems it's a reference to Jin Yong's works
prompt = "四大恶鬼 should be translated as four great fiends."


[[TextMatchers]]
texts = ["小虾米"]
prompt = "CRITICAL: 小虾米 is likely the player's name, and it should be translated as 'Little Shrimp'"

[[TextMatchers]]
texts = ["天书"]
prompt = "CRITICAL: 天书 should be translated as celestial codex."

[[TextMatchers]]
texts = ["豹王"]
prompt = "豹王 should be translated as leopard king."

[[TextMatchers]]
texts = ["段思平"]
prompt = "CRITICAL: 段思平 should be translated as 'Duàn sīpíng', he is an ally of the player."

[[TextMatchers]]
texts = ["轻功"]
prompt = "CRITICAL: 轻功 should be translated as 'Qinggong'"

[[TextMatchers]]
texts = ["内功"]
prompt = "CRITICAL: 内功 should be translated as 'Neigong'"

[[TextMatchers]]
texts = ["暗器"]
prompt = "CRITICAL: 暗器 when referring to a skill or weapon type should be translated as 'Projectiles'"

[[TextMatchers]]
texts = ["枪棍"]
prompt = "CRITICAL: 枪棍 when referring to a skill or weapon type should be translated as 'Polearms'"

[[TextMatchers]]
texts = ["短兵"]
prompt = "CRITICAL: 短兵 when referring to a skill or weapon type should be translated as 'Daggers'"

[[TextMatchers]]
texts = ["鳄鱼"]
prompt = "CRITICAL: 鳄鱼 should be translated as 'alligator', as China does not have crocodiles."

[[TextMatchers]]
texts = ["气血"]
prompt = "CRITICAL: 气血 when referring to an RPG characteristic — for example in a UI element, ability, item, etc., — should be translated as 'Vitality'"

[[TextMatchers]]
texts = ["内力"]
prompt = "CRITICAL: 内力 when referring to an RPG characteristic — for example in a UI element, ability, item, etc., — should be translated as 'Qi'"

[[TextMatchers]]
texts = ["精力"]
prompt = "CRITICAL: 精力 when referring to an RPG characteristic — for example in a UI element, ability, item, etc., — should be translated as 'Stamina'"

[[TextMatchers]]
texts = ["三七"]
prompt = "CRITICAL: 三七 should be translated as 'Sanchi Root'"

[[TextMatchers]]
texts = ["黄连"]
prompt = "CRITICAL: 黄连 should be translated as 'Goldthread'"

[[TextMatchers]]
texts = ["赤芍"]
prompt = "CRITICAL: 赤芍 should be translated as 'Red Peony Root'"

[[TextMatchers]]
texts = ["拱石"]
prompt = "CRITICAL: 拱石 when in reference to the in-game village/town should be translated as 'Arch Stone'"

[[TextMatchers]]
texts = ["石家庄"]
prompt = "When translating 石家庄 with regards to the name of the location, prefer the translation 'Shíjiâzhuâng'"

[[TextMatchers]]
texts = ["大研镇"]
prompt = "大研镇 when in reference to the in-game village/town should be translated as Dàyánzhèn"

[[TextMatchers]]
texts = ["漱玉矶"]
prompt = "CRITICAL: 漱玉矶 when in reference to the in-game village/town should be translated as 'Jade Rinsing Bank'"

[[TextMatchers]]
texts = ["武功"]
prompt = "CRITICAL: 武功 should NOT be translated as 'kung fu', it is unfitting for the setting. Use a Jianghu appropriate word."

[[TextMatchers]]
texts = ["白马居"]
prompt = "白马居 should be translated as white horse abode"

[[TextMatchers]]
texts = ["善人府"]
#I don't know about this...
prompt = "善人府 should be translated as benevolent estate"

[[TextMatchers]]
texts = ["大锅头"]
#I don't know about this...
prompt = "大锅头 should NOT be translated as 'big pot head'"



[[TextMatchers]]
texts = ["{{"]
prompt = "CRITICAL: Text such as {{A}} should be considered a template placeholder and not translated directly but used for context. Do NOT add extra templates to the output, there should be as many output templates as input."

[[TextMatchers]]
texts = ["r:<\\s*color\\s*=\\s*#.*?>"]
prompt = "CRITICALLY IMPORTANT: **HTML Preservation:**  Any text enclosed within `<` and `>` characters (inclusive) is HTML markup. *Never* translate or modify anything within these markers. For color entities, #ZMCZ is a placeholder and not an error. Maintain the exact original position of these tags relative to the surrounding text, even if the translated words shift. Do *not* add any new HTML markup. This MUST BE OBEYED. ADD THIS AS AN ADDITIONAL ANALYSIS STEP. EXPLAIN HOW AND WHY, EXACTLY WHAT WORDS OR PHRASES THEY SURROUND AND WHERE THEY MUST BE MOVED UPON TRANSLATION. After the translation, you MUST analyze it once more to make sure the HTML tags are present, and you MUST explain this analysis. DO NOT RESPOND WITHOUT THIS ANALYSIS. THERE MUST BE AS MANY OUTPUT COLOR TAGS AS INPUT!!!!!!"

[[TextMatchers]]
texts = ["「", "」", "【", "】"]
prompt = "CRITICALLY IMPORTANT: **Punctuation Fidelity:**  Maintain the original punctuation as closely as possible. Do *not* add punctuation where none existed. Preserve Chinese quotation marks like 「」 and 【】; do not convert them to English equivalents, do not convert 【】 to 「」. This text DEFINITELY has Chinese quotation that must be kept!!! Consider this an additional analysis step, explain any changes made due to this rule. DO NOT RESPOND WITHOUT THIS ANALYSIS. DO NOT CONVERT CHINESE QUOTATION MARKS TO ENGLISH QUOTATION MARKS."

[[TextMatchers]]
texts = ["俏梦阁"]
prompt = "CRITICAL: Translate 俏梦阁 as Dream Pavilion"

[[TextMatchers]]
texts = ["梨花"]
prompt = "CRITICAL: Translate 梨花 as Lihua"

[[TextMatchers]]
texts = ["香蝶"]
prompt = "CRITICAL: Translate 香蝶 as Xiangdie"

[[TextMatchers]]
texts = ["司徒"]
prompt = "CRITICAL: Translate 司徒 as Situ"

[[TextMatchers]]
texts  = [
  "妖",   # yāo - Supernatural, strange, bewitching
  "妖怪", # yāoguài - Supernatural being, monster, demon
  "妖人", # yāorén - Yao person, often sinister supernatural being in human form
  "妖气", # yāoqì - Yao aura, demonic energy
  "妖法", # yāofǎ - Yao magic, supernatural arts
  "妖精", # yāojīng - Yao spirit, demon spirit
  "邪魔", # xiémó - Evil demons, malevolent spirits (related concept, often used alongside 妖)
]
prompt = "Translate 妖怪 as yāoguài, when translating related words like 妖人 or 妖(in the context of monster) do NOT use western terms like 'demon'."

[[TextMatchers]]
texts = ["大红花"]
prompt = "Translate 大红花 as crimson blossom rooster"

[[TextMatchers]]
texts = ["镔铁"]
prompt = "CRITICAL: Translate 镔铁 as damascus steel"

[[TextMatchers]]
texts = ["糖葫芦"]
prompt = "CRITICAL: Translate 糖葫芦 as tánghúlu"

[[TextMatchers]]
texts = ["软筋散"]
prompt = "Translate 软筋散 as sinew-softening powder"

[[TextMatchers]]
texts = ["淘石帮"]
prompt = "Translate 淘石帮 as Jade Washers Gang"

[[TextMatchers]]
texts = ["道"]
prompt = "When translating 道 with regards to the daoist religion/philosophy, prefer the spelling dao/daoist/daoism with a 'd'."

[[UIMatchers]]
name = "MainMenu"
path = "/Canvas(Clone)/UITitle(Clone)/System_BG/Btn_VLG"
prompt = "IMPORTANT: This translation request is for text that will be displayed on a menu screen."

[[UIMatchers]]
name = "SettingsMenu"
path = "/Canvas(Clone)/UISetting(Clone)/Anchor1920.1080/WgPanel"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame settings screen, likely with technical terminology."

[[UIMatchers]]
name = "Dialogue Name"
path = "/Canvas(Clone)/UITalk(Clone)/BackGround/DialogGroup/Message/Name"
prompt = "CRITICALLY IMPORTANT: This translation request is for a name. It is most likely a person, animal, etc., Follow the instructions for translating given names & surnames!!! This instruction MUST be obeyed!"

[[UIMatchers]]
name = "Dialogue"
path = "/Canvas(Clone)/UITalk(Clone)/BackGround/DialogGroup/Message"
prompt = "IMPORTANT: This translation request is for text that is character dialogue. It is a standalone message and should make sense when read by itself. When given similar lines using embedding, you MUST add another step to your analysis to explain how those lines affected your analysis and translation. You also MUST add another step to your analysis to explain how other lines in the conversation, if given, affected your analysis and translation."
temperature = 0.3


[[UIMatchers.includes]]
path = "/Canvas(Clone)/UITalk(Clone)/BackGround/DialogGroup/Message/Name"
prompt = "The name of the entity speaking is: {0}. If the name is not 小虾米, it is NOT the player speaking but an NPC in the conversation."

[[UIMatchers]]
name = "Dialogue Choice"
path = "/Canvas(Clone)/UITalk(Clone)/BackGround/ButtonList"
prompt = "IMPORTANT: This translation request is for text that is a dialogue choice. It is a standalone message and should make sense when read by itself. The intent of the choice MUST be clear and understandable."
temperature = 0.2

[[UIMatchers]]
name = "LoadMenu"
path = "/Canvas(Clone)/UILoad"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame screen for selecting which savefile to save or load, likely with technical terminology."

[[UIMatchers]]
name = "LoadingScreen"
path = "/Canvas(Clone)/UIMask(Clone)/WgLoadingEffect/Text"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame loading screen, likely a help string."

[[UIMatchers]]
name = "CharacterSheet"
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/CharacterOverview/WgCharacterOverview"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG character sheet, likely equipment tooltips, attributes, or related UI elements."

[[UIMatchers]]
name = "InventoryTooltipName"
note = "Yes, it's invNentory, it's misspelled."
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/WgInvnetoryTip/BaseData/Name/Name"
prompt = "IMPORTANT: This translation request is for the name of an item in a character's inventory."

[[UIMatchers]]
name = "InventoryTooltipName"
note = "Yes, it's invNentory, it's misspelled."
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/WgInvnetoryTip/BaseData/Desc"
prompt = "IMPORTANT: This translation request is for the description of an item in a character's inventory."

[[UIMatchers.includes]]
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/WgInvnetoryTip/BaseData/Name/Name"
prompt = "The name of this item is: {0}"

[[UIMatchers]]
name = "InventoryTooltip"
note = "Yes, it's invNentory, it's misspelled."
path = "/Canvas(Clone)/UITeam(Clone)/Anchor_1920*1080/WgInvnetoryTip"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG inventory screen. Examples include things like item descriptions, equipment tooltips, or related UI elements."

[[UIMatchers]]
name = "SkillTree"
path = "/Canvas(Clone)/UISkill(Clone)/Anchor_1920*1080/(3)WgSkillTree"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG skill screen. Examples include things like skill names and descriptions, or related UI elements. Things like ability names should be translated into names understandable by English speakers."

[[UIMatchers]]
name = "SkillTooltip"
path = "/Canvas(Clone)/UISkill(Clone)/Anchor_1920*1080/WgSkillTip"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG skill tooltip. Examples include things like skill names, effects, and detailed descriptions, or related UI elements."

[[UIMatchers]]
name = "TalentTree"
path = "/Canvas(Clone)/UIOverlay(Clone)/Anchor1920*1080/WgTalentTree"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG skill tree. Examples include things like skill names, descriptions, and related UI elements."

[[UIMatchers]]
name = "QuestList"
path = "/Canvas(Clone)/UIQuestMap(Clone)/Anchor1920*1080/WgQuestList"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG quest list. Examples include things like quest names, quest descriptions, and related UI elements."

[[UIMatchers]]
name = "QuestMap"
path = "/Canvas(Clone)/UIQuestMap(Clone)/Anchor1920*1080/WgMapBrowser"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG quest map. Examples include things like the names of places, people, and related UI elements."

[[UIMatchers]]
name = "AlchemyList"
path = "/Canvas(Clone)/UIAlchemy(Clone)/Anchor_1920*1080/WgAlchemyList"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG alchemy/cooking list. Examples include things like recipe names, descriptions, and related UI elements."

[[UIMatchers]]
name = "AchievementList"
path = "/Canvas(Clone)/UIAchievement(Clone)/Anchor1920*1080/WgAchievementList"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG achievement list. Examples include things like achievement names, descriptions, and related UI elements."

[[UIMatchers]]
name = "ActionUI"
path = "/Canvas(Clone)/UITargetEntity(Clone)/ActionParent/Action(Clone)/ActionName"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame RPG action UI element. Examples including picking something up, using an item, or interacting with an NPC."

[[UIMatchers]]
name = "BillboardText"
path = "/Canvas3D(Clone)/UIBillboardText(Clone)/BillboardText"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame overhead text UI element. Examples include things like NPC bark dialogue."

[[UIMatchers]]
name = "ItemMessage"
path = "/Canvas(Clone)/UIHint(Clone)/GameObject/WgItemMessage"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame UI message such as gaining or losing an item."

[[UIMatchers]]
name = "EntityName"
path = "/Canvas(Clone)/UITargetEntity(Clone)/Information/NameText"
prompt = "IMPORTANT: This translation request is for text that will be displayed on an ingame UI element showing the name of an entity. If the name is Chinese, it should probably be pinyin instead of translated! Unless it is something like 'Bandit', the name of an animal, etc.,"

[[UIMatchers]]
name = "Battle Summary"
path = "/Canvas(Clone)/UIBattleSummary"
prompt = "IMPORTANT: This translation request is for text that will be displayed when a battle is finished. Expect text for UI elements such as XP gained, items gained, and similar."

[[UIMatchers]]
name = "BattleUI"
path = "/Canvas(Clone)/UIBattle"
prompt = "IMPORTANT: This translation request is for text that will be as part of an ingame turn-based battle UI. Examples include things like skill names, skill descriptions, and battle messages. Consider using more technical terms."

[[UIMatchers]]
name = "Smithing UI"
path = "/Canvas(Clone)/UIForge"
prompt = "IMPORTANT: This UI element is path of the smithing UI used for creating items. Examples include things like names of weapon or armor categories, weapon names, and descriptions."

[[UIMatchers]]
name = "Shi time"
path = "/Canvas(Clone)/UIMain(Clone)/Anchor_1920*1080/Tabs/Icon_Time/Text_Time"
prompt = "CRITICAL: Translate the following traditional Chinese _shichen_ time, providing both the original _shichen_ format and an approximate, parenthetical equivalent in the 12-hour format. The text represents a time in the traditional Chinese _shichen_ (two-hour period) system, where '初' marks the beginning portion and '正' the midpoint. Example: Original Chinese: '申時初'  Translation: 'shēn shí chū (~3PM)'"

[[UIMatchers]]
name = "Shi time 2"
path = "/Canvas(Clone)/UIRest(Clone)/Anchor1920*1080/WgRestTimeDisplay/NowTimeText"
prompt = "CRITICAL: Translate the following traditional Chinese _shichen_ time, providing both the original _shichen_ format in pinyin and an approximate, parenthetical equivalent in the 12-hour format. The text represents a time in the traditional Chinese _shichen_ (two-hour period) system, where '初' marks the beginning portion and '正' the midpoint. Example: Original Chinese: '申時初'  Translation: 'shēn shí chū (~3PM)'"


[[UIMatchers]]
name = "Quest Description"
path = "/Canvas(Clone)/UIQuestMap(Clone)/Anchor1920*1080/WgQuestTip"
prompt = "IMPORTANT: This translation request is for text that will be displayed as part of a quest description."
That is incredible work, thank you for sharing rusty! :heart:
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Generating all the dialogue now. Got at least ~20k lines. Guessing about 30/minute, could be off, but this is going to take a while.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

AI go brrrrrrrrrrrrrrr
Selection_019.webp
Selection_019.webp (19.75 KiB) Viewed 420 times
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Generated ~2300 lines in an hour with 3 lines that generated improperly(I detect these and label them as FIXME), meaning it has a ~0.1% error rate. All the FIXMEs are due to improper numbers of color tags tho, it has a bit of trouble with them when a sentence uses a bunch.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Extracting all the lines is really annoying because of how the game loads them. I know how to do it outside the game, but I need all the context the game provides. :mad:
I have all NPC dialogue translated, but that doesn't include dialogue initiated by cutscenes, need to poke around and figure that out because that's probably another couple thousand lines.

Just entered a cutscene and queued up over a hundred lines. :groan:
Last edited by rusty_shackleford on February 18th, 2025, 10:14, edited 1 time in total.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

All the HTLS-specific stuff was moved out to a separate project that gets loaded as a plugin. I'll publish an updated version of the AI translator on github when I get done translating HTLS.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Things not directly related to the AI translator plugin will be moved to a separate assembly. :popcorn2: For example, the UI path matching, UI path rewriters, etc.,

UI path rewriters look like:

Code: Select all

[[UIPathRewriter]]
pattern = "/Canvas\(Clone\)/UIBattle\(Clone\)/Anchor_1920\*1080/WgBillboardPanel /WgUnitHP_[^/]+/"
replacement = "/Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgBillboardPanel /WgUnitHP_/"

[[UIPathRewriter]]
pattern = "/Canvas\(Clone\)/UIBattle\(Clone\)/Anchor_1920\*1080/WgTurn/WgMemo/Content/[^/]/Text"
replacement = "/Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgTurn/WgMemo/Content/0/Text"


Might be able to get the newest version of my stuff out tonight or tomorrow.
Last edited by rusty_shackleford on February 20th, 2025, 19:57, edited 1 time in total.
User avatar
loregamer
Site Moderator
Posts: 2601
Joined: Dec 3, '23

Post by loregamer »

rusty_shackleford wrote: February 20th, 2025, 19:57
Might be able to get the newest version of my stuff out tonight or tomorrow.
Erm, don’t jinx it :oops:
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

rusty_shackleford wrote: February 20th, 2025, 19:57
Things not directly related to the AI translator plugin will be moved to a separate assembly. :popcorn2: For example, the UI path matching, UI path rewriters, etc.,

UI path rewriters look like:

Code: Select all

[[UIPathRewriter]]
pattern = "/Canvas\(Clone\)/UIBattle\(Clone\)/Anchor_1920\*1080/WgBillboardPanel /WgUnitHP_[^/]+/"
replacement = "/Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgBillboardPanel /WgUnitHP_/"

[[UIPathRewriter]]
pattern = "/Canvas\(Clone\)/UIBattle\(Clone\)/Anchor_1920\*1080/WgTurn/WgMemo/Content/[^/]/Text"
replacement = "/Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgTurn/WgMemo/Content/0/Text"


Might be able to get the newest version of my stuff out tonight or tomorrow.
Decided to make the pattern matching simpler for normies

Code: Select all

[[UIPathRewriter]]
pattern = "/Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgBillboardPanel /WgUnitHP_{}/"
replacement = [""]

[[UIPathRewriter]]
pattern = "/Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgTurn/WgMemo/Content/{}/Text"
replacement = ["0"]
Those get normalized to:
"/Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgBillboardPanel /WgUnitHP_/"
"/Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgTurn/WgMemo/Content/0/Text"

This will rewrite all matching UI paths for the purposes of scoping(layers).
And we can match against those when setting layers in our translation file:

Code: Select all

#set layer /Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgBillboardPanel /WgUnitHP_/Text
sr:"^(.*?)\n([^\n]*?)$"=$1\n$2
#unset layer /Canvas(Clone)/UIBattle(Clone)/Anchor_1920*1080/WgBillboardPanel /WgUnitHP_/Text
:music:
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

Full translation uploaded.

I'll work on a list of things I need help with tomorrow. It's ~99% translated.

I didn't play a new game yet so enjoy whatever issues you encounter!

Known issues:
I know the opening text crawls aren't translated, text crawls are harder to do properly, I'll get to it eventually.
Text not fitting/overflowing. Bug with the translator plugin, I'll fix it tomorrow or so.
other stuff!
Last edited by rusty_shackleford on February 21st, 2025, 11:06, edited 1 time in total.
User avatar
gerey
Turtle
Turtle
Posts: 2226
Joined: Feb 2, '23

Adventurer's Guild

Post by gerey »

Here's what I got so far. Hope it helps.
► Show Spoiler
Last edited by gerey on February 21st, 2025, 21:42, edited 3 times in total.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

@gerey Thanks!
gerey wrote: February 21st, 2025, 21:39
The Holy Hall is sometimes called that, at other times Shengtang, and elsewhere Sheng Tang. I assume it's all referring to the same thing?
Yeah, this is a major issue that will take work. Not this specifically, but nouns being referred to in different terms, especially when switching between pinyin & translation. It will require some normalization.
I've considered feeding the dialogue into an AI and having it look for inconsistencies.
gerey wrote: February 21st, 2025, 21:39
This is worder weirdly - it would sound more natural if it was translated as "Capture them both!"
Most of the early dialogue needs retranslated tbh. It's on my backlog of things to do.

Did you use a custom name? All the dialogue was generated for the default name, I'm still thinking of how to best handle this.
Last edited by rusty_shackleford on February 21st, 2025, 21:57, edited 1 time in total.
User avatar
gerey
Turtle
Turtle
Posts: 2226
Joined: Feb 2, '23

Adventurer's Guild

Post by gerey »

rusty_shackleford wrote: February 21st, 2025, 21:56
Did you use a custom name?
Yeah, I generally tend to use this one for all chink games - both because it's so short it can fit all character limits and because it's the name of the protagonist of the only xianxia story I like, Ave Xia Rem Y, which is written by an American far as I can figure.

I do recommend giving it a read, it's a genuinely good story.
rusty_shackleford wrote: February 21st, 2025, 21:56
All the dialogue was generated for the default name, I'm still thinking of how to best handle this.
I've asked the guy that did the translation for Fate Seeker 1 about this, and he said one way to do it would be to make a BepinEx patch for the game. For Fate Seeker 1 he managed to edit some values directly since he was able to get his hands on the unencrypted game files from somewhere.

Probably the most painless way to do it is to tell players to replace the name via the AutoTranslator. Include a .txt called charname or something, and direct them to change the protagonist's name there.
User avatar
rusty_shackleford
Site Admin
Posts: 24538
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Adventurer's Guild

Post by rusty_shackleford »

0.1.1 uploaded. I created a new game and fixed stuff as I encountered it, various UI-related text fixes too. Did a lot of work on properly translating martial arts/martial arts manual names. Did a full pass on the names of all the Insight tree nodes(used rather poetic language for most of them when translating to keep it fitting, I hope you enjoy it. :) ), descriptions still need their own pass.

I'm working on transcribing the intro video & adding hardcoded English subtitles to it.
Post Reply