X Tutup
The Wayback Machine - https://web.archive.org/web/20221221123651/https://github.com/flutter/flutter/issues/100110
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

Go Router: Multi language support #100110

Open
adnanjpg opened this issue Mar 15, 2022 · 5 comments
Open

Go Router: Multi language support #100110

adnanjpg opened this issue Mar 15, 2022 · 5 comments
Labels
a: internationalization Supporting other languages or locales. (aka i18n) new feature Nothing broken; request for a new capability. p: first party Plugins developed by the Flutter team. p: go_router The go_router package P5 Priority 5 issue (default for new feature requests; things we'd like to work on) package flutter/packages repository. See also p: labels.

Comments

@adnanjpg
Copy link

adnanjpg commented Mar 15, 2022

This is a feature request.

This issue is For the go_router package

In my App, I want to have multi-language support, as well as for the routes.
for example:
myapp.com/post/12 -> should redirect to the post with the id 12, with setting the app language to English
myapp.com/gonderi/12 -> should redirect to the post with the id 12, with setting the app language to Turkish

The syntax could be something like:

GoRoute(
  paths: {
    'en': 'post',
    'tr': 'gonderi',
  },

and in the GoRouterState, the route that redirected would be saved as a MapEntry. so the language key would be reachable using state.path.key, and the route name state.path.value.

this functionality obviously can be reachable by duplicating the routes, however, when you start considering even 2 languages, this gives you 2x the code, which is very hard to maintain.

@danagbemava-nc danagbemava-nc added in triage Presently being triaged by the triage team. new feature Nothing broken; request for a new capability. a: internationalization Supporting other languages or locales. (aka i18n) p: first party Plugins developed by the Flutter team. package flutter/packages repository. See also p: labels. p: go_router The go_router package and removed in triage Presently being triaged by the triage team. labels Mar 15, 2022
@stuartmorgan stuartmorgan added the P5 Priority 5 issue (default for new feature requests; things we'd like to work on) label Mar 15, 2022
@chunhtai
Copy link
Contributor

chunhtai commented Apr 14, 2022

localizing url is not something we are planning to support right now.

@adnanjpg
Copy link
Author

adnanjpg commented Apr 24, 2022

Hi @chunhtai , can you add more details for this decision?

@chunhtai
Copy link
Contributor

chunhtai commented Apr 25, 2022

Is this a common feature for routing framework? I originally thought this is not something people would do, I can reopen this bug otherwise.

@adnanjpg
Copy link
Author

adnanjpg commented Apr 25, 2022

when you think about building a multi language web app with flutter, I think this would be a great feature

@chunhtai chunhtai reopened this Apr 25, 2022
@chunhtai
Copy link
Contributor

chunhtai commented Apr 25, 2022

reopening for discussion.

When people talk about multi language web app, they are usually talking about UI, not the url. The localize url for non-latin language like Chinese might actually makes it less accessible. alternatively if developer really wants to do that, we can provide API to add alias for the same GoRoute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: internationalization Supporting other languages or locales. (aka i18n) new feature Nothing broken; request for a new capability. p: first party Plugins developed by the Flutter team. p: go_router The go_router package P5 Priority 5 issue (default for new feature requests; things we'd like to work on) package flutter/packages repository. See also p: labels.
Projects
Status: Done
Development

No branches or pull requests

4 participants
X Tutup