helldog136 / pystibmivb

Python library to query STIB/MIVB opendata
Creative Commons Attribution 4.0 International
3 stars 2 forks source link

message and stop languages logic #10

Closed danito closed 4 years ago

danito commented 4 years ago

Hi, Stops are in fr or nl and messages can be in fr, nl or en. So if one puts stop_name = "Saint-Denis" we can assume that default language for stop_names and messages should be fr, and if it's stop_name = "Sint-Denijs" in nl. Of course, there should be a default language for stop_names and messages and we should be able to overwrite this for both settings as you can't not every time guess the language from the stop_name.

helldog136 commented 4 years ago

Yeah we could assume the user's language but i find this way more complicated than specifying the languages...

BUT it might be clearer for the users to specify two explicit arguments instead of one argument being a Tuple... I admit that I over-complicated the thing there :D

I'll change the signature of get_passages and replace the "lang" argument to lang_messages : str = 'fr', lang_stop_names : str = 'fr'

helldog136 commented 4 years ago

Or make me a PR if you want to do it? :)

danito commented 4 years ago

For the records: only OperationMonitoring/4.0/MessageByLine/ returns en text, all other messages are in fr or nl.

helldog136 commented 4 years ago

Oh that's really dumb for them... What do we do? do we implement one extra call if the message language is other than 'fr' or 'nl' ?