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

[Suggestion] Multi-language support #140

Open
brodyFlannigan opened this issue Apr 9, 2022 · 6 comments
Open

[Suggestion] Multi-language support #140

brodyFlannigan opened this issue Apr 9, 2022 · 6 comments

Comments

@brodyFlannigan
Copy link

It would be really great if GTFS-to-HTML could generate timetables in many languages. (I.e. 1 HTML/PDF/CSV file per language)
using a combination of the translations.txt file in GTFS and some sort of translation mechanism for the static strings in the templates using a JSON file containing the strings for each language or something like that. One would probably have to create a field in timetables.txt to specify the default language for the timetable.

@brendannee
Copy link
Member

Great idea.

Do you have a GTFS file as an example which has translations.txt which supports more than one additional language?

One way to make this work would be to add a parameter to config.json locale which would be the language code to use use. If someone wanted to generate multiple versions in different languages, you could use multiple config.json files (since you might want different date formats)

Additionally, the text inserted by GTFS-to-HTML would need translations which can be done in a similar way to how we've handled it in the transit arrivals widget library: https://github.com/BlinkTagInc/transit-arrivals-widget/tree/master/locales (using .json files with all of the strings translated).

@brodyFlannigan
Copy link
Author

brodyFlannigan commented Apr 12, 2022 via email

@brendannee
Copy link
Member

When using GTFS-to-HTML with transcollines, are you using the default template or have you created a custom template?

@brodyFlannigan
Copy link
Author

brodyFlannigan commented Apr 13, 2022 via email

@brendannee
Copy link
Member

That sounds like a good test case for implementing translations. If you use a custom template, then you'd also need custom locale .json files to match all of the text used across your custom template if it differs at all from the default template.

If I work on implementing locale json files for the default template, can you provide quality French translations for it? That would be a good start in implementing multilingual support.

@brodyFlannigan
Copy link
Author

brodyFlannigan commented Apr 13, 2022 via email

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

No branches or pull requests

2 participants