Skip to main content
Topic: Station name generation (Read 17863 times) previous topic - next topic

Station name generation

I was wondering if there was a way to change the way station names are generated via the text/*.tab files.

When I am playing Simutrans in French,  station names are generally created using the format "station name" + "station type".  Now, this works in English (ie. Montreal Station), but in French, you usually would have "station type" + "station name" (ie. Gare Montreal, or even better, Gare de Montreal).

Is there any way to do that?  Or is this an extension request?  I realize this could open up a whole discussion about auto-generating station names, but simply being able to reverse the order would be sufficient for now.


Re: Station name generation

Reply #1
Yes, I remember this being discussed before. You may search the denied/considered/? requests subforums...
Btw, I guess something can be changed in the language.tab file.

Re: Station name generation

Reply #2
Is there any way to do that?  Or is this an extension request?  I realize this could open up a whole discussion about auto-generating station names, but simply being able to reverse the order would be sufficient for now.
This has to be implemented first, the order of these text pieces is fixed.

See also:
http://forum.simutrans.com/index.php?topic=5340.msg53876#msg53876
Parsley, sage, rosemary, and maggikraut.

Re: Station name generation

Reply #3
Yes, I remember this being discussed before. You may search the denied/considered/? requests subforums...
I had a vague memory of it as well, but I could not remember if this exact question was asked, and I did search the forum but didn't find much (I had skipped Dwachs link thinking it was about gettext only).

This has to be implemented first, the order of these text pieces is fixed.

See also:
http://forum.simutrans.com/index.php?topic=5340.msg53876#msg53876
Thanks for that, I was suspecting that the %s had something to do with it, and that they were fixed values.




Re: Station name generation

Reply #7
I was wondering if there was a way to change the way station names are generated via the text/*.tab files.

When I am playing Simutrans in French,  station names are generally created using the format "station name" + "station type".  Now, this works in English (ie. Montreal Station), but in French, you usually would have "station type" + "station name" (ie. Gare Montreal, or even better, Gare de Montreal).

I'd support it too. For Latin languages (Portuguese, Spanish, French, Italian et all) the current syntax sounds really strange for us. :/

Re: Station name generation

Reply #8
Well, in short, we need a sprintf() alternative which would support arbitrary ordering of parameters...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: Station name generation

Reply #9
This is available with boost or C++x0. We just have to wait another five years untils it is supported on most platforms we port to. Joking aside, there are some alternative implementations of sprintf which would support reordering. But two years ago all of them were either discontinued, required boost, were stated buggy and/or prone to buffer overuns and were available only for Windows/Linux/...

Maybe it is time to repeat this investigation.

Re: Station name generation

Reply #10
Or perhaps break up the print function into two (2 strings), so the pieces are handled separately?
Something like:
Code: [Select]
  if(lang_verb_last) {
    printf("%s %s %s",stname,sttype,stloc);
  } else {
    printf("%s %s %s",sttype,stname,stloc);
  }
I know the code is not what is used in ST, but I think it demonstrates the principle. Eh?
--Skreyola
You can also help translate for your language with SimuTranslator.

Re: Station name generation

Reply #11
I would rather like the modified prinft syntax where %$2s %$2s (or something like that) gives the reverse order.


Re: Station name generation

Reply #13
Because there might be situations, where sometime one and sometime the other order is required. In Berlin we have for instance Bahnhof Berlin-Gesundbrunnen and Berlin Hauptbahnhof.