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

How to localize #179

Open
probus opened this issue Jul 13, 2015 · 2 comments
Open

How to localize #179

probus opened this issue Jul 13, 2015 · 2 comments

Comments

@probus
Copy link

probus commented Jul 13, 2015

How can I start localizing the new Chartbuilder?

@yanofsky
Copy link
Contributor

Hmm, Chartbuilder 2 isn't quite set up to swap in another language, but it should be.

As a start (i guess) here's a (likely incomplete) list of places that contain thing that should be able to be localized:

  • Error Messaging in src/js/components/shared/DataInput.jsx
  • All of the headers following a step-number in various files
  • Every place there is a Button rendered in various files
  • Every place there is a labeled dropdown such as in the date format options
  • Sugar.js is already locale aware but I don't think we're currently loading in all locales for performance reasons.
  • Chartbuilder attempts to localize number formats automatically in the SessionStore but the fallback to comma separators and dot decimals should be able to be customized

The locale indicator should ultimately be stored in the SessionStore (Right @nsonnad?)

@probus what do you think would be the best way to go about this?

@ghost
Copy link

ghost commented Oct 21, 2015

I've changed most of the styling for my publiciation and to make it work one d/m/y data.

Here are the key minimum things I did:

  1. src/js/util/process-dates.js
    Line 8: +Date.setLocale('en-AU');

Line 11: "lmdy": function(d) {

  •   return d.format('{M}/{d}/{yy}');
    
  •   return d.format('{M}/{d}/{yyyy}');
    
    },

Line 15: "mmdd": function(d) {

  •   return d.format('{M}/{d}');
    
  •   return d.format('{d}/{M}');
    
  1. Customise font sizes:
    src/styl/chart-renderer.styl - Change $em_sizes
  2. Import custom fonts:
    src/styl/fonts.styl
  3. Select custom fonts:
    src/styl/type.styl
  4. Set new default colours:
    src/styl/colors.styl

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

2 participants