import{j as e}from"./jsx-runtime-CnH95YSl.js";import{useMDXComponents as r}from"./index-BeeV6X6A.js";import{M as s}from"./index-DLgQDw3r.js";import"./index-NdkWRN8K.js";import"./_commonjsHelpers-gnU0ypJ3.js";import"./iframe-Cf-Lpz6Y.js";import"./index-BJTM6NaI.js";import"./index-B5xazMy1.js";import"./index-DieBXP3Z.js";import"./index-CXQShRbs.js";import"./index-DrFu-skq.js";function l(i){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...r(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{}),`
`,e.jsx(n.h1,{id:"globalization-within-odyssey",children:"Globalization within Odyssey"}),`
`,e.jsx(n.p,{children:"Odyssey has its own globalization system which other devs can hook into."}),`
`,e.jsx(n.h2,{id:"odysseytranslationprovider",children:"OdysseyTranslationProvider"}),`
`,e.jsx(n.p,{children:"Odyssey comes out of the box with support for the following 30 languages:"}),`
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-ts",children:`export const defaultSupportedLanguages = [
  "cs", // Czech
  "da", // Danish
  "de", // German
  "el", // Greek
  "en", // English
  "es", // Spanish
  "fi", // Finnish
  "fr", // French
  "ht", // Haitian Creole
  "hu", // Hungarian
  "id", // Indonesian
  "it", // Italian
  "ja", // Japanese
  "ko", // Korean
  "ms", // Malaysian
  "nb", // Norwegian
  "nl_NL", // Dutch
  "ok_PL", // (Test Language) Pseudo-loc
  "ok_SK", // (Test Language) Show Keys
  "pl", // Polish
  "pt_BR", // Portuguese (Brazil)
  "ro", // Romanian
  "ru", // Russian
  "sv", // Swedish
  "th", // Thai
  "tr", // Turkish
  "uk", // Ukrainian
  "vi", // Vietnamese
  "zh_CN", // Chinese (PRC)
  "zh_TW", // Chinese
] as const;
`})}),`
`,e.jsx(n.h3,{id:"provider-customization",children:"Provider customization"}),`
`,e.jsxs(n.p,{children:["By default, it will use the ",e.jsx(n.code,{children:"window.navigator.language"})," (browser setting) or ",e.jsx(n.code,{children:"en"})," as the selected language code. It is possible to provide ",e.jsx(n.code,{children:"languageCode"})," to the provider via props:"]}),`
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-jsx",children:`import { OdysseyTranslationProvider } from "@okta/odyssey-react-mui";

const languageCode = "cs";

const YourAppRoot = ({ children }) => (
  <OdysseyTranslationProvider languageCode={languageCode}>
    {children}
  </OdysseyTranslationProvider>
);
`})}),`
`,e.jsxs(n.p,{children:["If you want to override translation bundles, you can do so by providing the ",e.jsx(n.code,{children:"translationOverrides"})," prop as such:"]}),`
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-jsx",children:`import { OdysseyTranslationProvider } from "@okta/odyssey-react-mui";

const translationOverrides = {
  en: {
    "fieldlabel.optional.text": "Not Required",
  },
  fr: {
    "fieldlabel.optional.text": "Non Requis",
  },
};

const YourAppRoot = ({ children }) => (
  <OdysseyTranslationProvider languageCode={languageCode}>
    {children}
  </OdysseyTranslationProvider>
);
`})}),`
`,e.jsx(n.p,{children:"The following keys can have their values overridden:"}),`
`,e.jsxs(n.ul,{children:[`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"breadcrumbs.home.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"breadcrumbs.label.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"close.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"clear.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"open.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"fielderror.screenreader.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"fieldlabel.optional.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"fieldlabel.required.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"filters.clear.label"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"filters.filter.any"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"filters.filter.clear"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"filters.filters.arialabel"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"filters.menuitem.any"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"filters.menuitem.selected"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"filters.search.label"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"fileupload.button.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"fileupload.prompt.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"fileupload.removefile.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"passwordfield.icon.label.show"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"severity.error"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"severity.info"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"severity.success"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"severity.warning"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"switch.active"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"switch.inactive"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.columnvisibility.arialabel"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.density.arialabel"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.draghandle.arialabel"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.draghandle.tooltip"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.actions"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.columnvisibility.arialabel"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.density.arialabel"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.draghandle.arialabel"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.draghandle.tooltip"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.error"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.fetchedrows.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.fetchedrows.text_plural"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.moreactions.arialabel"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.noresults.heading"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.noresults.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.reorder.backward"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.reorder.forward"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.reorder.toback"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.reorder.tofront"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.rows.text"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.rows.text_plural"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"pagination.loadmore"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"pagination.next"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"pagination.previous"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"pagination.page"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"pagination.rowsperpage"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"pagination.rowswithtotal"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"pagination.rowswithouttotal"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.actions.selectall"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.actions.selectnone"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.actions.selectsome"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.rowexpansion.expand"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.rowexpansion.expandall"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.rowexpansion.collapse"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"table.rowexpansion.collapseall"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"dataview.layout.table"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"dataview.layout.grid"})}),`
`,e.jsx(n.li,{children:e.jsx(n.code,{children:"dataview.layout.list"})}),`
`]}),`
`,e.jsx(n.h2,{id:"passing-the-language-from-the-monolith",children:"Passing the language from the Monolith"}),`
`,e.jsx(n.pre,{children:e.jsx(n.code,{children:`import { getOktaLocale } from '@okta/ui-libraries-monolith';

<OdysseyProvider
  hasCssBaseline
  languageCode={getOktaLocale()}
>
  // Add code here
</OdysseyProvider>

`})})]})}function b(i={}){const{wrapper:n}={...r(),...i.components};return n?e.jsx(n,{...i,children:e.jsx(l,{...i})}):l(i)}export{b as default};
