Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: language portion  (Read 653 times)

gaston

  • Escaped Lunatic
    • View Profile
language portion
« on: January 16, 2008, 04:08:00 pm »

Hi,
i recently read here about dwarf fortress. It's an interesting game.
But i wonder if it is possible to port this game in an other language, or edit the *.ini files.
Does someone know where the ingamenames (like masonry or tanner) are saved?

It would realy help me if the names are in german, becaus the terminology in this game isn't quit easy.

[ January 16, 2008: Message edited by: gaston ]

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: language portion
« Reply #1 on: January 16, 2008, 05:00:00 pm »

Almost everything is still stuck in the executable.  If you can find equivalents that are the same length, I think changing the entries in the exe would work (you can probably do it in wordpad or something like that).  Getting the text out of the exe is something I'd like to do, but it's a large project.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Torak

  • Bay Watcher
  • God of Gods of Blood.
    • View Profile
Re: language portion
« Reply #2 on: January 16, 2008, 06:04:00 pm »

It's entirely possible, but it would take quite a long time, because you'd have to replace all the events, race languages, item names, help page language, interface language.


It's no small project.

Logged
As you journey to the center of the world, feel free to read the death announcements of those dwarves that suffer your neglect.

One billion b-balls dribbling simultaneously throughout the galaxy. One trillion b-balls being slam dunked through a hoop throughout the cosmos. I can feel every single b-ball that has ever existed at my fingertips, I can feel their collective knowledge channeling through my veins. Every jumpshot, every rebound and three-pointer, every layup, dunk and free throw.

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: language portion
« Reply #3 on: January 17, 2008, 03:26:00 pm »

Strings even longer than the english ones can be done with some extra .EXE manipulation.  You add some extra memory to the .EXE, plop the string in, and change all the references to point to the new string.  It's not a project for the faint of heart, though.  Also it would need to be redone for every new version.  (It might be automatable through some Perl scripting.)

The main issue I had when I did localization of a program (to Japanese) (and I had the source code) is differing order of words in the language's sentences.  That can really mess things up.  And as DF appears to build its strings using the C++ string operations, it's really hard to hack on.

Logged

Zurai

  • Bay Watcher
    • View Profile
Re: language portion
« Reply #4 on: January 17, 2008, 04:19:00 pm »

Localization is a royal bitch. When I was doing my student final project, one of the things we looked at doing was localizing the game. We discarded that when we realized that localization would add a week to our development time - for a game that only took 6 people 2 months to program. Admittedly, we did use XML extensively, and would have had to provide localization support there as well, but we still had less text, less game, and more manpower than Toady does.
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: language portion
« Reply #5 on: January 17, 2008, 05:37:00 pm »

I'm very fond of C#'s strings for localization purposes!  Instead of '%s' to denote a string, it's {0} for the first argument, {1} for the second, etc, with whatever other formatting stuff embedded in the {}s.  Pretty nice for rearranging your format string without changing the code.  I wonder if there's something similar for C++?

Gender is a big problem for localization too, though.  Some languages don't have he/she.  Some languages have he/she for objects, instead of 'it', and the masculine/feminine definition of each object is different by language.  Niftily though, that data could quite easily go in the raws...

But one way or another, this is a HUGE nightmare to change to.  And what's more, it unhides a lot of the 'hidden fun stuff' in the game, since everything has to be in a raw text format.

[ January 17, 2008: Message edited by: Sowelu ]

Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: language portion
« Reply #6 on: January 17, 2008, 09:23:00 pm »

quote:
Originally posted by Sowelu:
<STRONG>I'm very fond of C#'s strings for localization purposes!  Instead of '%s' to denote a string, it's {0} for the first argument, {1} for the second, etc, with whatever other formatting stuff embedded in the {}s.  Pretty nice for rearranging your format string without changing the code.  I wonder if there's something similar for C++?</STRONG>

Not in the language specification or default libraries, I don't believe.

You can roll your own printf() engine, or put a wrapper around it.  I did the wrapper method once when I needed longlong support in an old DOS C that only natively supported longs.

Logged

sphr

  • Bay Watcher
    • View Profile
Re: language portion
« Reply #7 on: January 17, 2008, 09:39:00 pm »

quote:
Originally posted by 0x517A5D:
<STRONG>

Not in the language specification or default libraries, I don't believe.

You can roll your own printf() engine, or put a wrapper around it.  I did the wrapper method once when I needed longlong support in an old DOS C that only natively supported longs.</STRONG>



printf does have some pain with the non-type checking part  :)

If one is looking for a more complete and robust solution dependent on just ansi c/c++, boost::format with boost::lexical_cast seems to be a more extensible soution.  boost format supports the posix standards too, for ordering terms.

here's link to some examples.

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: language portion
« Reply #8 on: January 18, 2008, 02:07:00 am »

quote:
Originally posted by sphr:
<STRONG>If one is looking for a more complete and robust solution dependent on just ansi c/c++, boost::format with boost::lexical_cast seems to be a more extensible soution.  boost format supports the posix standards too, for ordering terms. </STRONG>

Looks interesting.  I like that you can convert your format strings piece-by-piece.

I see GAWK-style %3$d positional rearrangement -- is that in Posix now?  I totally did not know that.

Logged