Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Multilingual Oolite

General discussion for players of Oolite.

Moderators: winston, another_commander

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 »

https://bb.oolite.space/viewtopic.php?t= ... c&start=75
OSH wrote:
Ok. I can volunteer make a Polish version of OOlite. But i I'm not a programmer, only translator...
Thanks!

Translating Oolite doesn’t really involve programming; it’s mostly filling in lists of sentences and words with little placeholders in.

I’ve put together a starter kit for Polish here. It’s a simple OXP containing the following files:
  • requires.plist specifies that it’s for Oolite 1.72 and later. (Some of the strings changed between 1.71 and 1.72.)
  • oolite-font.plist and oolite-font-l2.png switch Oolite to the ISO-Latin-2 character set, so you have letters like Ł and Ż.
  • descriptions.plist contains most of the text that needs translating. Much of it consists of key-value pairs, like "energy-bomb-activated" = ( "Energy bomb triggered." ). Here, the key ("energy-bomb-activated") should not be translated, only the value. (Many of the values are lists, where each item should be translated.) Some of the values contain placeholders like %@ or %f; these must be kept in the same order.
  • missiontext.plist contains additional text.
  • equipment.plist contains the definitions of equipment items. The third item in each definition is a name and the fifth is a description; these need to be translated.
  • hud.plist and hud-small.plist contain some text, like “SPD” and “ROLL”. It may be a bit tricky to find it all, but of course you’ve got it all at the bottom of the screen when you play.
  • shipdata-overrides.plist contains names for ships.
One file that should not be translated is commodities.plist; the names in that are translated through descriptions.plist.

The most difficult part is building the system description grammar (system_description in descriptions.plist). Building grammatically correct sentences by gluing words together is hard, and making them match the original English descriptions is harder. As mentioned upstream you can get Oolite to spit out a graph of the grammar, like this or this. Under Mac OS X, use the following terminal command when Oolite is not running:

Code: Select all

defaults write org.aegidian.oolite universe-dump-debug-graphviz -bool true
Under Windows or Linux, you need to manually edit the GNUStep defaults file. Under Linux, it lives (by default) at ~/GNUstep/Defaults/.GNUstepDefaults; for Windows, <installation dir>/oolite.app/GNUstep/Defaults/.GNUstepDefaults. You need to find this line:

Code: Select all

