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

Configurable instructions language #94

Closed
wants to merge 1 commit into from

Conversation

doflip
Copy link

@doflip doflip commented Nov 11, 2015

Usage example:
L.mapbox.directions({language: 'pt'});

The default remains english language.

m = m.replace(/Turn left/g, "Vire à esquerda");
m = m.replace(/\bContinue/g, "Continue");
m = m.replace(/You have arrived at your destination/g, "Chegou ao seu destino");
/*

Choose a reason for hiding this comment

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

This debug code should be removed.

Copy link
Author

Choose a reason for hiding this comment

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

yes, and I still need to add a couple of instructions, but is this the way to do it?

Usage example:
L.mapbox.directions({language: 'pt'});

The default remains english language.
@freenerd
Copy link

@doflip thanks for the PR

@tmcw how do you feel about this? do you think instead of search/replacing the individual values, we could already here get https://www.transifex.com/ to work? this would down the line make it easier to migrate the changes from mapbox-directions.js to the mapbox directions API (where this eventually should live). Since @doflip likely doesn't want to wait until we get our shit together on the API I'm happy to have this in mapbox-directions.js for a while ...

@tmcw
Copy link
Contributor

tmcw commented Nov 12, 2015

I think we should land this in the directions API first, rather than it hanging out in the mapbox-directions.js codebase intermediately. Free to use this PR as a fork in the meantime, but we should expedite doing this the right way, on the server side.

@tmcw
Copy link
Contributor

tmcw commented Oct 17, 2016

Closing this PR, but keeping the branch alive if someone wants to start from it to do client-side translations for the time being: the server-side approach is the plan.

@tmcw tmcw closed this Oct 17, 2016
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.

4 participants