Merged
Conversation
Backports PR #7545 **Commit 1:** Add low level i18n plugin Manages languages that are available and is responsible for loading translated content at the granularity of a plugin. To be done: - APIs for store and retrieval * Original sha: aca671f * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-20T17:12:25Z **Commit 2:** Use Kibana install as root for the translation store directory Setting the path for storing the bundled language translation files to <KIBANA_INSTALL>/data/store_translations/<PLUGIN_NAME> * Original sha: c3ba578 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-21T13:36:59Z **Commit 3:** Updated i18n core plugin APIs to be asynchronous To be done: - Better error handling in APIs - Fix threading issue with storePluginLanguageTranslations API * Original sha: 80d8a2c * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-22T17:25:30Z **Commit 4:** Fix thread synchroization issue in storePluginLanguageTranslations * Original sha: 856fb02 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-24T10:43:06Z **Commit 5:** Update error handling in i18n core plugin * Original sha: c5d22be * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-24T14:30:27Z **Commit 6:** Change to use NodeJS mkdirp function for creating directories recursively Updates with review comments from @srl295. Changed export syntax to show the exported functions at end of file. * Original sha: b37e4f8 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-27T11:04:01Z **Commit 7:** Add REST API for getting translations of a language for a plugin To be done: - Add algorithm to decide on the language for a plugin by comparing the accept languages from the REST call and the plugin supported languages - Add REST API tests * Original sha: ec6d2b1 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-27T22:42:15Z **Commit 8:** Add algorithm for determining plugin language when retrieving translations Client would pass languages used in the 'accept-language' header. These languages would then be compared against the plugin supported languages and best compared language would be selected. To be done: - Add REST API tests * Original sha: a75faae * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-28T21:10:39Z **Commit 9:** Add API to return all registered plugin language translations * Original sha: 66d051b * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-29T17:02:34Z **Commit 10:** Add HAPI API to get all plugins translation files * Original sha: c3403e7 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-06-30T16:08:28Z **Commit 11:** Update register translations API to be independent of plugin name and language The register API is updated to be independent of plugin name and language. The API will now traverse the path given and create language bundles as per language files it traverses. The translations files structure has also been simplified to be just key/value objects. To be done: - Add hapi API to get translations - Extend the API tests to test responses * Original sha: 0f4902d * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-01T16:09:33Z **Commit 12:** Update API test * Original sha: 9785df2 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-05T17:52:25Z **Commit 13:** Add eslint fix for API test * Original sha: d41fcec * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-06T10:00:22Z **Commit 14:** Update with review comments From review #7545 (comment) following comments updated: - README, .gitignore, and .eslintrc are not needed in a core plugin - package.json only needs name and version - unit tests need to go in a tests directory otherwise they won't get picked up by the grunt tasks. Also our convention is to name the test file with the same name as the module it's testing (so i18n_tests.js should just be i18n.js) - For consistency with the rest of the code base, rename the data directory to fixtures. - Prefer const (or let if necessary). Don't use var. - Use ES6 imports/exports rather than commonjs style - Only export the i18n module's public API. For instance, I don't think getPluginTranslationDetails is used outside of the i18n module, so it shouldn't be exposed publicly. If you want to expose it for testing purposes, I would recommend creating an i18n directory with an index.js file that exports the module's public API, and a separate i18n.js file with the "private" API. index.js will be for public use, i18n.js will be for private internal use. * Original sha: c8b2197 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-11T11:23:37Z **Commit 15:** Update after review comments From review (#7545 (comment)): - i18n module API should return promises for async operations instead of using callbacks - All filesystem access should be async - Unit tests need to be updated based on new proposed plugin structure (single language file, not split by view) From design (#6515 (comment)): - Removed API as will consider in later phase TODO: - Make write function async * Original sha: e17653d * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-15T18:24:21Z **Commit 16:** Update after review comments Updated write function to be asynchronous * Original sha: eaf35ab * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-19T11:03:45Z **Commit 17:** Update registerTranslations API to take absolute translation file as argument The API originally took the directory as the argument but following reviews it was decided to change to absolute file because it will be less brittle since it is more explicit. * Original sha: f1974ca * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-21T17:43:27Z **Commit 18:** Translate the Kibana welcome message Translates the start-up message (“Kibana is loading ...”)in the Jade template. To be done: - Means to register the core plugin translations. They are currently added in the fixtures directory as static files. Need to be generated on the fly. * Original sha: 10db458 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-25T13:58:54Z **Commit 19:** Add build task to generate core plugin translations Task which calls registerTranslations API and then a task which copies the regsitered translations to <kibana_root>/build/kibana * Original sha: 4957173 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-27T10:00:35Z **Commit 20:** Add hook to optimize module to add registration during dev startup Registration of the core plugin translations during development start of Kibana server. The translations include the welcome message and server error startup message. * Original sha: 5f61475 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-28T14:18:19Z **Commit 21:** Handle scenario when the user preferred language header is not passed The UI when loading asks i18n plugin which language translation to use depending on the user preferred language header 'accept-language'. This commit is to handle scenario where header is not passed. The algorithm then chooses the default language. * Original sha: 9fbe6d5 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-07-29T10:51:33Z **Commit 22:** Replace registering of translations at plugin install time to the plugin init phase This change follows review comments in: #6515 (comment) * Original sha: 32d5034 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-08T14:39:34Z **Commit 23:** Update after review comments Comments: - #7545 (diff) - #7545 (diff) * Original sha: 8c7f51c * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-09T09:36:04Z **Commit 24:** Update after plugin folder layout changes in Kibana This require to use <kibana_root>/data for registered translations and i18n plugin moved to core_plugins from plugins. Refer to PR for more details: #7562 * Original sha: b84f40a * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-09T11:09:18Z **Commit 25:** Update translation registration to file path rather than bundling After review discussions it was agreed to just register the absolute paths to translation files rather than bundling each file into one central file at registration. * Original sha: 2dd3065 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-16T09:28:38Z **Commit 26:** Update review comments This commit contains the following review comments: - #7545 (diff) - #7545 (diff) - #7545 (diff) - #7545 (diff) - #7545 (diff) - #7545 (diff) - #7545 (diff) - #7545 (diff) - #7545 (diff) * Original sha: db11a2d * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-18T14:09:22Z **Commit 27:** Update review comments The following review comments are included in the commit: - #7545 (comment) - #7545 (comment) - #7545 (comment) * Original sha: 8c39a8d * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-19T12:44:39Z **Commit 28:** Expose the i18n APIs in the server object for plugin access Plugins should call the i18n plugin APIs through the server object and not directly from the module. This closes he following comments: - #7545 (comment) - #7545 (comment) - #7545 (comment) * Original sha: a9e30d3 * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-19T17:31:10Z **Commit 29:** Update accept-language-parser module to 1.2.0 Module version 1.2.0 fixes issue: opentable/accept-language-parser#8 This commit updates review comments: #7545 (diff) #7545 (comment) * Original sha: da669da * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-30T17:49:23Z **Commit 30:** Add i18n default locale as a configurable item Adds 'defaultLocale' configurable item to the i18n plugin configuration. The default locale is used for translations if the locale specified by user is not supported. This commit satisfies the review comment: - #7545 (diff) * Original sha: 9064e8a * Authored by Martin Hickey <martin.hickey@ie.ibm.com> on 2016-08-31T10:42:52Z
|
when will this feature relased |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Kibana Globalization - Phase 1
Backports PR #7545
Commit 1:
Add low level i18n plugin
Manages languages that are available and is responsible for loading translated
content at the granularity of a plugin.
To be done:
Commit 2:
Use Kibana install as root for the translation store directory
Setting the path for storing the bundled language translation files to
<KIBANA_INSTALL>/data/store_translations/<PLUGIN_NAME>
Commit 3:
Updated i18n core plugin APIs to be asynchronous
To be done:
Commit 4:
Fix thread synchroization issue in storePluginLanguageTranslations
Commit 5:
Update error handling in i18n core plugin
Commit 6:
Change to use NodeJS mkdirp function for creating directories recursively
Updates with review comments from @srl295. Changed export syntax to show the
exported functions at end of file.
Commit 7:
Add REST API for getting translations of a language for a plugin
To be done:
from the REST call and the plugin supported languages
Commit 8:
Add algorithm for determining plugin language when retrieving translations
Client would pass languages used in the 'accept-language' header. These
languages would then be compared against the plugin supported languages
and best compared language would be selected.
To be done:
Commit 9:
Add API to return all registered plugin language translations
Commit 10:
Add HAPI API to get all plugins translation files
Commit 11:
Update register translations API to be independent of plugin name and language
The register API is updated to be independent of plugin name and language. The API will now
traverse the path given and create language bundles as per language files it traverses.
The translations files structure has also been simplified to be just key/value objects.
To be done:
Commit 12:
Update API test
Commit 13:
Add eslint fix for API test
Commit 14:
Update with review comments
From review #7545 (comment)
following comments updated:
by the grunt tasks. Also our convention is to name the test file with the same
name as the module it's testing (so i18n_tests.js should just be i18n.js)
Commit 15:
Update after review comments
From review (#7545 (comment)):
callbacks
(single language file, not split by view)
From design (#6515 (comment)):
TODO:
Commit 16:
Update after review comments
Updated write function to be asynchronous
Commit 17:
Update registerTranslations API to take absolute translation file as argument
The API originally took the directory as the argument but following reviews it
was decided to change to absolute file because it will be less brittle
since it is more explicit.
Commit 18:
Translate the Kibana welcome message
Translates the start-up message (“Kibana is loading ...”)in the Jade template.
To be done:
in the fixtures directory as static files. Need to be generated on the fly.
Commit 19:
Add build task to generate core plugin translations
Task which calls registerTranslations API and then a task which copies the
regsitered translations to <kibana_root>/build/kibana
Commit 20:
Add hook to optimize module to add registration during dev startup
Registration of the core plugin translations during development start of
Kibana server. The translations include the welcome message and server error
startup message.
Commit 21:
Handle scenario when the user preferred language header is not passed
The UI when loading asks i18n plugin which language translation to use
depending on the user preferred language header 'accept-language'.
This commit is to handle scenario where header is not passed. The algorithm
then chooses the default language.
Commit 22:
Replace registering of translations at plugin install time to the plugin init phase
This change follows review comments in:
#6515 (comment)
Commit 23:
Update after review comments
Comments:
Commit 24:
Update after plugin folder layout changes in Kibana
This require to use <kibana_root>/data for registered translations
and i18n plugin moved to core_plugins from plugins.
Refer to PR for more details:
#7562
Commit 25:
Update translation registration to file path rather than bundling
After review discussions it was agreed to just register the absolute paths
to translation files rather than bundling each file into one central file
at registration.
Commit 26:
Update review comments
This commit contains the following review comments:
Commit 27:
Update review comments
The following review comments are included in the commit:
Commit 28:
Expose the i18n APIs in the server object for plugin access
Plugins should call the i18n plugin APIs through the server object
and not directly from the module.
This closes he following comments:
Commit 29:
Update accept-language-parser module to 1.2.0
Module version 1.2.0 fixes issue:
opentable/accept-language-parser#8
This commit updates review comments:
#7545 (diff)
#7545 (comment)
Commit 30:
Add i18n default locale as a configurable item
Adds 'defaultLocale' configurable item to the i18n plugin configuration.
The default locale is used for translations if the locale specified by user
is not supported.
This commit satisfies the review comment: