-
Notifications
You must be signed in to change notification settings - Fork 225
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
Try to detect language from html lang attributes and navigator.languages #38
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
==========================================
- Coverage 50.59% 50.59% -0.01%
==========================================
Files 124 127 +3
Lines 1753 1777 +24
==========================================
+ Hits 887 899 +12
- Misses 866 878 +12
Continue to review full report at Codecov.
|
@@ -24,15 +24,15 @@ const PlayerContainer = ({ | |||
children, | |||
initialObjectFit = 'contain', | |||
useMSE, | |||
locale = 'en', | |||
language, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是保留 locale
比较好,language
可能有歧义。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看了下 Web 的 Intl API 也用的 locale
这个词。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
locale 和 language 还是不一样的。我们看起来只区分了语言,并没有区分「区域」,比如美国和英国词汇不同,数字格式不同之类的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们这个属性可以填的值兼容了 locale 的写法,如果本意就是 locale 感觉写 locale 也没什么问题。美国英国的不同 locale 表现成同一种外观而已。
这个的进度怎么样呀 |
#37 # Description
html
lang
attributes andnavigator.languages
Checklist: