qwerjk

How to make an English translation file?

Recommended Posts

qwerjk    8

I am a Chinese mod creator, so my code is full of Chinese.

Some friends want me to make an English version. And I tried to do it.

Now, I can translate into other languages and take effect(only tried to take effect). But, Only English can't.

Can someone help me ?

Share this post


Link to post
Share on other sites
rooks    263

Can you explain in more detail what problem you are running into?

The game treats English in a special way -- any strings built directly into the definitions of the game's content (cards, characters, etc.) will be treated as the de facto English translation.  If you used Chinese strings, the game will probably treat these as the "english" version.  So what you will need to do is to use English strings in the definitions of your content, and instead use a translation file (.po) that contains all the Chinese strings.

I believe there are a number of mods that support both English and Chinese, you might use one of those as reference.

Good luck!

  • Thanks 1

Share this post


Link to post
Share on other sites
qwerjk    8
On 8/12/2021 at 10:40 PM, rooks said:

Can you explain in more detail what problem you are running into?

The game treats English in a special way -- any strings built directly into the definitions of the game's content (cards, characters, etc.) will be treated as the de facto English translation.  If you used Chinese strings, the game will probably treat these as the "english" version.  So what you will need to do is to use English strings in the definitions of your content, and instead use a translation file (.po) that contains all the Chinese strings.

I believe there are a number of mods that support both English and Chinese, you might use one of those as reference.

Good luck!

I know that I used Chinese strings, the game will probably treat these as the "english" version.

Maybe I should change my expression:

I want to adjust some strings of the original game in the "english" version. 

On 8/12/2021 at 10:40 PM, rooks said:

I believe there are a number of mods that support both English and Chinese, you might use one of those as reference.

I know there are a number of mods that support both English and Chinese. But they are use english strings in the mod ,and translate into Chinese.

But I use Chinese strings in the mod and want to translate into English, because my English is not very good. If I use English in mod, it will cause unnecessary trouble for my maintenance.

So, I need some help.

The Chinese version

447646852_.thumb.png.64b97e69d1e7e811e4e2582bca7a0c65.png

The English version

909259914_.thumb.png.5b075a93356545ebae2505955bc89437.png

Edited by qwerjk

Share this post


Link to post
Share on other sites
rooks    263

When playing under the English language setting, only fonts that support English characters are loaded, so Chinese characters for example will not be displayed correctly.

You can possibly try providing an override to the English language settings in your mod's OnPreLoad function, something like this:

local function OnPreLoad()
    Content.AddLocalization
    {
        id = "english",
        name = "English (Notosans)",
        font_settings = 
        {
            title = { font = "fonts/notosans_cn_sdf.zip", sdfthreshold = 0.36, sdfboldthreshold = 0.30, sdfshadowthreshold = 0.25 },
            body = { font = "fonts/notosans_cn_sdf.zip", sdfthreshold = 0.4, sdfboldthreshold = 0.33 },
            button = { font = "fonts/notosans_cn_sdf.zip", sdfthreshold = 0.4, sdfboldthreshold = 0.33 },
            tooltip = { font = "fonts/notosans_cn_sdf.zip", sdfthreshold = 0.4, sdfboldthreshold = 0.33 },
            speech = { font = "fonts/notosans_cn_sdf.zip", sdfthreshold = 0.4, sdfboldthreshold = 0.33 },
        },
        default_languages = 
        {
            "en",
        },
    }
end

 

Not sure if that answers your question but hopefully it helps.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now