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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: fix the error message doesn't show correct #799

Merged
merged 3 commits into from
Nov 23, 2020

Conversation

baurine
Copy link
Collaborator

@baurine baurine commented Nov 20, 2020

Reason:

i18next.t() method will truncate some contents and convert colons to dots if the content contains colons.

Example:

console.log(
  i18next.t('Test: error message with colons: colons will become dots') // error message with colons. colons will become dots
)

We also refine the logic a bit. If errCode hasn't a translation, we show the original detail error message instead.

reason:

i18next.t() method will truncate some content and convert colons to dots if the content contains colons.

example:

i18next.t('Test: error message with colons: colons will become dots') => error message with colons. colons will become dots
@baurine baurine force-pushed the fix-wrong-error-message branch from b78d855 to 6b1af66 Compare November 20, 2020 08:40
@baurine baurine force-pushed the fix-wrong-error-message branch from 4453b31 to b81a6cf Compare November 20, 2020 13:22
@breezewish
Copy link
Member

Oh, sorry. I just realize that i18n.exists might not be exactly the same as the current implementation. Could you revert my proposal?

Consider that we have these translations:

EN: err.code.xxx = "Xxx description".
CN: (not exist).

When we receive "err.code.xxx" and current language is CN, its translation exists, which is the EN fallback translation.

However, in TextWithInfo case, it's not the same:

EN: abc = "Abc", abc_tooltip = "Abc Tooltip"
CN: abc = "Abc 内容", abc_tooltip not exist.

In this case, we would like to show only "Abc 内容" when language is CN, instead of showing "Abc 内容" with an english "Abc Tooltip" tooltip.

@baurine
Copy link
Collaborator Author

baurine commented Nov 23, 2020

Got it, will revert it

This reverts commit b81a6cf.
@breezewish breezewish merged commit d03c863 into pingcap:master Nov 23, 2020
@baurine baurine deleted the fix-wrong-error-message branch November 23, 2020 04:54
breezewish added a commit that referenced this pull request Nov 26, 2020
* misc: Increase ulimit to 65535 for test env (#756)
* test: Fix frontend CI (#752)
* ui: fix dayjs i18n (#755)
* ui: handle error globally (#757)
* statement, slow_query: support all fields in list page (#749)
* ui: memorize expand/collapse full text in detail pages (#775)
* ui: break loop dependencies (#771)
* ui: fix browser compatibility check (#776)
* ui: Refine store location, add zoom and pan (#772)
* ui: show disk usage information for statement and slow query (#777)
* ui: use qps instead of ops (#786)
* statement: support export (#778)
*: Fix slow query and start_ts not working in some cases (#793)
* ui: fix errors doesn't display (#794)
* ui: fix the error message doesn't show correct (#799)
* slow_queries: support export (#792)
* ui: add MySqlFormatter to customize the sql formatter (#805)
*: fix query statement detail error cause by round (#806)
* ui: copy original content instead of formatted content for CopyLink (#802)
* add min height of topology canvas (#804)
* metrics: Support customize Prometheus address (#808)
* clusterinfo: Refine (#815)
* ui: Open statement and slow log in new tab (#816)
* ui: add more time field for slow query detail page (#810)
* slowlog: Improve descriptions (#817)
* build: add action to check release-version is changed for release branch
* Release v2020.11.26.1
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.

3 participants