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

create global localization object #85

Closed
davelandry opened this issue Apr 12, 2018 · 1 comment
Closed

create global localization object #85

davelandry opened this issue Apr 12, 2018 · 1 comment
Labels
Projects

Comments

@davelandry
Copy link
Member

Localization is something that we've supported in the past that has not been properly addressed in the new version of d3plus. D3 contains some great time formatters, so let's implement a solution that combines any built-ins we can find with more specific word localizations (like the text for the "back" button).

My current idea is to have a global locale object exported by this module, and that object would contain keys for each language, which then in turn contain keys for specific types of localizations. An example format is here:

export default {
  "en-US": {
    time: {...}, // object imported from d3-time-format
    text: {
      back: "Back",
      ...
    }
  },
  "es-ES": {
    time: {...}, // object imported from d3-time-format
    text: {
      back: "Volver",
      ...
    }
  }
}

This object would be created in src/locale/index.js, importing all of the d3-time-format language modules, and importing our own modules from files like src/locale/text/es-ES.js. We would then add a .locale("es-ES") method to BaseClass so that every component can support localization.

@cnavarreteliz, @nbond211, thoughts?

@cnavarreteliz
Copy link
Contributor

can I close this issue @davelandry ?

1.0 automation moved this from To do to Done Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
1.0
  
Done
Development

No branches or pull requests

2 participants