-
Notifications
You must be signed in to change notification settings - Fork 220
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
imprv: lang attribute in Html element to correctly reflect locale #8940
Conversation
|
f830259
to
59ade87
Compare
@@ -41,14 +44,24 @@ interface GrowiDocumentProps { | |||
customCss: string | null, | |||
customNoscript: string | null, | |||
pluginResourceEntries: GrowiPluginResourceEntries; | |||
locale: string; |
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.
4 行目で imoort している Lang を type として使えそう
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.
import している type は、GROWI 内部のものであり、rfc 5646 で決められている、lnag attribute の形式に合わないため、以降の行で、map を定義し変換しています。
https://www.ietf.org/rfc/bcp/bcp47.txt
678d201
to
db41573
Compare
@@ -60,13 +73,17 @@ class GrowiDocument extends Document<GrowiDocumentInitialProps> { | |||
const growiPluginService = await import('~/features/growi-plugin/server/services').then(mod => mod.growiPluginService); | |||
const pluginResourceEntries = await growiPluginService.retrieveAllPluginResourceEntries(); | |||
|
|||
const locale = user == null ? langMap[detectLocaleFromBrowserAcceptLanguage(headers)] | |||
: langMap[user.lang ?? configManager.getConfig('crowi', 'app:globalLang') as Lang ?? Lang.en_US]; | |||
|
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.
commons.ts の getNextI18NextConfig 内のコードを共通化し、ここでのマッピング時にも使えるようにしてください。
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.
共通化し、置き換えました。
common.ts 内のコードも共通化したものを使用するように変更しました。
db41573
to
01db68d
Compare
01db68d
to
130bd54
Compare
reg-suit detected visual differences. Check this report, and review them. 🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴 🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵 What do the circles mean?The number of circles represent the number of changed images.🔴 : Changed items, ⚪ : New items, ⚫ : Deleted items, and 🔵 Passed items How can I change the check status?If reviewers approve this PR, the reg context status will be green automatically. |
task: https://redmine.weseek.co.jp/issues/149169