Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split directions engine select into modes and providers #5652

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hlfan
Copy link
Contributor

@hlfan hlfan commented Feb 11, 2025

Attempt to fix #5629.
Splits the directions engine select into a radio button group for modes and a smaller select for routing providers.

before after
before after

Includes tooltips for the mode radio button group:
image

@tomhughes
Copy link
Member

You should never edit any translation here (other than en.yml obviously) so you need to remove all those changes and let Translatewiki handle them.

@hlfan
Copy link
Contributor Author

hlfan commented Feb 11, 2025

Doesn't this mean all the translations will have to start from scratch?
Then it could take years until some translations will be back.

@tomhughes
Copy link
Member

If you want this to be considered for merging then you should remove the draft flag.

That said I'm not sure I really see the point of it - is this really just to reduce the number of translations from 9 to 6 so saving a total of 3 translations? All while introducing new "lego" to the translations though admittedly one that is probably relatively harmless.

@hlfan
Copy link
Contributor Author

hlfan commented Feb 13, 2025

The issues laid out in #5629 aren't page-breaking, but IMO changing to a split system is worth taking a look at.
Usually, only 3 translations for the modes are needed, only the non-Latin scripts need the graceful fallback.
And it's a step in the direction of #3123 if you wanna see it that way.

@hlfan hlfan marked this pull request as ready for review February 13, 2025 06:01
@AntonKhorev
Copy link
Collaborator

Why would you do lego instead of two selects for mode and provider?

@hlfan hlfan force-pushed the split-engine-modes branch from 850471e to cc458d1 Compare February 16, 2025 15:01
@hlfan hlfan changed the title Split engine translations into providers and modes Split directions engine select into modes and providers Feb 17, 2025
@hlfan hlfan force-pushed the split-engine-modes branch 3 times, most recently from 1b5ef55 to bc3abc4 Compare February 17, 2025 17:29
@hlfan hlfan requested a review from HolgerJeromin February 17, 2025 17:38
const modes = engines
.filter(engine => engine.provider === chosenEngine.provider)
.map(engine => engine.mode)
.sort((a, b) => I18n.t("javascripts.directions.modes." + a).localeCompare(I18n.t("javascripts.directions.modes." + b)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this sort?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The options of the select currently get sorted so there's a different order depending on the language.
In english it's 🚲-🚙-🚶, in german 🚙-🚲-🚶.
Would you like to specify a fixed order for all languages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many maps are specific for one transport mode.
So having a fixed sort order can be problematic (osm data is also good for foot stuff).
That being said, alphabetically is probably the most the most neutral one...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why the current code sorts them but it seems wrong to me - there's no logical reason why the order in which they are shown should depend on the language.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well then which order should they be shown in?

@hlfan hlfan force-pushed the split-engine-modes branch 3 times, most recently from 5591008 to b7d293c Compare February 20, 2025 12:40
@hlfan hlfan force-pushed the split-engine-modes branch from b7d293c to 0a0835d Compare February 21, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split the combined directions engines translations into routers and modes
4 participants