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

Make i18n URL query parameter name configurable and add support for path variable. #71

Closed
4 tasks done
jeevatkm opened this issue Jun 15, 2017 · 6 comments
Closed
4 tasks done
Assignees
Labels
aah Framework scope enhancement

Comments

@jeevatkm
Copy link
Member

jeevatkm commented Jun 15, 2017

Bringing more then one options of internationalization and localization override. Default is based on HTTP header Accept-Language. However real world usage requires overrides too.

aah framework provides override via -

  • Path Variable: i.e. /:lang/home.html, /:lang/aboutus.html, etc.
    * For e.g.: /en/home.html, /en/aboutus.html, /zh-CN/home.html, /zh-CN/aboutus.html etc.
  • Query Parameter: i.e ?lang=en, ?lang=zh-CN, etc. This is already supported, just we have to make param name configurable.

Note: Query parameter takes precedence of all.

aah.conf:

i18n {
    param_name {
        # Default value is `lang`
        path = "locale"

        # Default value is `lang`
        query = "locale"
    }
}
  • app template
  • Documentation
@jeevatkm jeevatkm added aah Framework scope enhancement labels Jun 15, 2017
@jeevatkm jeevatkm changed the title Make i18n URL query parameter name configurable. Make i18n URL query parameter name configurable and add support for path variable. Jun 15, 2017
@adelowo
Copy link
Contributor

adelowo commented Jun 16, 2017

I don't understand the second item on the checklist.. Can you explain that better ?

@jeevatkm
Copy link
Member Author

I have update the design description. Path variable value is accessible via ctx.Req.PathValue("lang").

@adelowo
Copy link
Contributor

adelowo commented Jun 16, 2017

Ok, I see you updated the config structure (from i18n.url_param_name)..

@jeevatkm
Copy link
Member Author

You no need to close #73, continue to update and push changes to the same PR.

@adelowo
Copy link
Contributor

adelowo commented Jun 17, 2017

@jeevatkm can you work on the "path variable".. I wouldn't be chanced to do much for some days. Maybe you pick up #73 from it's current state

adelowo pushed a commit to adelowo/aah that referenced this issue Jun 17, 2017
@jeevatkm
Copy link
Member Author

No issues, I will take care, Thanks.

@jeevatkm jeevatkm modified the milestone: v0.7 Milestone Jun 18, 2017
@jeevatkm jeevatkm self-assigned this Jun 19, 2017
jeevatkm added a commit to go-aah/tools that referenced this issue Jun 19, 2017
@jeevatkm jeevatkm closed this as completed Jul 8, 2017
jeevatkm added a commit to go-aah/docs that referenced this issue Jul 12, 2017
jeevatkm added a commit to go-aah/app-templates that referenced this issue Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aah Framework scope enhancement
Projects
None yet
Development

No branches or pull requests

2 participants