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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module: locale): fix custom locale resource #1988

Merged
merged 8 commits into from
Oct 12, 2021

Conversation

anranruye
Copy link
Member

馃 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

馃敆 Related issue link

Fixes #1980

馃挕 Background and solution

Changes:

  1. fix custom language resource
  2. improve fallback strategy: requested resource > resource of parent culture > LocaleProvider.DefaultLanguage resource > en-US

馃摑 Changelog

Language Changelog
馃嚭馃嚫 English fix custom language resource; improve fallback strategy
馃嚚馃嚦 Chinese

鈽戯笍 Self Check before Merge

鈿狅笍 Please check all items below before review. 鈿狅笍

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #1988 (a403d76) into master (f30303e) will increase coverage by 1.91%.
The diff coverage is 58.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1988      +/-   ##
==========================================
+ Coverage   25.51%   27.43%   +1.91%     
==========================================
  Files         488      511      +23     
  Lines       32111    24509    -7602     
  Branches        0      233     +233     
==========================================
- Hits         8192     6723    -1469     
+ Misses      23919    17750    -6169     
- Partials        0       36      +36     
Impacted Files Coverage 螖
components/locale-provider/LocaleProvider.cs 64.06% <57.50%> (-5.94%) 猬囷笍
components/date-picker/internal/DatePickerBase.cs 46.77% <100.00%> (+1.75%) 猬嗭笍
components/core/Helpers/MemberPath/PathNode.cs 46.15% <0.00%> (-8.85%) 猬囷笍
components/core/Reflection/TypeDefined.cs 77.77% <0.00%> (-7.94%) 猬囷笍
components/input/InputGroup.razor.cs 87.50% <0.00%> (-6.95%) 猬囷笍
components/tabs/TabPane.razor 86.66% <0.00%> (-6.20%) 猬囷笍
...ponents/date-picker/types/DatePickerPlaceholder.cs 22.72% <0.00%> (-4.20%) 猬囷笍
components/input/TextArea.razor.cs 77.52% <0.00%> (-3.05%) 猬囷笍
...ponents/core/Component/Overlay/type/TriggerType.cs 81.25% <0.00%> (-2.97%) 猬囷笍
components/core/Base/AntComponentBase.cs 46.42% <0.00%> (-2.96%) 猬囷笍
... and 423 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 f30303e...a403d76. Read the comment docs.

@@ -28,11 +28,15 @@ By default, the current language is fetched from the browser. If you need to use

```

The default is set to "en-US" when the language you set does not have a built-in language pack.
You can also add it by using the 'LocaleProvider.SetLocale' method.
When the language you set does not have a built-in language pack, we will fallback to the parent `CultureInfo`, then `LocaleProvider.DefaultLanguage`, then "en-US".
Copy link
Member

Choose a reason for hiding this comment

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

It would be a good idea to add a link to the official documentation for parent CultureInfo.

@ElderJames ElderJames merged commit 6cf7ba5 into ant-design-blazor:master Oct 12, 2021
ElderJames pushed a commit that referenced this pull request Oct 16, 2021
* fix(module: locale): fix custom locale resource

* update doc

* Update LocaleProvider,cs

* Update i18n.zh-CN.md

* Update LocaleProvider

* Update docs
@anranruye anranruye deleted the FixCustomLocale branch October 29, 2021 13:20
ElderJames pushed a commit that referenced this pull request Apr 23, 2022
* fix(module: locale): fix custom locale resource

* update doc

* Update LocaleProvider,cs

* Update i18n.zh-CN.md

* Update LocaleProvider

* Update docs
ElderJames pushed a commit that referenced this pull request Apr 30, 2022
* fix(module: locale): fix custom locale resource

* update doc

* Update LocaleProvider,cs

* Update i18n.zh-CN.md

* Update LocaleProvider

* Update docs
ElderJames pushed a commit that referenced this pull request Sep 6, 2022
* fix(module: locale): fix custom locale resource

* update doc

* Update LocaleProvider,cs

* Update i18n.zh-CN.md

* Update LocaleProvider

* Update docs
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.

Setting a custom locale language help
2 participants