ferram4 / Ferram-Aerospace-Research

Aerodynamics model for Kerbal Space Program
Other
239 stars 131 forks source link

Localization Support and Translations #194

Open ferram4 opened 7 years ago

ferram4 commented 7 years ago

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:

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.

pand5461 commented 7 years ago

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

riptl commented 7 years ago

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

ferram4 commented 7 years ago

@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.

awphilippov commented 7 years ago

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

riptl commented 7 years ago

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

pand5461 commented 7 years ago

Russian translation so far: #196

ferram4 commented 7 years ago

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?

Nigh commented 7 years ago

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

riptl commented 7 years ago

~~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.

pand5461 commented 7 years ago

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)".

riptl commented 7 years ago

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 :(

pand5461 commented 7 years ago

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?

ferram4 commented 7 years ago

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.

pand5461 commented 7 years ago

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...

ferram4 commented 7 years ago

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.

ChrisViral commented 7 years ago

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

Nigh commented 7 years ago

@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.

ferram4 commented 7 years ago

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 commented 7 years ago

@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.

onb912 commented 7 years ago

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?

riptl commented 7 years ago

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 commented 7 years ago

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…

pand5461 commented 7 years ago

@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 commented 7 years ago

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

ChrisViral commented 7 years ago

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

ferram4 commented 7 years ago

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.

riptl commented 7 years ago

@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:

ferram4 commented 7 years ago

@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.

riptl commented 7 years ago

@ferram4 done: #198

Nigh commented 7 years ago

@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.
onb912 commented 7 years ago

I translated a little Japanese. Since I do not know the appropriate words with my knowledge any more, I will only use it as a minimum. Localization.txt

ferram4 commented 7 years ago

I have merged #196 #198 and #200 since those appear to be done. Thanks to all of you for your help.

Zhuojie-Ji commented 7 years ago

@ferram4 @Nigh I noticed that the Chinese Translation uses Hong Kong or Taiwan's vocabulary (judging from AoA = 攻角, instead of 迎角). It's a bit different in the mainland. I wonder if I can help with Chinese Localization too, and create an additional version that people from mainland might be more familiar with?

Also there might be an issue with the glyphs. For example, in the translation of AoA, 攻角, the character 角 uses the Hong Kong/Taiwan/Korea/Japan versions' glyph in Nigh's screenshots, however people from mainland might feel a little uncomfortable with it. I'm not sure if computer systems adapt to the glyphs based on the system language, or if it needs to be hard coded in the mod.

This screenshot shows the glyph differences: image The highlighted character is 角. From left to Right, it is displayed in Mainland, Taiwan, Hong Kong, Japan, Korea, and Vietnam's versions. The table in the screenshot is from this wikipedia page

ferram4 commented 7 years ago

Please, go ahead. I honestly have no understanding of any of this, so I'll defer to you guys on what needs to be done.

Rodhern commented 7 years ago

Hi, I think that the Reynolds number in the flight GUI is matching this line: FARFlightGUIReynolds = Reynolds: <<1:e2>> There is a Lingoona grammar checker here: http://lingoona.com/cgi-bin/grammar#l=en&oh=1 The converted value currently shows "^e2" in my game and in the grammar checker. I don't know what the fix is, but it seems that it may be a typo of some kind.

ferram4 commented 7 years ago

Yeah, that's something I need to find where the error is. Something's not working out in formatting it properly.

Rodhern commented 7 years ago

I believe I have a possible fix. Maybe the idea all along was to have the StringBuilder take care of the formatting.

The new cfg value would be (notice the use of special half square characters): FARFlightGUIReynolds = Reynolds: 「0:E2」 Now moving over the parenthesis in code will format the value with the StringBuilder instead of Lingoona: _strBuilder.AppendFormat(Localizer.Format("FARFlightGUIReynolds"),_vesselAero.ReynoldsNumber);

Speaking of special characters, I notice that there is a trailing space in 'FARFlightGUIAtmDens'. A better choice is an explicit space character: FARFlightGUIAtmDens = Atm Density:\u0020

Nigh commented 7 years ago

@Zhuojie-Ji I checked my translation, and I'm sure that there are no problem with characters I used. It must be some fonts issue. You could check the text in #200 as well.

And about "攻角" and "迎角" issue, you are right, the official translation of AoA in mainland should be "迎角". But in fact, we use "攻角" in many forums and communities as well. We all know that they are the same thing.

I will be glad if you could help for better Chinese localization.

ferram4 commented 7 years ago

Alright, I made the changes suggested by @Rodhern and they work. So the only thing remaining on this to match what stock has is Japanese localization, and then anything else anyone wants to contribute.