-
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
Localization "Index Patterns" tab #20525
Merged
yankouskia
merged 40 commits into
elastic:master
from
maryia-lapata:i18n-index-patterns
Jul 30, 2018
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
f99eca7
Integrate i18n-engine into "Index Patterns" tab
maryia-lapata d42e69d
Adjusted unit tests for "Index Patterns" tab
maryia-lapata 63c798a
Localization of "Index patterns" section name
maryia-lapata 2904a6f
Rename the function shallowIntl to shallowWithIntl, remove needless c…
maryia-lapata 463490f
Refactoring of default message
maryia-lapata e29cf5f
Localization for FieldEditor component
maryia-lapata f186b43
Adjust unit tests for FieldEditor component
maryia-lapata 4514ee8
Integrate i18n-engine into "Index Patterns" tab
maryia-lapata d41b9cb
Adjusted unit tests for "Index Patterns" tab
maryia-lapata 512ba8a
Localization of "Index patterns" section name
maryia-lapata c32cfe0
Rename the function shallowIntl to shallowWithIntl, remove needless c…
maryia-lapata 62d35af
Refactoring of default message
maryia-lapata 407cdda
Localization for FieldEditor component
maryia-lapata 6ad10c1
Adjust unit tests for FieldEditor component
maryia-lapata d92d137
Merge branch 'i18n-index-patterns' of https://github.com/maryia-lapat…
maryia-lapata 1580330
Replace I18nContext to injectI18n according to changes in @kbn/i18n
maryia-lapata be05e40
Merge branch 'master' into i18n-index-patterns
maryia-lapata 34a298c
Merge branch 'master' into i18n-index-patterns
maryia-lapata 56d8ed4
Fix broken saving form
maryia-lapata 3a1b6a4
Merge branch 'master' into i18n-index-patterns
maryia-lapata 0ba29dd
Adjust components importing according to changes in @kbn/i18n
maryia-lapata c0087f2
Formatting and refactoring
maryia-lapata e36744f
Update ids
maryia-lapata a99d457
Merge branch 'master' into i18n-index-patterns
maryia-lapata 7d80c98
Fix invalid HTML and refactoring
maryia-lapata 80a463e
Merge branch 'master' into i18n-index-patterns
maryia-lapata b05eff1
Use i18n module instead of AngularJS service
maryia-lapata 20b8265
Localize scripting_syntax.js, refactoring
maryia-lapata 6d180c7
Update message ids.
maryia-lapata 2aa7b1a
Merge branch 'master' into i18n-index-patterns
maryia-lapata 736b5d8
Merge branch 'master' into i18n-index-patterns
maryia-lapata 50b02f5
latest changes
bf0fd45
latest
4cd6f0c
fix plural form in status messages
031aa64
fix messages in status message, _field component
1f4711a
move back span in time_field
87fd943
refactor enzyme helper for providing intl into context
bf4a7f8
do not translate Painless
82a2e9d
test call params in formatMessage
04359eb
clear formatMessage mock after each test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
I think I would prefer the values object here to be declared as a constant above and then referenced here. This would make things easier to read, and would also prevent a new object being created with each rerender. See this for an explanation of why that might be bad: https://medium.com/@esamatti/react-js-pure-render-performance-anti-pattern-fb88c101332f
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.
@bmcconaghy Basically, this is common pattern for avoiding creation of new object, but I would not say, that in this case, because:
values
props. (Here)[https://github.com/yahoo/react-intl/blob/master/src/components/message.js#L43]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.
Fair enough on the performance point. I actually find the FormattedMessage nested in FormattedMessage harder to read personally, as I get lost in the multiple levels of nesting, so would still like to see the values defined outside of the FormattedMessage and then referenced there.
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.
It feels like the right solution for this readability problem would be integrating i18n into EUI components at some point, so that this:
can be changed to:
We'll still have to use
values
to keep all parts of the single message together though (can be quite important for RTL languges).But that's a bigger effort that spans several teams and i18n should prove itself in practice first.