The International Simutrans Forum

Community => Simutrans Help Center => Topic started by: Lmallet on July 27, 2010, 05:58:22 PM

Title: Station name generation
Post by: Lmallet on July 27, 2010, 05:58:22 PM
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.

Title: Re: Station name generation
Post by: Zeno on July 27, 2010, 06:11:14 PM
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.
Title: Re: Station name generation
Post by: Dwachs on July 27, 2010, 06:14:47 PM
Quote from: Lmallet on July 27, 2010, 05:58:22 PM
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
Title: Re: Station name generation
Post by: Lmallet on July 27, 2010, 06:53:38 PM
Quote from: Zeno on July 27, 2010, 06:11:14 PM
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).

Quote from: Dwachs on July 27, 2010, 06:14:47 PM
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.
Title: Re: Station name generation
Post by: gauthier on July 27, 2010, 07:16:56 PM
I completely support this idea, plus : is it possible to self create the pieces of stations names ? Current pieces are really ... boring, always the same ... :/
Title: Re: Station name generation
Post by: Lmallet on July 27, 2010, 07:53:42 PM
Quote from: gauthier on July 27, 2010, 07:16:56 PM
...plus : is it possible to self create the pieces of stations names ? Current pieces are really ... boring, always the same ... :/
That was discussed here:
http://forum.simutrans.com/index.php?topic=4587.0
Title: Re: Station name generation
Post by: gauthier on July 27, 2010, 09:53:34 PM
ok
Title: Re: Station name generation
Post by: IgorEliezer on July 28, 2010, 04:02:02 AM
Quote from: Lmallet on July 27, 2010, 05:58:22 PM
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. :/
Title: Re: Station name generation
Post by: VS on July 28, 2010, 11:33:34 AM
Well, in short, we need a sprintf() alternative which would support arbitrary ordering of parameters...
Title: Re: Station name generation
Post by: prissi on July 28, 2010, 11:36:52 AM
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.
Title: Re: Station name generation
Post by: skreyola on July 28, 2010, 06:24:35 PM
Or perhaps break up the print function into two (2 strings), so the pieces are handled separately?
Something like:

  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?
Title: Re: Station name generation
Post by: prissi on July 28, 2010, 07:01:25 PM
I would rather like the modified prinft syntax where %$2s %$2s (or something like that) gives the reverse order.
Title: Re: Station name generation
Post by: gauthier on July 28, 2010, 07:27:34 PM
why not simple invert the content of the two strings ?
Title: Re: Station name generation
Post by: prissi on July 28, 2010, 07:44:54 PM
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.
Title: Re: Station name generation
Post by: gauthier on July 31, 2010, 08:58:51 PM
QuoteBecause there might be situations, where sometime one and sometime the other order is required.

Of course, invert IF the language used needs ;)