-
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
Fix i18n default formats injection into en.json #20929
Fix i18n default formats injection into en.json #20929
Conversation
💚 Build Succeeded |
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.
Good catch!
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, just a minor nit. Thanks!
|
||
const extractedObject = JSON5.parse(extractedJSONBuffer.toString()); | ||
|
||
expect(extractedObject).toHaveProperty('formats'); |
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: maybe use toMatchSnapshot
instead of toHaveProperty
to make sure it's a valid formats
object we expect?
771e9f9
to
d12d173
Compare
💚 Build Succeeded |
* Fix i18n default formats injection into en.json * Use snapshots for tests
6.x/6.5: ff39ac1 |
Bug:
en.json
generated by default messages extraction tool doesn't containformats
object.#19620 imports
{ formats } from '@kbn/i18n'
to inject it intoen.json
, but@kbn/i18n
package structure was changed in #20513, soformats
isundefined
now.How to test
Copy https://gist.github.com/LeanidShutau/6026b1ab9cc7e7b9d457676616abeb68 to
src/core_plugins/kibana/common
.Before fix
Run
node scripts/extract_default_translations src/core_plugins/kibana
.Open
src/core_plugins/kibana/translations/en.json
.formats
property is missing inen.json
.After fix
Run
node scripts/extract_default_translations src/core_plugins/kibana
.Open
src/core_plugins/kibana/translations/en.json
.Default formats object is injected into
en.json
.