-
Notifications
You must be signed in to change notification settings - Fork 2
Add locale change stuff and tests from unicore-cms #21
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
Conversation
|
Is locale negotiation being configured like here? |
springboard/views.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this could be a custom Jinja2 filter instead of a view method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only use the locale codes in view logic and leave it to the template to convert it to a display name
|
@nathanbegbie sorry, I might have started reviewing this early. Let me know if/when I should re-review |
|
@Riz he he, no worries. It doesn't actually work yet, still trying to get some tests passing. Will give you a shout when it's more better |
|
Agreed on some of this stuff needing to be custom filters or simply added to the default template context in the |
…ats. You are welcome @nathanbegbie.
…rsalcore/springboard into feature/issue-21-add-locale-change Conflicts: springboard/tests/test_language.py
|
@smn @miltontony @Riz Please review |
|
👍 once travis passes |
springboard/templates/base.jinja2
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can now be display_languages because it's a variable in the default template context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. The problem I was trying to fix was that the ordering of the languages is not defined, so the selected language is not displayed first. But my change seems to break many things /o\ . I think I'm going to see if I can sort this out in the template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can specify the ordering in the view?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, ordering would become easier if this is just a list of language codes.
|
@Rizziepit @miltontony @smn OK, this time for sure, +1? |
springboard/templates/base.jinja2
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to skip lang_code here if it's the same as language because otherwise we'd potentially get it twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's taken care of here https://github.com/universalcore/springboard/blob/feature/issue-21-add-locale-change/springboard/views.py#L55 in order to avoid duplication, but I'll put a check in the template, just to be sure
|
👍 nice work. Please land after the template change to check if the |
|
👍 hadn't seen the filtering being applied in the views. |
No description provided.