Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(umi-plugin-locale): dispatch languagechange event #2535

Merged
merged 2 commits into from
Jun 6, 2019

Conversation

chenshuai2144
Copy link
Contributor

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

@sorrycc sorrycc changed the title feat:add add languagechange event feat(umi-plugin-locale): dispatch languagechange event Jun 5, 2019
@coveralls
Copy link

coveralls commented Jun 5, 2019

Pull Request Test Coverage Report for Build 3855

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 35.449%

Totals Coverage Status
Change from base Build 3832: 0.07%
Covered Lines: 1445
Relevant Lines: 4078

💛 - Coveralls

@sorrycc
Copy link
Member

sorrycc commented Jun 6, 2019

@yutingzhao1991 review 下这个。

@@ -115,5 +115,5 @@ export declare function now(): number;
export declare function onError(error: string): void;

// umi-plugin-locale
export declare function setLocale(lang: string): void;
export declare function setLocale(lang: string, reloadPage: boolean): void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reloadPage有默认值,是可选属性。

if (window.dispatchEvent) {
const event = new Event('languagechange');
window.dispatchEvent(event);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

触发这个的目的是什么呢?

@sorrycc sorrycc merged commit a24b235 into master Jun 6, 2019
@delete-merged-branch delete-merged-branch bot deleted the add-languagechange-eveNT branch June 6, 2019 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants