Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select translation?
#1
Hi,

I installed Colobot on OSX using these instructions:
https://github.com/colobot/colobot/blob/...-MacOSX.md

I found out that I can load the Polish translation using terminal:


Code:
/Applications/Colobot.app/Contents/MacOS/colobot --language=pl

How do I set it up permanently, so that Polish translation is loaded when I double–click `Colobot.app`?
#2
I think we should really consider adding a language switch to the game itself. Anyway!

To make the .app file launch the game with parameters, you will need to modify the contents of it. A short introduction for others: .app files (called "Package bundles") are essentially just special folders and not executables per se; the actual executable file is located in the Contents/MacOS/ directory (which can be concluded from the aforementioned terminal command). This file is referenced in the Contents/Info.plist file, so that the system knows what should be launched when the .app file is opened. And that's what we need to change.

First of all, create a file in Colobot.app/Contents/MacOS, make it executable and open it.
Code:
touch /Applications/Colobot.app/Contents/MacOS/colobot-pl.sh
chmod +x /Applications/Colobot.app/Contents/MacOS/colobot-pl.sh
open /Applications/Colobot.app/Contents/MacOS/colobot-pl.sh
A file editor should open. Paste the following lines to it:
Code:
#!/usr/bin/env bash
exec /Applications/Colobot.app/Contents/MacOS/colobot --language=pl

(you can also download the file from here: https://www.dropbox.com/s/uz29xpc7l4uon7...pl.sh?dl=0 and just put it in appropriate folder in the .app (via the GUI: open your Applications folder in the Finder, right click on the Colobot.app file and choose "Show package contents" ("Pokaż zawartość pakietu")), but remember to chmod it in that case!)

Save and close. Now we need to tell the system that it should execute our just created .sh file upon double-clicking the .app file (instead of the main game executable). Since we're already in the terminal, we can use the following command.
Code:
open /Applications/Colobot.app/Contents/Info.plist
Find the following lines:
Code:
<key>CFBundleExecutable</key>
    <string>colobot</string>
And change the "colobot" string to "colobot-pl.sh" (or whatever filename you've settled for). Save and close the file.

(And if you're feeling really lazy, download the Info.plist file from here: https://www.dropbox.com/s/ukhzfj0yyjgqog...plist?dl=0)

Everything done, right? Not really. If you open the game, it will still load the English descriptions. This is because the system (the Launch Services, to be exact) doesn't know that the Info.plist file has changed. We can use some terminal commands to clear the database, but the easiest way is to move the Colobot.app to another folder and back to /Applications/. Et voilà!
Unfortunately, you will need to go through these steps whenever you update the game.
[Image: 76561198011930439.png]
"But there's no sense crying over every mistake, you just keep on trying 'till you ran out of cake" - GLaDOS
#3
Or just add this to the colobot.ini configuration file:
Code:
[Language]
Lang=pl

This should be auto-detected to your system language, that's why there is still no official option in the menu to change it. I'll make sure it's finally included in the next release.
#4
(09-19-2015, 03:51 PM)krzys_h Wrote: Or just add this to the colobot.ini configuration file:
Code:
[Language]
Lang=pl

The thing is this file can't be easily reached by the user in OS X (starting with OS X 10.7 Lion). It is located in ~/Library, which, by default, is hidden. To get to it, you either need to open the Finder and Press Cmd+Shift+G (or choose Go -> Go To Folder... (Idź -> Idź do katalogu...) from the top menu), type "~/Library" there and press Enter. Only then can you navigate to the "Application Support" and find the "colobot" folder there (along with the .ini file).

If you are using Mavericks or Yosemite (or El Capitan, generally anything 10.9+), you can also choose to simply show this folder in Finder. To do this, open you user folder and from the top menu choose View -> Show View Options (Widok -> Pokaż opcje widoku; or press Cmd+J). Check the "Show Library Folder" ("Pokaż katalog Biblioteki") option (it can be found at the bottom of the window).
[Image: 76561198011930439.png]
"But there's no sense crying over every mistake, you just keep on trying 'till you ran out of cake" - GLaDOS
#5
(09-19-2015, 03:22 PM)Schocker Wrote: Et voilà!
It works, thanks!

(09-19-2015, 03:51 PM)krzys_h Wrote: add this to the colobot.ini configuration file
I couldn't find the file in the `colobot.app` so I changed it in the source files and compiled again. Didn't help. For the test I used French translation this time:

Code:
$ cat colobot/desktop/colobot.ini 
Name="Colobot"
GenericName="Game to learn programming"
Comment="Colonize with bots"

[Language]
Lang=fr

--- Edit ---
Quote:It is located in ~/Library
Ha, didn't know it's there Wink
--- /Edit ---

(09-19-2015, 03:51 PM)krzys_h Wrote: This should be auto-detected to your system language
It might be, but my OS is in English, while I want the game in Polish (for the kids).

(09-19-2015, 03:51 PM)krzys_h Wrote: no official option in the menu to change it
That would be cool, I've tried google'ing it, look in the manual and finally found that as a console command. Which is bad for people have who never touched terminal in their lives ;-)
#6
(09-19-2015, 07:17 PM)Daveet Wrote:
Quote:It is located in ~/Library

Ha, didn't know it's there Wink

Neither did I! I actually had to look through all possible locations and finally reminded myself about the ~/Library directory. Wink

(09-19-2015, 07:17 PM)Daveet Wrote:
(09-19-2015, 03:51 PM)krzys_h Wrote: This should be auto-detected to your system language
It might be, but my OS is in English, while I want the game in Polish (for the kids).
What is more, the auto-detect on my MacBook (OS X in Polish) mixes up English and Polish. http://screencast.com/t/OxITv62p
UI elements are in Polish, SatCom and all descriptions are in English. Happened to me as well on Windows when installing the game on school's computer. Maybe I should report an issue on that...

(09-19-2015, 07:17 PM)Daveet Wrote:
(09-19-2015, 03:51 PM)krzys_h Wrote: no official option in the menu to change it
That would be cool, I've tried google'ing it, look in the manual and finally found that as a console command. Which is bad for people have who never touched terminal in their lives ;-)
That option is a must. And I think we could benefit from some kind of FAQ or readme for end users or .ini documention or... something like that. Someone who downloads the game for the first time can only wonder how to change the language (I have always changed the language using the parameter) or where are the saves located. We used to have the FAQ page on wiki, but we've abandoned that project, IIRC.
[Image: 76561198011930439.png]
"But there's no sense crying over every mistake, you just keep on trying 'till you ran out of cake" - GLaDOS
#7
(09-19-2015, 07:46 PM)Schocker Wrote:
(09-19-2015, 07:17 PM)Daveet Wrote:
(09-19-2015, 03:51 PM)krzys_h Wrote: This should be auto-detected to your system language
It might be, but my OS is in English, while I want the game in Polish (for the kids).
What is more, the auto-detect on my MacBook (OS X in Polish) mixes up English and Polish. http://screencast.com/t/OxITv62p
UI elements are in Polish, SatCom and all descriptions are in English. Happened to me as well on Windows when installing the game on school's computer. Maybe I should report an issue on that...
That's really strange. I could understand if it was doing the reverse (not loading the gettext UI translations for selected game language), but this behaviour is really not something I would expect.


Forum Jump:


Users browsing this thread: 2 Guest(s)