DMagic

Addon Localization Home

152 posts in this topic

1 minute ago, TiktaalikDreaming said:

Has someone got a list of which languages are currently supported?  As modders, even if we rely on "quality" google translate, we will probably need to at least populate the set of languages for anything we use localization for.  

These are the ones in the current pre-release, and as far as we know, planned for the full release:

DbCCJWK.png

1 person likes this

Share this post


Link to post
Share on other sites
27 minutes ago, HebaruSan said:

These are the ones in the current pre-release, and as far as we know, planned for the full release:

DbCCJWK.png

Cool thanks.  Also, thanks for it being a cut and paste so this daft person can see he could have gone to the same dropdown.  :-)

I'm probably going to attempt some part description translations to have in place for whatever the solution ends up being.

1 person likes this

Share this post


Link to post
Share on other sites

If you use the stock localization code then it is easy to add a new lang with a cfg/MM patch. You should let native speaker translate from your cfg.

3 people like this

Share this post


Link to post
Share on other sites
8 hours ago, sarbian said:

You should let native speaker translate from your cfg.

Never a truer word was spoken about translations.  :D

Share this post


Link to post
Share on other sites

There are more languages planned. I'd hate to see someone waste hours/weeks/months translating thousands and thousands of strings.

 

3 people like this

Share this post


Link to post
Share on other sites

Posted (edited)

On 3/28/2017 at 5:30 PM, TriggerAu said:

Sure, so one of the things that is likely to change is the class name (so Localization.Format) - which means we don't have a fixed in stone function that can be used. Thus the advice to wait.

EDIT: Please ignore previous post, I had reverted my install back to 1.2.2.

Edited by HebaruSan

Share this post


Link to post
Share on other sites

One of the much alluded to changes has taken place in the Localization methods. The Class name has been changed from Localization to Localizer. So if you have been doing any pre-release work just do a find a replace for Localization.Format to Localizer.Format and it should work fine.

There has a also been a bug fix to avoid NRE's if you do something silly like passing a null string into the Format method.

3 people like this

Share this post


Link to post
Share on other sites

The modders notes have been published. Hopefully will answer most of your questions. If not post into this sub-forum.

 

3 people like this

Share this post


Link to post
Share on other sites
17 hours ago, JPLRepo said:

The modders notes have been published. Hopefully will answer most of your questions. If not post into this sub-forum.

I have a question: what about KSPedia localization?

Share this post


Link to post
Share on other sites

@Morse I think you just need to make different KSPedia entries for each language. They would probably have to be offered as a different or separate download package to avoid having all languages show up.

Share this post


Link to post
Share on other sites
1 hour ago, DMagic said:

@Morse I think you just need to make different KSPedia entries for each language. They would probably have to be offered as a different or separate download package to avoid having all languages show up.

That is correct.
You have to replace the .ksp KSPedia packages (after making 171 new ones).

Share this post


Link to post
Share on other sites
4 hours ago, JPLRepo said:

You have to replace the .ksp KSPedia packages (after making 171 new ones).

I don't want to translate the stock KSPedia, I want to add my own entry. It's quite unfortunate if there won't be any support for localization there. Let's hope CKAN people will come up with some solution.

Share this post


Link to post
Share on other sites
1 hour ago, Morse said:

I don't want to translate the stock KSPedia, I want to add my own entry. It's quite unfortunate if there won't be any support for localization there. Let's hope CKAN people will come up with some solution.

I am not following you question.
You can create your own KSPedia entries for your mods today?
To have localized pages in different languages you have to create separate asset packages for the page in each language and swap them in and out. That's what stock does.

Share this post


Link to post
Share on other sites
8 hours ago, JPLRepo said:

To have localized pages in different languages you have to create separate asset packages for the page in each language and swap them in and out. That's what stock does.

Yes, I understood that. And this won't work in real world.

How do you suggest I distribute my mod? With a lengthy instruction of what files need to be copied/deleted/swapped? Nobody will do it. And besides, doesn't it defies the whole point of localization support? "localization support" means the ability of one package to support several languages. I don't need any "localization" to make 10 separate packages providing one language each.

Also, CKAN doesn't provide any such capabilities (not yet at least), and since CKAN is the main distribution channel, this just won't work.

Share this post


Link to post
Share on other sites
6 hours ago, Morse said:

Yes, I understood that. And this won't work in real world.

How do you suggest I distribute my mod? With a lengthy instruction of what files need to be copied/deleted/swapped? Nobody will do it. And besides, doesn't it defies the whole point of localization support? "localization support" means the ability of one package to support several languages. I don't need any "localization" to make 10 separate packages providing one language each.

Also, CKAN doesn't provide any such capabilities (not yet at least), and since CKAN is the main distribution channel, this just won't work.

You might consider reporting this on the bug tracker.

