YDJ-FE / ts-react-vite_or_webpack

a starter-template with typescript, react, mobx and vite/webpack...
https://starter.jackple.com/
MIT License
362 stars 116 forks source link

Add intl #23

Closed pcg92 closed 5 years ago

pcg92 commented 5 years ago

I think that any good starter requires i18n

jackple commented 5 years ago

it's a good recommendation, I will think about it!

pcg92 commented 5 years ago

Im trying to integrate this in the boilerplate https://github.com/akameco/babel-plugin-react-intl-auto/tree/master/examples/with-typescript

But Im getting problems running the script: UnhandledPromiseRejectionWarning: SyntaxError ... PageLoading/index.scss.d.ts: Unexpected reserved word 'interface'

Edit: I have tried this: https://github.com/bang88/typescript-react-intl/issues/19 And its working nice

jackple commented 5 years ago

@pcegarra feat/intl I have created a new branch for this, can you make a pr?

pcg92 commented 5 years ago

Done, check the pr https://github.com/YDJ-FE/ts-react-webpack/pull/25/commits/27fef64ffabbb166bde221a3df5bfd08b956cceb

To try it just change the state to 'es' in the LanguageProvider component, we probably need to create a store to handle this

jackple commented 5 years ago

@pcegarra https://github.com/YDJ-FE/ts-react-webpack/pull/25#issuecomment-489497322

I'm getting some test result before merge

pcg92 commented 5 years ago

Nice, what about https://ant.design/components/locale-provider/?

jackple commented 5 years ago

@pcegarra yeah, I'm using LocaleProvider in my company project.

pcg92 commented 5 years ago

Do you plan to add it in feat/react-intl-universal?

jackple commented 5 years ago

@pcegarra yes

jackple commented 5 years ago

@pcegarra https://github.com/YDJ-FE/ts-react-webpack/commit/bdecb146dd2cdb476215cd97f6b8201fd20d6d3b