Skip to content

(WIP) Studio: Adds Language Selection Menu - #2418

Closed
talbs wants to merge 7 commits into
masterfrom
talbs/studio-languagemenu
Closed

(WIP) Studio: Adds Language Selection Menu#2418
talbs wants to merge 7 commits into
masterfrom
talbs/studio-languagemenu

Conversation

@talbs

@talbs talbs commented Feb 2, 2014

Copy link
Copy Markdown
Contributor

This works adds a language selection menu to a user's dashboard (per UI/feature request found here - https://edx-wiki.atlassian.net/wiki/pages/viewpage.action?pageId=48726317).

Status: The static assets and styles have been added, but JavaScript to manage the status/editing states as well as submit the form and save the user setting are still needed.

@talbs

talbs commented Feb 2, 2014

Copy link
Copy Markdown
Contributor Author

This work relates to This work also relates to https://github.com/edx/edx-platform/pull/2419

@talbs talbs closed this Feb 2, 2014
@talbs talbs reopened this Feb 2, 2014
Comment thread cms/templates/index.html Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe it is better to use the django's built-in language names rather than define them here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

At minimum we should just be pulling the options directly from lms/envs/common.py so the menu is consistent with the LMS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Totes! This set of fields was just for proofing the rendering and to help suggest how I was expecting the options to be marked up with HTML.

@talbs

talbs commented Jun 12, 2014

Copy link
Copy Markdown
Contributor Author

@lou-wang, @shnayder, and @cahrens, this proof of concept UI branch/PR has been hanging out for a while (since product had the need to create simple language menus for i8tn work). Can you tell me if this UI is still needed?

If so, this branch is static and will need dev support stories to wire up. If not, I'll close this down and delete the branch/work.

Thanks for the help in figuring out next steps.

(cc'ing @sarina in case she knows more about what's needed for language support these days.)

@sarina

sarina commented Jun 12, 2014

Copy link
Copy Markdown
Contributor

@talbs we now save the user's language preference in the user preferences model, so the CMS version of language selection should

  1. save the user's preference in this model
  2. respect the preference that the user chose in the LMS, and not force them to reselect their language in the CMS
  3. ensure that the LMS similarly respects preference chosen in the CMS.

@talbs

talbs commented Jun 12, 2014

Copy link
Copy Markdown
Contributor Author

Adding @explorerleslie to this thread as well. :)

@talbs

talbs commented Jun 12, 2014

Copy link
Copy Markdown
Contributor Author

@explorerleslie, for background, here's the discovery background for this feature (planned for on the LMS side of things as well) - https://edx-wiki.atlassian.net/wiki/pages/viewpage.action?pageId=48726317

@explorerleslie

Copy link
Copy Markdown

Hey @talbs, @shnayder, you and I should probably talk about this together. I need the broader context for language support in the platform to figure out what to do with this. Do you have a sense of priority? I could set up something for next week, but didn't know if we needed to do something before that.

@sarina

sarina commented Jun 12, 2014

Copy link
Copy Markdown
Contributor

@explorerleslie I'm hacking on this right now to get it into reviewable/mergable state. It's a much-requested feature from open-source. The brief context is that LMS has a language preference selector, but Studio does not; further, Studio does not respect a language choice you made in the LMS.

I think it's actually really close to being good - I've spent about half an hour so far making it respect the LMS language choice, and now it just needs a bit of javascript love as well as some tests.

This is a nice-to-have, as it would make language preference more consistent across the whole system (LMS <-> Studio).

@explorerleslie

Copy link
Copy Markdown

@sarina so you're actually doing the development work in Studio as well? Or would I need to have someone on the Studio side hook @talbs's work up to Studio?

Sorry for the potentially mundane question...still trying to get my head into certain parts of our platform/process. :)

@sarina

sarina commented Jun 12, 2014

Copy link
Copy Markdown
Contributor

@explorerleslie normally I wouldn't work on this but it's Hackathon and it's something I want to see done. Plus I get to learn a bit of Studio code too :)

Andy helped me a bit with the Javascript, and it'll need tests and a Studio code review, of course. Just trying to get it in better shape.

@explorerleslie

Copy link
Copy Markdown

@sarina ah, ok, thanks, that helps. If you're working on this, then @talbs we shouldn't close this branch down. :) Let me know when you want a product owner's eyes on it in a sandbox and I can take a look.

Comment thread cms/templates/index.html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@andy-armstrong heads up that this form is necessary for Django i18n support -- that's the magic refreshing that enables the translation on the page.

See https://docs.djangoproject.com/en/1.4/topics/i18n/translation/ ; https://github.com/edx/edx-platform/blob/master/lms/templates/modal/_modal-settings-language.html#L29

@sarina

sarina commented Jun 12, 2014

Copy link
Copy Markdown
Contributor

@explorerleslie this is pretty close! I set up a sandbox with this branch at http://studio.sarina.m.sandbox.edx.org/

@sarina

sarina commented Jun 12, 2014

Copy link
Copy Markdown
Contributor

Did a bit of testing and there's definitely a missing piece to work out:

  1. Visit studio, set lang to Chinese. Site in Chinese!
  2. Visit LMS - LMS in Chinese!
  3. Return to Studio, set lang to French.
  4. Visit LMS - LMS in Chinese (:disappointed:) but on LMS dash, lang pref does say "Français".

I suspect this is related to the call you need to make to i18n/setlang for Django to set your language. A solution would be to re-post to i18n/setlang with your preference on every page -- not sure how much overhead that adds though.

@explorerleslie

Copy link
Copy Markdown

I'm seeing the same issue as @sarina. One other issue is that the text on the edit/save language buttons for language preference don't update with the currently selected language. cc @talbs

I'll take another look once the kinks are worked out. Thanks!

@sarina

sarina commented Jun 12, 2014

Copy link
Copy Markdown
Contributor

@explorerleslie I think that's just because the button text isn't marked for translation. I have an idea on how to fix the first issue and will take another look tonight.

@sarina

sarina commented Jun 13, 2014

Copy link
Copy Markdown
Contributor

Did a lot of talking around and it's going to be tough to make this work seamlessly between the LMS & CMS - we need to do some mucking around with the session for the other system to pick up the change made in the first system. Might need to rope in Cale, or Dave, if I can't figure it out.

@sarina

sarina commented Aug 22, 2014

Copy link
Copy Markdown
Contributor

I'm going to close this PR for now; it's not working, it's not under active development, and I think we need to figure out what we really want to do with it. My understanding is we are going to have a Globalization initiative in the coming quarters, which I will be involved with. Further, I think adding this functionality will also need to tie in with the "language preference" thing we ask for on the Studio registration page - I'm not sure what we do with that info (especially given that you can type in anything arbitrary to that field), or how it relates to this. My feeling is we'll want to consider what we do with that info as a part of this push.

@sarina sarina closed this Aug 22, 2014
@talbs
talbs deleted the talbs/studio-languagemenu branch January 9, 2015 03:24
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