Jump to content

[Discussion] Localization (again)


Recommended Posts

This is more of a problem for languages like mine that have more than one form, but a pattern different from English. Eventually, this string should be fetched with ngettext. I don't remember if our i18n system can do that already.

It does. (The function is called translatePlural(singular, plural, count) in the E.ngine)

That string is part of the attack rate display code which isn't the nicest thing to translate properly.

"%(arrowcount)s arrow / second""%(arrowcount)s arrows / second""%(arrowcount)s arrows / %(time) seconds""%(arrowcount)s arrow / %(time) seconds"
are the 4 different variations in English, some other languages may have more. If someone can think of a nicer way to translate this, I'm all ears.

I'll also upload some newer strings to transifex, since I changed that code since the last update.

Link to comment
Share on other sites

Thank you, GunChleoc and leper.

"%(arrowcount)s arrow / second""%(arrowcount)s arrows / second""%(arrowcount)s arrows / %(time) seconds""%(arrowcount)s arrow / %(time) seconds"

That helped me a lot to understand what's going on. I would prefer to group them into with- and without-variable forms.

(singular) : (plural)#1: "%(arrowcount)s arrow / second", "%(arrowcount)s arrows / second"#2: "%(arrowcount)s arrow / %(time) seconds", "%(arrowcount)s arrows / %(time) seconds"

And in my opinion, the slash and "second(s)" are better not to be separated, as well as prepositions and following nouns.

Edited by llen_llen
Link to comment
Share on other sites

The difficult for the ngettext system here is that you have 2 plurals in one string, so you will need to fetch them separately, e.g. something like this (in mock-up code):

// get plural form for arrowsstring arrows = translatePlural("%d arrow", "%d arrows", arrow_count)// get plural form for secondsstring seconds = translatePlural("%d second", "%d seconds", time_seconds)// stick them togetherstring arrows_seconds = sprintf("%(arrowcount)s / %(time)", arrows, seconds)

If some languages need the "/ %(time)" in one string, that would also be fine by me. I jut have trouble coming up with the mock-up code for that right now.

Link to comment
Share on other sites

The difficult for the ngettext system here is that you have 2 plurals in one string, so you will need to fetch them separately, e.g. something like this (in mock-up code):

// get plural form for arrowsstring arrows = translatePlural("%d arrow", "%d arrows", arrow_count)// get plural form for secondsstring seconds = translatePlural("%d second", "%d seconds", time_seconds)// stick them togetherstring arrows_seconds = sprintf("%(arrowcount)s / %(time)", arrows, seconds)
If some languages need the "/ %(time)" in one string, that would also be fine by me. I jut have trouble coming up with the mock-up code for that right now.
That is what is currently used (in a slightly modified form, omitting the %(time)s for "second").

Spahbod: That should be fixed (see fcxSanya's reply).

Link to comment
Share on other sites

  • 3 weeks later...

I don't know if the code structure easily allows this, but how about splitting the translation into multiple text domains? The main file is huge.

For example, we could have separate .po files for general GUI stuff (menus etc.), one for the quotes in the loading screen, and one for each civ. And of course one for each campaign, once they get implemented.

The files could then be ordered in Transifex so as to have the most important ones first, and it would also make the localization of mods easier. It would also make it easier for the bigger teams to split and coordinate the work.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I have another feature request for this - for sometime in the future when/if you find the time, of course.

It would be great to have support for unicode entities, so I can use stuff like protected hyphens. My language has prefixes like t-, n- and h- that must not be split from the following word. Also, it would be really great if we could get the character U+204A in (⁊) in, but I guess that is primarily a font issue.

Edited by GunChleoc
Link to comment
Share on other sites

  • 2 months later...

I found 2 string inconsistencies:

simulation/ai/tutorial-ai/economic_walkthrough.js:148Research the stone mining technology from the storehouse.

"stone mining" does not exist in Transifex.

simulation/ai/tutorial-ai/economic_walkthrough.js:193Start researching Phase 2.

Which phase is that? village/town/city

Link to comment
Share on other sites

Thanks!

I found a typo:

civs/brit.jsonHistory

The Britons were the Celtic tribes of the British Isles. Using chariots, longswordsmen and powerful melee soldiers, they staged fearesome revolts against Rome to protect their customs and interests. Also, they built thousands of unique structures such as hill forts, crannogs and brochs.
Link to comment
Share on other sites

Yes, string freeze is blocking any changed for the moment; we should still keep track of these somehow though.

I have another one:

civs/hele.jsonTeamBonuses[0].Description

All units and allied units have increased LOS. ~ 10%

LOS is not defined anywhere. I have no idea what it means and neither will the player. There is another LOS in the options (gui/options/options.js:21 "Smooth LOS"), but that will be something technical.

ETA: I have had a look at the German translation, it seems to be "vision range"

Edited by GunChleoc
Link to comment
Share on other sites

I just managed to hit the 90% mark and I hope I'm still in time for getting into the SVN? :heat:

We didn't make the final pull yet. So I think you're in time. But we just noticed that ICU (https://en.wikipedia.org/wiki/International_Components_for_Unicode) doesn't know Gaelic (marking your file as invalid). Guess we'll have to find something for that (ICU also doesn't recognise Latin, but that issue was not urgent we thought).

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

 Share

×
×
  • Create New...