{"size": 628, "ext": "js", "max_stars_repo_path": "src/states/locales.js", "max_stars_repo_name": "hubingym/scratch-gui-tiny", "max_stars_repo_stars_event_min_datetime": "2020-04-20T01:42:57.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-22T12:25:53.000Z", "max_issues_repo_path": "src/states/locales.js", "max_issues_repo_name": "hubingym/scratch-gui-tiny", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/states/locales.js", "max_forks_repo_name": "hubingym/scratch-gui-tiny", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.12, "max_line_length": 62, "alphanum_fraction": 0.7277070064}
import { addLocaleData } from 'react-intl';

import { localeData, isRtl } from 'scratch-l10n';
import editorMessages from 'scratch-l10n/locales/editor-msgs';

import { emitter } from './core';

addLocaleData(localeData);

const local = 'zh-cn';
document.documentElement.lang = local;
export default {
  isRtl: false,
  locale: local,
  messagesByLocale: editorMessages,
  messages: editorMessages[local],
  onChangeLanguage(newLocale) {
    this.isRtl = isRtl(newLocale)
    this.locale = newLocale;
    this.messages = editorMessages[newLocale];
    document.documentElement.lang = newLocale;
    emitter.forceUpdate();
  }
};