http://bugs.kerbalspaceprogram.com/projects/prerelease/issues 

Share this post


Link to post
Share on other sites

Adjustments to (what we call) the static files does have some more looking at yes (eg KSPedia, textures, etc) . We are bound, in a sense, to some of the existing constructs and KSPedia is a good example - the "screens" are prefabs and the text is positioned visually; To automagically swap the text for all languages simply does not work as things like Russian have much longer text it it will overflow the images, etc thus why the stock ones are done through layout work to get them all fitting prettily. The ultimate solution may involve any number of ideas.

As before this is under prerelease and we are still working on things, so please keep that in mind

2 people like this

Share this post


Link to post
Share on other sites

Posted (edited)

5 hours ago, TriggerAu said:

We are bound, in a sense, to some of the existing constructs and KSPedia is a good example - the "screens" are prefabs and the text is positioned visually;

Actually, the prefabs are less of a problem for me, since it's a regular unity object, and I can do all kind of magic with it in the Awake(), including swapping the lines from .cfg (at least I think I can, didn't try it yet).

What I do have a problem with, is an xml file which contains the KSPedia schema - the categories names and screen titles. There is no way I can edit that on the fly.

If I may suggest, why don't you get rid of the separate xml schema at all? Why not store that information in the "Database Screen" component? If you don't want to redo all your stock entries, just make it optional: if "database screen" has a category information - use that, otherwise use xml. This will make the creation of the KSPedia entries so much easier for the modders (no need for the parttools, which, btw, is not working with 5.4).

Edited by Morse
1 person likes this

Share this post


Link to post
Share on other sites

I think the simplest solution, for now, would be to distribute your mod with all of the translated KSPedia assetbundles (with the language as a suffix on the file name), but only put the .ksp file extension on the primary language. Then you can instruct users to change the file extension if they want a different language. It's not ideal, but then I imagine there won't be more than a handful of mods that actually go to the trouble of making KSPedia translations.

KSP's asset loader will ignore bundles without a file extension, so the others will just be ignored.

Share this post


Link to post
Share on other sites

Hm, so I extracted the main xml from the kspedia.ksp, and I see that you put the #autoLOC's inside as the screen titles and categories names.

So maybe you do have a mechanism to make a localized KSPedia entries, you just didn't document it yet. How exactly does the game handles the names from this xml?

Also, while we're here: is there some way to add a screen to already-existing category? I was testing a bit, but it seems that KSPediaDatabase.Merge () throws an exception when you try to specify an already-existing category in your xml.

[EXC 19:07:07.023] InvalidOperationException: Collection was modified; enumeration operation may not execute.
	System.Collections.Generic.List`1+Enumerator[KSPAssets.KSPedia.KSPediaDatabase+Category].VerifyState ()
	System.Collections.Generic.List`1+Enumerator[KSPAssets.KSPedia.KSPediaDatabase+Category].MoveNext ()
	KSPAssets.KSPedia.KSPediaDatabase.MergeCategory (KSPAssets.KSPedia.Category c, KSPAssets.KSPedia.Category mergeCat, Boolean verbose)
	KSPAssets.KSPedia.KSPediaDatabase.Merge (KSPAssets.KSPedia.KSPediaDatabase merge, Boolean verbose)
	KSPAssets.KSPedia.KSPediaController+<CompileDatabase>d__12.MoveNext ()
	UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)

 

Share this post


Link to post
Share on other sites

Now that 1.3 is out we can start populating this thread with mods that support localization and mods that include translations.

If mod authors could post in here with their mods that support localization that would help. 

Some information should be included along with the mod name and link. This includes any language translations already provided, the amount of text that needs translating (both line and word count would be best), and the languages that need translations.

 

Some updated links for localization information:

 

One thing of note that I didn't see explicitly mentioned, since the CelestialBody.displayName returns the name with the gender tags (Kerbin^N instead of Kerbin) you will need to format the string before displaying it. If this is to be used as part of a longer string loaded from a config file then it shouldn't be a problem, but if you are using the name by itself, in a list of celestial bodies for instance, then you need to make sure to process it first. Rather than making a localization string that consists of <<1>> in a config file, I've just been using a string extension:

public static string LocalizeBodyName(this string input)
{
	return Localizer.Format("<<1>>", input);
}

string text = body.displayName.LocalizeBodyName();

 

2 people like this

Share this post


Link to post
Share on other sites

AirlockPlus [thread] [localizations] - 7 lines, 25~30 words - Chinese: available, proofread needed / Japanese: available, proofread needed / Russian: partial, translator needed / Spanish: partial, translator needed

 

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

TalisarParts - https://github.com/taniwha/TalisarParts

English done, working on Spanish but needs translator. Everything else is needed.

 

EDIT: Im also working on localization for other languages. Current planned languages are French, German, Italian, Dutch and Polish

 

Edited by Olympic1

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