Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select translation?
#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


Messages In This Thread
Select translation? - by Daveet - 09-19-2015, 01:46 PM
RE: Select translation? - by Schocker - 09-19-2015, 03:22 PM
RE: Select translation? - by krzys_h - 09-19-2015, 03:51 PM
RE: Select translation? - by Schocker - 09-19-2015, 05:15 PM
RE: Select translation? - by Daveet - 09-19-2015, 07:17 PM
RE: Select translation? - by Schocker - 09-19-2015, 07:46 PM
RE: Select translation? - by krzys_h - 09-19-2015, 11:31 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)