Uploaded image for project: 'stripes-components'
  1. stripes-components
  2. STCOM-614

CurrencySelect values are not translated

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • TBD
    • Resolution: Done
    • None
    • 8.0.0
    • Core: F - Sprint 91
    • 1
    • Prokopovych

    Description

      CurrencySelect provides labels directly from util/currencies.js which are in English only. Instead, it should use the code attribute to produce a localized value.

      See https://formatjs.io/docs/react-intl/api/#formatdisplayname and an example in ui-developer. Here, we can just pipe the currency abbreviation through intl like

      import { useIntl } from 'react-intl';
      
      const intl = useIntl(); // or via props.intl / injectIntl if you're using a class component
      const currencyCode = 'USD';
      const happyTranslatedCurrencyName = intl.formatDisplayName(currencyCode, { type: 'currency' });
      

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                zburke Zak_Burke
                zburke Zak_Burke
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases