-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[i18n] .i18nrc file as the source of truth and enhance tooling #39774
Conversation
💔 Build Failed |
💔 Build Failed |
retest |
💔 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.
I'm going to defer to @azasypkin here, since I'm not super familiar with the i18n stuff, but I do remember us pretty explicitly wanting the translations to not require a config file to find and instead that we wanted to use consistent paths. Not saying we can't change course, but I want to make sure it's well considered and I don't think I have enough context to do so.
@spalger Sounds good. I did had a chat with Oleg while working on this, lets wait for his feedback. |
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 like you left some commented out code in, but otherwise LGTM.
@@ -324,3 +324,8 @@ export class ErrorReporter { | |||
); | |||
} | |||
} | |||
|
|||
// export function arrayify<Subj = any>(subj: Subj | Subj[]): Subj[] { |
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.
Why is there commented out code here? Did you start typescripting this file and then stop?
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 left it for whenever we want to mvoe this file to TS
💔 Build Failed |
retest |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
💚 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.
Couple nits, but LGTM (code review only)
… into i18n/packages-translations
💔 Build Failed |
💚 Build Succeeded |
…b-panel-for-stopping-jobs * 'master' of github.com:elastic/kibana: (58 commits) [DOCS] Timelion cleanup (elastic#41381) [Docs] Add simple phrase highlighting to Logs UI (elastic#41610) [Maps] Rename modules for clarity (elastic#41608) [Monitoring] Metricbeat migration net new user experience (elastic#39832) [Maps] Only color legend icon with dynamic color when dynamic config is complete (elastic#41607) [TSVB] [Markdown] markdown section do not render after change data parameter (elastic#41576) [Vega] (Step 2) Shim new platform - renaming vega -> vis_type_vega (elastic#41565) update dark mode tsvb test (elastic#41618) [i18n] .i18nrc file as the source of truth and enhance tooling (elastic#39774) Reactify Top Nav Menu (kbn_top_nav) (elastic#40262) fix(code/frontend): should update search results if search options change (elastic#41232) Use kibana-ci-proxy-cache for chrome and gecko drivers (elastic#41581) [SIEM] Fix draggables to work with escapeId for the ML severity column (elastic#41621) [Canvas] Updates esdocs default count to 1000 (elastic#41604) [Uptime] Fix duration chart for Safari (elastic#41619) [Canvas] Restores "Today" as a quick time range in time filter (elastic#41528) docs: lowercase app (elastic#41612) [Code] Update git repository update frequency (elastic#41541) Remove language=json on code blocks due to performance hit (elastic#41540) [DOCS] Update anchors and links for Elasticserach API relocation. (elastic#41372) ...
@Bamieh - has this been backported to 7.4? |
@stacey-gammon oh! PR submitted |
Dev Docs
Currently there is a disconnect disconnect between i18n tooling (
i18nrc.json
) andtop-level/translations
convention used by the kibanai18n
service. This change attempts to fix it, tidying up the code a little, and enhancing the i18n tooling as a result of this change.Use
.i18nrc.json
as the source of truthCurrently we assume that internal and external plugins to follow this convention of putting translations following this pattern
**/*/translations/${locale}.json
.We also have to keep the
.i18nrc
in sync with the location of each of these translation files.This change makes the
i18n
service look into top level.i18nrc.json
files and parses thetranslations
instead of traversing the source code directories to look for translation files.This change discards the translation paths assumptions and allows developers to explicitly specify translation paths inside
.i18nrc
file. Previously thetranslations
paths in the.i18nrc
was only used for thescripts/i18n_check.js
tooling.This change also allows for a better third party plugin development experience as developers can fully control their own translation paths using the
.i18nrc.json
file.Enhance i18n tooling (namespaces prefix checking, better logging and error handling for parsing
.i18nrc
files)Introducing top level
.i18nrc
files for plugins allows adding a namespacesprefix
check.This PR adds a prefix check that all
x-pack
plugin namespaces (label ids) start withxpack.*
Introducing top level
.i18nrc
files for plugins allows for a better experience in merging configs. This PR adds a more verbose logging while merging configs and better error handling.