oolite = {
and add the following line after it:

Code: Select all

"universe-dump-debug-graphviz" = YES;
This results in a file named SystemDescription.dot being written to the Logs folder. Except I now see this only happens under OS X, due to a minor oversight; this will be fixed in the next release. Currently it will use ~/.Oolite/Diagnostics/ under Linux, and I’m not sure about Windows.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6571
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

The location for the SystemDescription.dot under Windows is <installation dir>\oolite.app\.Oolite\Diagnostics.
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 »

Forgot to mention – to convert the dot file to something viewable, you’ll need graphviz. Also, this new shipdata-overrides.plist with just names in is useful for translation to any language.
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Big thanks Ahruman. I hope, Polish version of Oolite will be soon ready...
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 »

Ahruman wrote:
Some of the values contain placeholders like %@ or %f; these must be kept in the same order.
A clarification on this: the placeholders in question are %@, or % followed by a lowercase letter (like %u), or % followed by a number and then a lowercase letter (like %02d or %.0f).

% followed by a capital H, I or R is an Oolite-specific function which can be safely rearranged, added or moved: %H is the system name, %I is %H followed by “ian” (or rather, the value of planetname-derivative-suffix from descriptions.plist, and %R is a random name like “Ab’eri”. (There’s also a %X, which is like %R but provides a greater range of random names. However, I just realised that’s a terrible choice for technical reasons, and it’ll be changing to %N in future releases. It isn’t used in descriptions.plist anyway.)

A backslash (\) is used to encode “special” characters: \t means a tab, \n a new line, " a quotation mark ("), and \\ a backslash.
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Hmm. I've installed Polish starter kit, launch Oolite and saw this:
Image

Why is this font so S E P A R A T E D ?

And anything else: I can't use typical polish signs like ł or ż. When I replace ROLL with OBRÓT I see blank field...
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 »

OK, the expanded-text issue is a simple fix: the width tables were off by a factor of two because I forgot to adjust for scale when I changed the tool to create higher-resolution textures. A fixed oolite-font.plist for Latin-2 is here.

The other issue is a bigger problem. It suggests that GNUstep may not support Windows-Latin-2 encoding.
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 »

Just for verification, please try replacing ROLL with just Ó, and Oolite on the title screen with Ółite (in theme-music-credit).
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:
Just for verification, please try replacing ROLL with just Ó, and Oolite on the title screen with Ółite (in theme-music-credit).
When I make these changes in Polish-starter-kit.oxp, replacing ROLL with ÓÓÓÓ brings blank field...but I can't replace "Oolite" with "Ółite", because this has no effect (all texts on main screen are unchanged). And when I write this string into main "description.plist" in the main OOlite.app/config, game doesn't start.
I see, hud.plist ist UTF-encoded. Maybe this causes this issue?
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 »

Yes, all the files must be in UTF-8. (Actually, that’s not strictly true for the XML format, but those should be in UTF-8.)
Last edited by JensAyton on Sat Dec 06, 2008 6:29 pm, edited 1 time in total.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6571
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

I have just checked the functionality of the Latin-2, Cyrillic and Greek oxp sets and confirm that they all work fine under GNUstep (once the width fix has been applied, that is). Haven't tried the Turkish set, but I have no reason to believe that it will give problems. OSH, can you please post your hud.plist that has problems displaying ROLL in Polish?
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Of course, here is hud.plist:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>dials</key><!-- these are drawn, in order, after the legends -->
	<array>
		<dict><!-- Targetting enhancement -->
			<key>equipment_required</key>
			<string>EQ_SCANNER_SHOW_MISSILE_TARGET</string>
			<key>selector</key>
			<string>drawTargetReticle:</string>
		</dict>
		<dict><!-- scanner -->
			<key>alpha</key>
			<real>0.75</real>
			<key>selector</key>
			<string>drawScanner:</string>
			<key>x</key>
			<integer>0</integer>
			<key>y</key>
			<integer>-180</integer>
			<key>height</key>
			<real>72</real>
			<key>width</key>
			<real>288</real>
			<key>rgb_color</key>
			<array>
				<real>1.0</real>
				<real>0</real>
				<real>0</real>
			</array>
		</dict>
		<dict><!-- scanner zoom indicator -->
			<key>alpha</key>
			<real>1</real>
			<key>selector</key>
			<string>drawScannerZoomIndicator:</string>
			<key>x</key>
			<integer>108</integer>
			<key>y</key>
			<integer>-216</integer>
		</dict>
		<dict><!-- compass -->
			<key>alpha</key>
			<real>1</real>
			<key>selector</key>
			<string>drawCompass:</string>
			<key>x</key>
			<integer>132</integer>
			<key>y</key>
			<integer>-216</integer>
		</dict>
		<dict><!-- station aegis -->
			<key>alpha</key>
			<real>1</real>
			<key>selector</key>
			<string>drawAegis:</string>
			<key>x</key>
			<integer>-132</integer>
			<key>y</key>
			<integer>-216</integer>
		</dict>
		<dict><!-- fuel scoop status -->
			<key>alpha</key>
			<real>0.75</real>
			<key>selector</key>
			<string>drawScoopStatus:</string>
			<key>x</key>
			<integer>-132</integer>
			<key>y</key>
			<integer>-152</integer>
		</dict>
		<dict><!-- speed bar, can draw a surround 2 units out from the dial size specified -->
			<key>draw_surround</key>
			<true/>
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawSpeedBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>200</integer>
			<key>y</key>
			<integer>-145</integer>
		</dict>
		<dict><!-- roll bar, can draw a surround 2 units out from the dial size specified -->
			<key>draw_surround</key>
			<true/>
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawRollBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>200</integer>
			<key>y</key>
			<integer>-160</integer>
		</dict>
		<dict><!-- pitch bar, can draw a surround 2 units out from the dial size specified -->
			<key>draw_surround</key>
			<true/>
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawPitchBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>200</integer>
			<key>y</key>
			<integer>-170</integer>
		</dict>
		<dict><!-- energy guage, can draw a surround 2 units out from the dial size specified -->
			<key>draw_surround</key>
			<true/>
			<key>height</key>
			<integer>48</integer>
			<key>selector</key>
			<string>drawEnergyGauge:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>200</integer>
			<key>y</key>
			<integer>-205</integer>
			<key>labelled</key>
			<true/>
		</dict>
		<dict><!-- forward shield bar, can draw a surround 2 units out from the dial size specified -->
			<key>draw_surround</key>
			<true/>
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawForwardShieldBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>-200</integer>
			<key>y</key>
			<integer>-146</integer>
		</dict>
		<dict><!-- aft shield bar, can draw a surround 2 units out from the dial size specified -->
			<key>draw_surround</key>
			<true/>
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawAftShieldBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>-200</integer>
			<key>y</key>
			<integer>-162</integer>
		</dict>
		<dict><!-- just draws a surround 2 units around the selected size, you could also use drawGreenSurround: -->
			<key>height</key>
			<integer>40</integer>
			<key>selector</key>
			<string>drawYellowSurround:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>-200</integer>
			<key>y</key>
			<integer>-194</integer>
		</dict>
		<dict><!-- fuel bar -->
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawFuelBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>-200</integer>
			<key>y</key>
			<integer>-179</integer>
		</dict>
		<dict><!-- cabin temperature bar -->
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawCabinTempBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>-200</integer>
			<key>y</key>
			<integer>-189</integer>
		</dict>
		<dict><!-- weapon temperature bar -->
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawWeaponTempBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>-200</integer>
			<key>y</key>
			<integer>-199</integer>
		</dict>
		<dict><!-- altitude bar -->
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawAltitudeBar:</string>
			<key>width</key>
			<integer>80</integer>
			<key>x</key>
			<integer>-200</integer>
			<key>y</key>
			<integer>-209</integer>
		</dict>
		<dict><!-- missile display, x and y give the location, the x-spacing is given by spacing, the size defines the icon size -->
			<key>height</key>
			<integer>12</integer>
			<key>selector</key>
			<string>drawMissileDisplay:</string>
			<key>spacing</key>
			<integer>16</integer>
			<key>width</key>
			<integer>12</integer>
			<key>x</key>
			<integer>-228</integer>
			<key>y</key>
			<integer>-224</integer>
		</dict>
		<dict><!-- status indicator light, x and y give the location, the size defines the icon size -->
			<key>height</key>
			<integer>8</integer>
			<key>selector</key>
			<string>drawStatusLight:</string>
			<key>width</key>
			<integer>8</integer>
			<key>x</key>
			<integer>-108</integer>
			<key>y</key>
			<integer>-216</integer>
		</dict>
		<dict><!-- ship's clock, x and y give the location, the size defines the character size -->
			<key>height</key>
			<integer>12</integer>
			<key>selector</key>
			<string>drawClock:</string>
			<key>width</key>
			<integer>12</integer>
			<key>x</key>
			<integer>-48</integer>
			<key>y</key>
			<integer>-234</integer>
		</dict>
		<dict><!-- fps counter, x and y give the location, the size defines the character size -->
			<key>height</key>
			<integer>18</integer>
			<key>selector</key>
			<string>drawFPSInfoCounter:</string>
			<key>width</key>
			<integer>18</integer>
			<key>x</key>
			<integer>-300</integer>
			<key>y</key>
			<integer>220</integer>
		</dict>
	</array>
	<key>legends</key><!-- these are drawn, in order, before the dials, add any other images you want here -->
	<array>
		<!-- LHS -->
		<dict>
			<key>text</key>
			<string>FWD</string>
			<key>x</key>
			<integer>-264</integer>
			<key>y</key>
			<string>-158</string>
			<key>height</key>
			<integer>20</integer>
			<key>width</key>
			<integer>10</integer>
		</dict>
		<dict>
			<key>text</key>
			<string>AFT</string>
			<key>x</key>
			<integer>-262</integer>
			<key>y</key>
			<string>-174</string>
			<key>height</key>
			<integer>20</integer>
			<key>width</key>
			<integer>10</integer>
		</dict>
		<dict>
			<key>text</key>
			<string>FUEL</string>
			<key>x</key>
			<integer>-264</integer>
			<key>y</key>
			<string>-188</string>
			<key>height</key>
			<integer>14</integer>
			<key>width</key>
			<integer>9</integer>
		</dict>
		<dict>
			<key>text</key>
			<string>CT</string>
			<key>x</key>
			<integer>-255</integer>
			<key>y</key>
			<string>-198</string>
			<key>height</key>
			<integer>14</integer>
			<key>width</key>
			<integer>9</integer>
		</dict>
		<dict>
			<key>text</key>
			<string>LT</string>
			<key>x</key>
			<integer>-254</integer>
			<key>y</key>
			<string>-208</string>
			<key>height</key>
			<integer>14</integer>
			<key>width</key>
			<integer>9</integer>
		</dict>
		<dict>
			<key>text</key>
			<string>ALT</string>
			<key>x</key>
			<integer>-260</integer>
			<key>y</key>
			<string>-218</string>
			<key>height</key>
			<integer>14</integer>
			<key>width</key>
			<integer>9</integer>
		</dict>
		<dict>
			<key>text</key>
			<string>MISS</string>
			<key>x</key>
			<integer>-266</integer>
			<key>y</key>
			<string>-236</string>
			<key>height</key>
			<integer>16</integer>
			<key>width</key>
			<integer>10</integer>
		</dict>
		<!-- RHS -->
		<dict>
			<key>text</key>
			<string>SPD</string>
			<key>x</key>
			<integer>241</integer>
			<key>y</key>
			<string>-158</string>
			<key>height</key>
			<integer>20</integer>
			<key>width</key>
			<integer>10</integer>
		</dict>
		<dict>
			<key>text</key>
			<string>ÓÓÓÓ</string>
			<key>x</key>
			<integer>241</integer>
			<key>y</key>
			<string>-168</string>
			<key>height</key>
			<integer>12</integer>
			<key>width</key>
			<integer>9</integer>
		</dict>
		<dict>
			<key>text</key>
			<string>PITCH</string>
			<key>x</key>
			<integer>241</integer>
			<key>y</key>
			<string>-178</string>
			<key>height</key>
			<integer>12</integer>
			<key>width</key>
			<integer>9</integer>
		</dict>
	</array>
	<key>reticle_target_sensitive</key>
	<false/>
</dict>
</plist>
EDIT:
It works! I've saved this file by mistake in ANSI-codepage. When I set to UTF-8 óóóó is visible :) Thanks for support, but I'm sure, I will have new questions :)
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Something is wrong...When I change title credits by editing file description.plist, nothing is changed. When I change this credits in the main descriptions.plist file in the directory OOlite\oolite.app\config, the gam doesn't start. What's up ? :shock:
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:
Something is wrong...When I change title credits by editing file description.plist, nothing is changed. When I change this credits in the main descriptions.plist file in the directory OOlite\oolite.app\config, the gam doesn't start. What's up ? :shock:
You’ve broken the file, possibly by using data in an encoding other than UTF-8 (making the file as a whole invalid UTF-8). This should be reflected in the log.
User avatar
OSH
Dangerous
Dangerous
Posts: 124
Joined: Thu Dec 04, 2008 2:57 pm
Location: Poland, Lave Station :)
Contact:

Post by OSH »

Which editor is suitable for editing .plist files? I've opened it with notepad...but even saving (without any changes) causes, the game doesn't start...
Post Reply