Sha256: 8d4130cbf0e8d6bd0f65269e8f002a4104260d60c2027a80887618b39bd65057
Contents?: true
Size: 536 Bytes
Versions: 1
Compression:
Stored size: 536 Bytes
Contents
import React from 'react'; import {useAcceptLanguage} from '@shopify/react-network'; import {I18nUniversalProvider} from '@shopify/react-i18n-universal-provider'; interface Props { children?: React.ReactNode; } export function I18n({children}: Props) { const fallback = { code: typeof window === 'undefined' ? 'en' : navigator.language, quality: 1.0, }; const [language] = useAcceptLanguage(fallback); return ( <I18nUniversalProvider locale={language.code}> {children} </I18nUniversalProvider> ); }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
quilt_rails-3.1.0 | lib/generators/quilt/demo_app/templates/app-ui/foundation/I18n.tsx |