Multilingual Oolite

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Post by Cmdr Wyvern »

Notepad is known to do odd things to a file when you save with it.

Try this editor on for size.
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

I second notepad++ fab little program - everything M$ could have made notepad but didn't!
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Thanks Cmdr Wyvern! Notepad++ works perfectly!

Hmm, I have another problem, but this is Polish grammar specific. Look at this picture:
Image

As you see, on the Cargo list we have few positions:

Code: Select all

168 tons Futra
220 tons Likiery/wina
and so on...

Problem is, this isn't natural Polish declination. Right will be so:

Code: Select all

168 ton futer
220 ton likierow/win
In Polish, declination of numerals is quite complicated:
1 tona=1 tone
2,3,4 tony = 2,3,4 tons
5, 6,...ton = 5,6 and more tons
and of course also noun is declinated:
Nominative plural: futra
genitive plural: futer

And genitive shall be used here.
And of course, without capitalization of first noun's letter. This can be complicated, because Oolite using only one commodities list, and use position from this list in all game. But in Polish is wrong to write noun with upper case, when this noun isn't first in the sentence, or is common noun.

Is this possible to implement this features in game code?
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Bump...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

I don’t think we can really expect to improve this much before the next full release. A list of words and sentences just isn’t flexible enough to handle all languages elegantly.

My long-term desire (I’m not going to go so far as to call it a plan) is to rewrite much of the user interface code in JavaScript. This way, you could override some of the logic. For instance, you might have a function like this in the core game:

Code: Select all

this.FormatCargoQuantity = function(quantity, unit)
{
    if (unit == "tons")
    {
        if (quantity == 1)  return "1 " + expandDescription("cargo-ton");
        else  return quantity.toString() + " " + expandDescription("cargo-tons");
    }
    // similar for kilograms and grams
}
and in Polish.oxp:

Code: Select all

 this.FormatCargoQuantity = function(quantity, unit)
{
    if (unit == "tons")
    {
        if (quantity == 1)  return "1 tona";
        else if (quantity < 5)  return quantity.toString() + " tony";
        else  return quantity.toString() + " ton";
    }
    // similar for kilograms and grams
}
in the mean time, could you use a unit symbol like "t" instead?
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Ahruman wrote:
in the mean time, could you use a unit symbol like "t" instead?
Yes. I know, I have to wait for next release...I'm only signalise this problem, and I know, it will be very complicate to beat this...but I hope Oolite team will be able to...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

To be clear, by “next full release” I don’t mean 1.73. (It could be 1.75, that’s a nice half-round number…)
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

And I have to add:

1 tona
2-4 tony
5 and more ton

BUT

1 kilogram
2-4 kilogramy
5 and more kilogramów

and for gram is similar to kilogram.

I know, Polish is very complicated language...
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Every language has its own idiosyncracies and particularities. It is to be expected that no rules for specific languages can be applied in the game logic (unless you go the way Ahruman proposed, which is something that will take its time to reach full implementation status), simply because there are so many different languages and doing so would make Oolite a study in linguistics, not a game.

The important (and most difficult, probably) thing in building a localization OXP is to try to fit the language you are working on to the very simple rules and phrase structure of the English language on which the game was originally built. Sometimes it can become a Herculean task. You will know what I mean when you try to translate the planet descriptions. But it can be done, or at least it can be done to an acceptable degree with most languages. Just don't expect it to be a walk in the park. Some "funny" translated phrases would be unavoidable, but then again, "edible arts graduate" is a funny original phrase.
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Ekhm, I have one question...
In system_description, under [14] a find few words like "%H","The planet %H", "The world %H", "This planet", "This world". In Polish "the planet", and "this planet" are female word group, and "world" and "this world" are masculine. Due this difference, I have to divide [14] into two groups: masculine and female word groups. But is one hurdle: "system-description-string". Here is only one combination [14] is [22]. I want know, is possible to make two "system-description-strings": [14] is [22] and [36] (in this array I want to put only masculine word groups) is [22]. Something like this:

Code: Select all


[14]
"%H",
"Planeta %H",
"Ta planeta",
"",
""
.
.
.
***[36]***
		
"Świat %H",
"Ten świat",
"",
"",
""
and

Code: Select all

"system-description-string"		= "[14] jest [22].";
"system-description-string"		= "[36] jest [22].";
is this possible?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Yes it is. You need to set it up as an array, like this:

Code: Select all

"system-description-string" 	= ("[14] jest [22].",
			                         "[36] jest [22]",
			                        );
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Thanks, it works! Translation Oolite in progress :)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

It occurs to me that it would be a lot easier to write the system description things if there was a tool to write them using named references instead of numbers. I’ll see about hacking something up…
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Other questions. Is it possible, to make an array with more/fewer than 5 elements ?
How can I switch between upper/lower case? In Polish adjectives for planets' names are lower case:
Laveian - > lavejański
Disoian - > disojański

but here is so:

Code: Select all

// Assorted messages sent out by ships etc..
	/*	%H - homeworld
			%I - homeworld+ian

Is it possible to make a switch, maybe something like this:

Code: Select all

// Assorted messages sent out by ships etc..
	/*	%H - homeworld
			%I - homeworld (lower case)+jański

?

I'm sorry for so much questions, but I want to make my job perfectly...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

OSH wrote:
Other questions. Is it possible, to make an array with more/fewer than 5 elements ?
No. The current code requires exactly five elements per array, which are selected in a way finely tuned to match original Elite behaviour.

This could probably be made more flexible in future versions, but until then you’re stuck with five values, or 1 + 4n values if you split it into n arrays. (However, doing that would result in a different random number sequence, so the rest of the description could not be made to match the English one.)
Is it possible to make a switch, maybe something like this:
At the moment, no.
Post Reply