Skip to content

Instantly share code, notes, and snippets.

@theodesp
Created November 14, 2019 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theodesp/cfbb83848fc9c00496fa3a0ac47d0576 to your computer and use it in GitHub Desktop.
Save theodesp/cfbb83848fc9c00496fa3a0ac47d0576 to your computer and use it in GitHub Desktop.
import React, {Component} from "react";
import intl from 'react-intl-universal';
// common locale data
require('intl/locale-data/jsonp/el.js');
export default class App extends Component {
state = {initDone: false};
componentDidMount() {
this.loadLocales();
}
loadLocales() {
intl.init({
currentLocale: i18nConfig.locale,
locales,
})
.then(() => {
// After loading CLDR locale data, start to render
this.setState({initDone: true});
});
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment