-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[CCR] i18n feedback #30028
[CCR] i18n feedback #30028
Conversation
Pinging @elastic/es-ui |
I would not have mixed the I guess you double checked with @jen-huang and we don't have any opened PR on our feature branch to avoid conflict nightmare 😊 Note: don't misunderstand me, I think this |
@sebelga To make the review easier to manage you can set GitHub to ignore whitespace. Here's a quick link to the diff with whitepsace ignored: https://github.com/elastic/kibana/pull/30028/files?w=1. Does this help? For any open PRs, we'll resolve merge conflicts either on this branch or on the other -- I'll be happy to take on that responsibility. 😄 |
16be0ad
to
8e906a9
Compare
💔 Build Failed |
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.
LGTM, but I'd like to ask to replace double quotes with single quotes for defaultMessage
values in i18n.translate
just to be consistent.
Thank you for jscodeshift
!
const errorMsg = i18n.translate( | ||
'xpack.crossClusterReplication.autoFollowPatternForm.leaderIndexPatternError.duplicateMessage', | ||
{ | ||
defaultMessage: "Duplicate leader index pattern aren't allowed." |
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.
nit: just to be consistent
defaultMessage: "Duplicate leader index pattern aren't allowed." | |
defaultMessage: `Duplicate leader index pattern aren't allowed.` |
placeholder={i18n.translate( | ||
'xpack.crossClusterReplication.autoFollowPatternForm.fieldLeaderIndexPatternsPlaceholder', | ||
{ | ||
defaultMessage: "Type and then hit ENTER" |
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.
nit:
defaultMessage: "Type and then hit ENTER" | |
defaultMessage: 'Type and then hit ENTER' |
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.
@mayya-sharipova on your previous comment you suggested the ` character and there the '
😊 Which one should be use best?
const title = i18n.translate( | ||
'xpack.crossClusterReplication.autoFollowPatternForm.indicesPreviewTitle', | ||
{ | ||
defaultMessage: "Index name examples" |
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.
nit:
defaultMessage: "Index name examples" | |
defaultMessage: 'Index name examples' |
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.
Apparently the single quote.
@@ -18,7 +19,7 @@ import routing from '../services/routing'; | |||
import { resumeFollowerIndex } from '../store/actions'; | |||
import { arrify } from '../../../common/services/utils'; | |||
|
|||
class Provider extends PureComponent { | |||
class FollowerIndexResumeProviderUi extends PureComponent { |
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.
We used Ui
(or Component
) postfix to differ the initial component and the wrapper: ComponentName = injectI18n(ComponentNameUi)
.
Since we are getting rid of injectI18n
, we can remove Ui
at the end of class name.
But it's up to you, you can leave it as well.
) : i18n.translate( | ||
'xpack.crossClusterReplication.unfollowLeaderIndex.confirmModal.unfollowMultipleTitle', | ||
{ | ||
defaultMessage: `Unfollow {count} leader indices?`, |
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.
defaultMessage: `Unfollow {count} leader indices?`, | |
defaultMessage: 'Unfollow {count} leader indices?', |
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.
LGTM! Great job on this. It was indeed much easier to review without the white spacing. 😊
placeholder={i18n.translate( | ||
'xpack.crossClusterReplication.autoFollowPatternForm.fieldLeaderIndexPatternsPlaceholder', | ||
{ | ||
defaultMessage: "Type and then hit ENTER" |
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.
@mayya-sharipova on your previous comment you suggested the ` character and there the '
😊 Which one should be use best?
const title = i18n.translate( | ||
'xpack.crossClusterReplication.autoFollowPatternForm.indicesPreviewTitle', | ||
{ | ||
defaultMessage: "Index name examples" |
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.
Apparently the single quote.
follower index is synchronized with the leader index; when the timeout has elapsed, the | ||
poll for operations will return to the follower so that it can update some statistics, and | ||
then the follower will immediately attempt to read from the leader again.` | ||
defaultMessage: 'The maximum time to wait for new operations on the remote cluster when the ' + |
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.
@maryia-lapata The fact that we can't use template literals for multiple lines, is it because the translators don't have the text wrapped in their translation tool? It seems like going backward for us 😊 (as template literals were brought to solve this concatenating problem)
@sebelga we added backtick strings support to avoid escaping single quotes in So the choice path is the following:
Sorry if my comments misled you :) |
Ok thanks @maryia-lapata for the explanation. Why not use backtick strings in JS everywhere (apart from multiline)? Aso, would something like this be ok? defaultMessage: ['Some very long text',
'that should wrap on multiple lines',
'like this text here'].join(' ') |
@sebelga it should be taken into account that all labels are extracted into JSON file to pass it to vendors. Since expressions aren't allowed in template literals ( `Hello), I would recommend using backtick strings only for strings with single quotes (for which they were allowed) and not confusing others that such string can be a real template literal (in case someone will need to change label without diving into i18n engine and ICU format).Anyway it's allowed to use backticks for all labels in defaultMessage .
|
Perfect, thanks @maryia-lapata for clarifying! |
Thanks for the reviews @maryia-lapata and @sebelga! Maryia, I've removed the use of double quotes; thanks for catching that. |
💔 Build Failed |
Retest |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
@cjcenizal there was changes in $ node scripts/i18n_check.js --fix |
Thanks @maryia-lapata! I'll try that. |
@maryia-lapata I removed a few unused Chinese translations. Can you take a look and let me know if this looks right to you? |
💔 Build Failed |
Retest |
💚 Build Succeeded |
* Remove unused Chinese translations.
💔 Build Failed |
Addresses feedback from #27936 (review).
jscodeshift
I used jscodeshift to convert from
intl.formatMessage
toi18n.translate
. I installed the tool and used this command to apply the codemod:Codemod
Here's the contents of
intlFormatMessageToi18nTranslate.js
:Resources