@khanacademy/math-input 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @khanacademy/math-input
2
2
 
3
+ ## 0.5.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 6f8f1ac9: Use wonder-blocks-i18n to determine the decimal separator
8
+
3
9
  ## 0.5.4
4
10
 
5
11
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import Color from '@khanacademy/wonder-blocks-color';
2
2
  import * as i18n from '@khanacademy/wonder-blocks-i18n';
3
+ import { getDecimalSeparator } from '@khanacademy/wonder-blocks-i18n';
3
4
  import { StyleSheet, css } from 'aphrodite';
4
5
  import PropTypes from 'prop-types';
5
6
  import * as React from 'react';
@@ -359,17 +360,13 @@ var EchoAnimationTypes = {
359
360
  LONG_FADE_ONLY: "LONG_FADE_ONLY"
360
361
  };
361
362
 
362
- // back to a period. We can only depend on a subset of what localeplanet
363
- // provides, however -- the things in `icu-slim.js` (there's a copy in ../lib/
364
- // for reference).
363
+ // - In order to get the correct decimal separator for the current locale,
364
+ // the locale must bet set using `setLocale(kaLocale)` which can be
365
+ // imported from wonder-blocks-i18n.
366
+ // - Some languages/locales use different decimal separators than the ones
367
+ // listed here. Much of the Arab world uses U+066C.
365
368
 
366
- var decimalSeparator;
367
-
368
- if (typeof window !== "undefined" && window.icu && window.icu.getDecimalFormatSymbols().decimal_separator === ",") {
369
- decimalSeparator = DecimalSeparators.COMMA;
370
- } else {
371
- decimalSeparator = DecimalSeparators.PERIOD;
372
- }
369
+ var decimalSeparator = getDecimalSeparator() === "," ? DecimalSeparators.COMMA : DecimalSeparators.PERIOD;
373
370
 
374
371
  var KeyConfigs = {
375
372
  // Basic math keys.