Ferram-Aerospace-Research icon indicating copy to clipboard operation
Ferram-Aerospace-Research copied to clipboard

Localization Support and Translations

Open ferram4 opened this issue 7 years ago • 39 comments

With KSP 1.3 providing localization support it makes sense to convert the vast majority of FAR's strings over to support this. However, my knowledge of languages beyond English is extremely limited and the number of strings is rather daunting, so I'll welcome any help on translations and getting strings set up.

Current localization strings are being placed in this localization config and as of this writing is partway through the editor GUIs.

Currently, here's what's needed:

  • [x] Convert rest of UI strings to support localization
  • [x] Convert RealChuteLite strings to support localization
  • [x] Verify that GUI strings function
  • [x] Verify that right-click menu strings function
  • [ ] Support Spanish
  • [x] Support Russian
  • [x] Support Chinese
  • [ ] Support Japanese

Anyone willing to provide translations for languages not listed is also welcome to offer, but these are the ones supported by the stock game and so are a good first step. None of these languages are required for a FAR 1.3 release, but I would like to support localization for it before releasing.

For anyone who wishes to test in KSP 1.3, the build on the lowercase ksp_update branch is functional (though untested) with MFI 1.2.4 and MM 2.8.0.

ferram4 avatar Jun 04 '17 22:06 ferram4

I'm happy to help with Russian localization. How important is it to keep the same length of translated strings close to the original?

pand5461 avatar Jun 05 '17 13:06 pand5461

German localization pull request for my favorite KSP mod: #198

riptl avatar Jun 05 '17 16:06 riptl

@pand5461 Depends on which string, but generally there's a little space for slightly more characters everywhere except some of the shorter ones in the Editor GUI where it's very tight. All of that said, if it reaches the point where a translation really needs slightly more space to be accurate, do it and make a note somewhere, list it for the PR, and we'll make it work.

@terorie Cool, there'll be more to get done once more of the strings are setup for localization, but thanks for the effort so far.

ferram4 avatar Jun 05 '17 23:06 ferram4

Good Lord! Ferram, I'm in. It would be glad to help with Russian localization

awphilippov avatar Jun 06 '17 06:06 awphilippov

@ferram4 Okay, can you please notify us in this thread when more work is to be done?

riptl avatar Jun 06 '17 08:06 riptl

Russian translation so far: #196

pand5461 avatar Jun 06 '17 14:06 pand5461

Alright, there's more stuff supported right now. Still a fair bit more to do, but here it is. @terorie @pand5461 @awphilippov

Also, should the strings for units also support localization?

ferram4 avatar Jun 06 '17 20:06 ferram4

Willing to help with Chinese localization, for my favorite KSP mod.

Nigh avatar Jun 07 '17 09:06 Nigh

~~I'm done with the new strings, still at #195. Also, my Git thinks Localization.cfg is a binary file and doesn't show diff, which is a bit annoying when making merges. I have a fix for it and it is at #197. Please take a look at it :)~~

Localization.cfg is UTF-16LE please tell me I can change that.

riptl avatar Jun 07 '17 13:06 riptl

Also, should the strings for units also support localization?

For Russian language, it would be nice to, although not absolutely necessary. Problem is, the russian designations for units use cyrillic, so "м" for "m(etres)" and "с" for "s(econds)".

pand5461 avatar Jun 07 '17 14:06 pand5461

Sorry for making all those PRs I am a noob. Here's my latest one #198.

