-
Notifications
You must be signed in to change notification settings - Fork 224
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
#24 #39
Merged
Merged
#24 #39
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dengliming
approved these changes
Dec 2, 2020
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.
Looks great to me! Thanks.
Comment on lines
+237
to
+262
if (this.props.menuData.length > 0) { | ||
for ( let i = 0 ; i < this.props.menuData.length; i+=1) { | ||
if(this.props.menuData[i].path === '/plug') { | ||
this.props.menuData[i].name = getIntlContent("SOUL.MENU.PLUGIN.LIST"); | ||
} else if(this.props.menuData[i].path === '/system'){ | ||
this.props.menuData[i].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT"); | ||
if(this.props.menuData[i].children.length > 0) { | ||
for(let j = 0; j < this.props.menuData[i].children.length; j+=1) { | ||
const childrenPath = this.props.menuData[i].children[j].path; | ||
if(childrenPath === '/system/manage') { | ||
this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.USER"); | ||
} else if(childrenPath === '/system/plugin') { | ||
this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.PLUGIN"); | ||
} else if(childrenPath === '/system/auth') { | ||
this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.AUTHEN"); | ||
} else if(childrenPath === '/system/metadata') { | ||
this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.METADATA"); | ||
} else if(childrenPath === '/system/dict') { | ||
this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.DICTIONARY"); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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.
个人建议这个地方可以下次优化下,看看能否菜单数据里面加多个属性标识不用通过path判断,通过标识去拼接一些前缀去获取国际化配置好点,这样不用每加一个菜单这里加多个判断
好点子,下一版本 优化掉,这样通过属性值 来选择 对应语言
dengliming <notifications@github.com> 于2020年12月2日周三 下午5:31写道:
… ***@***.**** approved this pull request.
Looks great to me! Thanks.
------------------------------
In src/components/SiderMenu/SiderMenu.js
<#39 (comment)>:
> + if (this.props.menuData.length > 0) {
+ for ( let i = 0 ; i < this.props.menuData.length; i+=1) {
+ if(this.props.menuData[i].path === '/plug') {
+ this.props.menuData[i].name = getIntlContent("SOUL.MENU.PLUGIN.LIST");
+ } else if(this.props.menuData[i].path === '/system'){
+ this.props.menuData[i].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT");
+ if(this.props.menuData[i].children.length > 0) {
+ for(let j = 0; j < this.props.menuData[i].children.length; j+=1) {
+ const childrenPath = this.props.menuData[i].children[j].path;
+ if(childrenPath === '/system/manage') {
+ this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.USER");
+ } else if(childrenPath === '/system/plugin') {
+ this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.PLUGIN");
+ } else if(childrenPath === '/system/auth') {
+ this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.AUTHEN");
+ } else if(childrenPath === '/system/metadata') {
+ this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.METADATA");
+ } else if(childrenPath === '/system/dict') {
+ this.props.menuData[i].children[j].name = getIntlContent("SOUL.MENU.SYSTEM.MANAGMENT.DICTIONARY");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
个人建议这个地方可以下次优化下,看看能否菜单数据里面加多个属性标识不用通过path判断,通过标识去拼接一些前缀去获取国际化配置好点,这样不用每加一个菜单这里加多个判断
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#39 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALAFSKVQXEQTZ43AJDJAZRTSSYCOVANCNFSM4UKALXFA>
.
|
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
international complete