CG8516 / PvZA11y

An accessibility mod for Plants VS Zombies
MIT License
31 stars 11 forks source link

Hi, how do I translate and transform languages? #32

Open piano777wzy opened 8 months ago

piano777wzy commented 8 months ago

This is great, so I can translate, but what should I do?

CG8516 commented 8 months ago

To create a language, make a copy of the 'English' folder, name it your language, and replace the text within the .yaml files with whatever text you want.

Yaml files are basically just .txt files, and can be edited with notepad.
They're pretty friendly to edit, just make sure you only edit the contents after the colon ':'
Also make sure you keep all blank lines, and special characters, like '- >-' and '- '

Here's an example from ZenGarden.yaml.
Two of the original lines are:

nextGarden: Next Garden
chocolate: 'Chocolate: '

You would make sure your translated version looks like this:

nextGarden: Your words here chocolate: 'Your chocolate word here: '

Note how everything before the first colon needs to stay the same, and for the chocolate line, the single quotes areound the sentence need to stay the same, as there's a space at the end of the sentence.

Also, some lines may have something like [0] in them. This is a placeholder, which the mod will replace with a number or other text.

For example, this line:

wheelBarrowHolding: WheelBarrow with [0]

The [0] will be replaced with a plant name. "WheelBarrow with Pea Shooter"

So you could convert it into something like:

wheelBarrowHolding: [0] in a WheelBarrow

Which would say: "Pea Shooter in a WheelBarrow"

piano777wzy commented 8 months ago

要创建语言,请复制“英语”文件夹,将其命名为您的语言,然后将 .yaml 文件中的文本替换为所需的任何文本。

Yaml文件基本上只是.txt文件,可以用记事本编辑。它们编辑起来非常友好,只需确保只编辑冒号“:”之后的内容,还要确保保留所有空行和特殊字符,如“->-”和“-”

下面是 ZenGarden.yaml 中的一个示例。原来的两行是:

nextGarden: 下一个 Garden chocolate: '巧克力: '

您需要确保翻译版本如下所示:

nextGarden: Your words here chocolate: 'Your chocolate word here: '

请注意,第一个冒号之前的所有内容都需要保持不变,对于巧克力行,句子中的单引号需要保持不变,因为句子末尾有一个空格。

此外,某些行中可能包含类似 [0] 的内容。这是一个占位符,mod 将用数字或其他文本替换它。

例如,以下行:

wheelBarrowHolding: 独轮手推车 [0]

[0] 将替换为工厂名称。“带豌豆射手的独轮车”

因此,您可以将其转换为:

wheelBarrowHolding: [0] 在独轮手推车中

它会说:“独轮车上的豌豆射手”

Will you encounter: how should it be translated? For example, there is something like this below. ContinueGame: >- Continue Game?

CG8516 commented 8 months ago

>- means you can add multiple lines. Any lines after it need to be indented by at least one space.
Like this:

continueGame: >-
 Continue?  
 Do you want to continue or restart?  

You can add those to most entries, if you need to add additional lines in your translation.

Also, if a line starts with a dash and a space '- ', you'll need to make sure you leave those at the start.
Like:

- ZomBotany
- Slot Machine

Also, in tutorials, some entries have '- >-'
The dash indicates a new tutorial dialog, and the >- indicates that it's a multi-line tutorial.

So some tutorials have a few multi-line entries, which allows them to be split into multiple messages.
Each line is used when navigating tutorial text.
And if there's more than one entry, it will show as an additional tutorial dialogue after pressing Confirm.

As an example:

Level1:
- >-
    Line 1
    Line 2
    Line 3
- >-
    Line 1
    Line 2

This will show two tutorial dialogues. One with three lines, then after you press Confirm, another tutorial will be shown with two lines.

piano777wzy commented 8 months ago

Is there anyone in the new patch group to test whether you will encounter the following problems: in the barrier-free option, set the screen reader to nvda, which is not the default automatic. After the end of this game, the next time you start the patch, it will directly flicker. You must change nvda to automatic in the configuration file in order to play properly.

---Original--- From: @.> Date: Sun, Dec 31, 2023 23:34 PM To: @.>; Cc: @.**@.>; Subject: Re: [CG8516/PvZA11y] Hi, how do I translate and transform languages?(Issue #32)

>- means you can add multiple lines. Any lines after it need to be indented by at least one space. Like this: continueGame: >- Continue? Do you want to continue or restart?
You can add those to most entries, if you need to add additional lines in your translation.

Also, if a line starts with a dash and a space '- ', you'll need to make sure you leave those at the start. Like:

So some tutorials have a few multi-line entries, which allows them to be split into multiple messages. Each line is used when navigating tutorial text. And if there's more than one entry, it will show as an additional tutorial dialogue after pressing Confirm.

As an example: Level1: - >- Line 1 Line 2 Line 3 - >- Line 1 Line 2
This will show two tutorial dialogues. One with three lines, then after you press Confirm, another tutorial will be shown with two lines.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>