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

Localize on client side #688

Closed
zmbc opened this issue Apr 15, 2017 · 2 comments
Closed

Localize on client side #688

zmbc opened this issue Apr 15, 2017 · 2 comments
Assignees

Comments

@zmbc
Copy link
Contributor

zmbc commented Apr 15, 2017

(Part of #655)

Notes (for myself and others):

How I envision this working:

  • Use jquery.i18n -- convert the current locale files into that "banana" format
  • Register the localization function as a Handlebars helper, and replace the Django localization calls with it
  • Store the locale in localStorage (to emulate what Django's doing, which is, I believe, using a session)
  • On locale change, dynamically grab the new banana file and either send out some "rerender" signal to all templates or (easier) just refresh the page

Potential issue: We take advantage of our two-step templating process by "localizing" strings that themselves contain Handlebars template syntax (for example). There's probably a hacky way to emulate this on the client-side, but it's really not a good way to localize and maybe we should just fix it as part of this change.

@zmbc
Copy link
Contributor Author

zmbc commented Oct 30, 2017

@goldpbear I don't think this is done? Simply using the multiple index.html copies wasn't what I had in mind. I think we can de-prioritize this a bit, though, because we've found a workaround.

@goldpbear
Copy link
Contributor

@zmbc -- ah right, sorry, I got in an issue-closing mood after merging the static site. Agreed there is more we can do to improve localization as detailed in this issue. Reopening.

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

3 participants