Skip to content

feat: provider supports custom locale - #473

Merged
wewoor merged 28 commits into
mainfrom
feat/extendsLocales
Oct 27, 2021
Merged

feat: provider supports custom locale#473
wewoor merged 28 commits into
mainfrom
feat/extendsLocales

Conversation

@ProfBramble

@ProfBramble ProfBramble commented Oct 14, 2021

Copy link
Copy Markdown
Contributor

Description

重构国际化功能由 provider 引入改为 extension 形式

Resolved #325, #446

Changes

  • 移除 provider 添加 locales 语言包的功能
  • 添加 locales-default 作为国际化 extensions
  • 通过内置 package.json 作为语言包注册手段

@ProfBramble ProfBramble changed the title Feat/extends locales WIP: feat: provider supports custom locale Oct 14, 2021
@wewoor wewoor added the enhancement New feature or request label Oct 14, 2021
@wewoor wewoor added this to the 0.9.0-alpha.6 milestone Oct 14, 2021
Comment thread src/extensions/index.ts Outdated
Comment thread src/extensions/index.ts Outdated
Comment thread src/model/locales.ts Outdated
@wewoor

wewoor commented Oct 14, 2021

Copy link
Copy Markdown
Collaborator

注意更新 单元测试

@ProfBramble ProfBramble linked an issue Oct 15, 2021 that may be closed by this pull request
@ProfBramble ProfBramble changed the title WIP: feat: provider supports custom locale feat: provider supports custom locale Oct 15, 2021
@codecov

codecov Bot commented Oct 15, 2021

Copy link
Copy Markdown

Codecov Report

Merging #473 (1bed896) into main (5fbc961) will increase coverage by 0.01%.
The diff coverage is 83.01%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #473      +/-   ##
==========================================
+ Coverage   85.12%   85.14%   +0.01%     
==========================================
  Files         180      180              
  Lines        5205     5284      +79     
  Branches     1179     1188       +9     
==========================================
+ Hits         4431     4499      +68     
- Misses        765      778      +13     
+ Partials        9        7       -2     
Impacted Files Coverage Δ
src/extensions/index.ts 100.00% <ø> (ø)
src/extensions/theme-defaults/index.ts 100.00% <ø> (ø)
src/i18n/localize.tsx 9.52% <ø> (ø)
src/molecule.api.ts 100.00% <ø> (ø)
src/provider/molecule.tsx 2.77% <0.00%> (-0.80%) ⬇️
src/services/settingsService.ts 100.00% <ø> (ø)
src/services/builtinService/index.ts 96.72% <87.50%> (-3.28%) ⬇️
src/extensions/locales-defaults/index.ts 88.88% <88.88%> (ø)
src/i18n/localeService.ts 100.00% <100.00%> (ø)
src/services/builtinService/const.ts 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5fbc961...1bed896. Read the comment docs.

@ProfBramble
ProfBramble requested a review from wewoor October 15, 2021 03:20
@wewoor
wewoor requested a review from mortalYoung October 15, 2021 03:23
Comment thread src/i18n/localeService.ts
@wewoor

wewoor commented Oct 26, 2021

Copy link
Copy Markdown
Collaborator

@ProfBramble 单测失败了

@wewoor wewoor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1

@wewoor
wewoor merged commit f1d9012 into main Oct 27, 2021
@wewoor
wewoor deleted the feat/extendsLocales branch October 27, 2021 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The defaultLocale API doesn't work The Internationalization refactoring

3 participants