Morse

"default" language for mod localization

Recommended Posts

Is there a way to provide some "default" language (presumably, english) for the mod?

Right now, the labels with no translation in the selected language are just left as-is, which means that if a user has a language which is not supported by the mod, he'll see a useless labels. Officially, KSP supports only five languages, so I just copied the english localization five times with different names. But I guess it's only a matter of time until we get the language mods for lots of other languages. I can't copy my localization for every language there is.

Share this post


Link to post
Share on other sites

When I tested this, English was used as the default.

What sort of mod are you working on? I have a plugin that calls Localizer.Format for translation, so maybe there's some extra logic in that function that doesn't apply to whatever you're doing.

Share this post


Link to post
Share on other sites

Based on my initial testing so far, if you supply values for all your localisation strings in the en-us section then other languages will fall back to using the English versions but if there are any missing from the en-us block (even if present in say the ja block) then the English version of the game won't use the alternate language definition.

i.e. a custom localisation config of:

Localization
{
    en-us
    {
        #mymod_one = one
        #mymod_two = two
    }

    ja
    {
        #mymod_one = 一
        #mymod_three = 三
    }
}

Will work fine in the Japanese version of the game for all three tags (using the English fall back for #mymod_two) but the English game won't fall back to using the Japanese definition for #mymod_three

Edit: this is based on using calls to Localizer.Format(template) or Localizer.GetStringByTag(tag) in a C# module to populate text in a UI window.

Edited by Aelfhe1m

Share this post


Link to post
Share on other sites

Thanks guys. I found an error in my own setup: my section was called "en", not "en-us". Strangely, it was working before like that. The language labels must have been changed recently.

Case closed, I guess.

Share this post


Link to post
Share on other sites

No. it was always en-us.
and yes. you can only do one language if you prefer.
I'd recommend just repeating your English Localization cfg node for all the other languages and put the language codes in them. Then when everyone volunteers to translate it for you you can just drop their translation in.
you also don't have to localize your mod at all. and just leave it as before in English.
 

Share this post


Link to post
Share on other sites
6 minutes ago, JPLRepo said:

I'd recommend just repeating your English Localization cfg node for all the other languages and put the language codes in them.

Well, "all the other languages" sounds fun. There are many languages in the world :)

But I did that for the officially supported languages, yes.

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.