I had to change the encoding from UTF-16LE to UTF-8 because GitHub editor :(

riptl avatar Jun 07 '17 14:06 riptl

Found out that FAREditorStabDerivCalcButton is missing in StabilityDerivGUI.cs. Now FAREditorStabDerivSpoiler is shown instead. Also, may I ask what do Dynamic Pressure Control Reduction and Dyn Pres For Control Scaling do exactly?

pand5461 avatar Jun 07 '17 20:06 pand5461

Found out that FAREditorStabDerivCalcButton is missing in StabilityDerivGUI.cs. Now FAREditorStabDerivSpoiler is shown instead.

Thank you, thank you, I'll get that fixed. Knew I would screw something up.

Also, may I ask what do Dynamic Pressure Control Reduction and Dyn Pres For Control Scaling do exactly?

When activated, it reduces control inputs inverse proportionally with dynamic pressure. So let's say that you turn it on, and it's calibrated for 10 kPa dynamic pressure. At 10 kPa and lower, full control deflection go through. At 20 kPa, the control system will reduce full to half; at 40 kPa, it will reduce full to 1/4, and so on. It's a means of keeping the forces due to control inputs clamped to something reasonable so craft don't break up.

ferram4 avatar Jun 07 '17 20:06 ferram4

It's a means of keeping the forces due to control inputs clamped to something reasonable so craft don't break up.

Thanks for the explanation! Now to translate it in four words...

pand5461 avatar Jun 07 '17 20:06 pand5461

Alright, so there's more stuff supported again, @pand5461 @terorie @Nigh @awphilippov. Only thing left is support for RealChuteLite.

With that in mind, poking @StupidChris to see what and how he wants to do this, since we can probably avoid duplicating work with this.

ferram4 avatar Jun 07 '17 21:06 ferram4

Well, so far I hadn't even touched localization support on the RealChute side at all, not even sure I had plans for it. There shouldn't be too much to add though, so I'm pretty sure someone could just quickly sift through the code and add the needed localization support

ChrisViral avatar Jun 08 '17 05:06 ChrisViral

@terorie @ferram4 ~~Chinese translation #199~~

~~and request to change the encoding of Localization.cfg to UTF-8 for correctly diff and merge.~~

new Chinese translation pr in UTF-8 #200

2017.06.20: RCL translation added.

Nigh avatar Jun 08 '17 16:06 Nigh

I've changed the encoding to UTF-8, sorry about the issues it caused.

@StupidChris well, then in that case, I'll go ahead and convert over RealChuteLite and you can steal what you need for later.

ferram4 avatar Jun 09 '17 03:06 ferram4

@terorie @pand5461 @Nigh there's now localization support for RealChuteLite stuff, so please, get to that when you're willing.

@StupidChris Check out the RCL localization changes and see if they're alright. I think some things might need to be moved around to reduce garbage, but as things currently are it should work.

ferram4 avatar Jun 11 '17 00:06 ferram4

Sorry bad english. I challenged for japanese translation. And there are several questions. Should units and so on (eg, Cl, knots) be units? Or should you translate?

onb912 avatar Jun 11 '17 01:06 onb912

ferram4 Do the RCLGUI15 and RCLGUI16 fields describe the duration the chute takes to deploy? (It says RCLGUI15 = Predeployment speed: <<0>>s)

Because I'm not sure 😬. My PR is ready though.

riptl avatar Jun 11 '17 10:06 riptl

Would anyone be interested in a custom Unity Build Script for Localization? We could split up the Localization.cfg in multiple files like Localization_de-DE.cfg and Localization_en-US.cfg in the repo. The Build Script would then generate a Localization.cfg before build.

We would avoid the merge hell with the PRs and commits on upstream…

riptl avatar Jun 11 '17 11:06 riptl

@onb912 , the translations of units of measure and designations is up to you, I guess. For the Russian translation, I left coefficients (e.g. Cl, Ixx and so on) as is, and translated units of measure (atm, knots, kg).

pand5461 avatar Jun 12 '17 16:06 pand5461

@ferram4 A problem with Incompatible mod window. Here is how it looks on my installation: http://i.imgur.com/0TyRlPW.png

pand5461 avatar Jun 12 '17 16:06 pand5461

@ferram4 looks pretty much like what i'd expect it to :)

ChrisViral avatar Jun 13 '17 02:06 ChrisViral

Hey, sorry about the delay. Real life got in the way.

@terorie Yes, it's the duration the chute takes to deploy. Yes, the title in English says speed. No, this doesn't make sense. It's @StupidChris 's line, ask him.

Also, that is an excellent idea regarding the localization files. Please, everyone involved, split your work into a new file.

@onb912 Do whatever you feel is best. Make the strings fit and translate as well as you can, but otherwise make your own judgment call on those. I'm that in the hands of the people that actually know the languages and what to do.

@pand5461 Is fixed.

ferram4 avatar Jun 18 '17 22:06 ferram4

@ferram4 What? You have a life unlike me? That's unheard of! ;-) Regarding the localization files, I couldn't find out how to make a C# build script. Any help would be appreciated. I have, however created some Shell scripts that work. I don't have access to a Windows machine right now so I can't create the batch scripts yet.

My repo

The way it works is this:

  • Place <localization code>.cfg in /Localization
    • (It's just the strings without any curly braces: Example)
  • Go to /Localization and execute writeloc.sh
  • (There is a bug that writeloc only works while you're in the Localization folder)
  • It will write the config to the Loc.cfg somewhere in GameData

riptl avatar Jun 18 '17 22:06 riptl

@terorie @pand5461 @Nigh Alright, one last change: make sure there are no \r carriage return characters in your translations. The localizer doesn't parse them and they aren't needed. Also, even if you don't have terorie's build script or something like that, please switch your file names to localization_[language code].cfg so that we can make merging things easier and adding new languages easier.

This is the last chance to ensure that your values are correct and display right before I merge them in a few days. There shouldn't be any more string changes coming down the pipe on my end.

ferram4 avatar Jun 21 '17 18:06 ferram4

@ferram4 done: #198

riptl avatar Jun 22 '17 17:06 riptl

@ferram4 qq 20170624004429

qq 20170624004619

  1. Because of the length of the text in the graph is too long, so I put the translation text below the title.

qq 20170624002423

  1. I think the Run simulation button uses the wrong text just as the screenshot shows above.

Nigh avatar Jun 23 '17 16:06 Nigh