Chartbuilder
Chartbuilder copied to clipboard
How to localize
How can I start localizing the new Chartbuilder?
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?
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:
- 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}');
- Customise font sizes: src/styl/chart-renderer.styl - Change $em_sizes
- Import custom fonts: src/styl/fonts.styl
- Select custom fonts: src/styl/type.styl
- Set new default colours: src/styl/colors.styl