gatsby-plugin-react-i18next icon indicating copy to clipboard operation
gatsby-plugin-react-i18next copied to clipboard

i18n.resources deprecated?

Open KingWu opened this issue 4 years ago • 0 comments

I found that i18n.resources is deprecated. Then how can i get the resources for specific language? I built an wrapper SEO component. This component is used in gatsby-ssr.js

const DefaultPageSEO = ({context}) => {
  const {i18n, language} = context
  const langPack = i18n.resources[language].translator
  return (
    <SEO 
       title={langPack.seo.title}
       appName={langPack.seo.appName}
       author={langPack.seo.author}
       lang={language}
       description={langPack.seo.description} 
     />
  )
}
export default DefaultPageSEO

How can i migrate?

Thx

KingWu avatar Apr 13 '21 05:04 KingWu