{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/kibana/issues/7545","repository_url":"https://api.github.com/repos/elastic/kibana","labels_url":"https://api.github.com/repos/elastic/kibana/issues/7545/labels{/name}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/7545/comments","events_url":"https://api.github.com/repos/elastic/kibana/issues/7545/events","html_url":"https://github.com/elastic/kibana/pull/7545","id":162175179,"number":7545,"title":"Kibana Globalization - Phase 1","user":{"login":"hickeyma","id":14892004,"avatar_url":"https://avatars.githubusercontent.com/u/14892004?v=3","gravatar_id":"","url":"https://api.github.com/users/hickeyma","html_url":"https://github.com/hickeyma","followers_url":"https://api.github.com/users/hickeyma/followers","following_url":"https://api.github.com/users/hickeyma/following{/other_user}","gists_url":"https://api.github.com/users/hickeyma/gists{/gist_id}","starred_url":"https://api.github.com/users/hickeyma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hickeyma/subscriptions","organizations_url":"https://api.github.com/users/hickeyma/orgs","repos_url":"https://api.github.com/users/hickeyma/repos","events_url":"https://api.github.com/users/hickeyma/events{/privacy}","received_events_url":"https://api.github.com/users/hickeyma/received_events","type":"User","site_admin":false},"labels":[{"id":199189293,"url":"https://api.github.com/repos/elastic/kibana/labels/needs%20updates","name":"needs updates","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":{"login":"spalger","id":1329312,"avatar_url":"https://avatars.githubusercontent.com/u/1329312?v=3","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false},"assignees":[{"login":"spalger","id":1329312,"avatar_url":"https://avatars.githubusercontent.com/u/1329312?v=3","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false},{"login":"Bargs","id":6239176,"avatar_url":"https://avatars.githubusercontent.com/u/6239176?v=3","gravatar_id":"","url":"https://api.github.com/users/Bargs","html_url":"https://github.com/Bargs","followers_url":"https://api.github.com/users/Bargs/followers","following_url":"https://api.github.com/users/Bargs/following{/other_user}","gists_url":"https://api.github.com/users/Bargs/gists{/gist_id}","starred_url":"https://api.github.com/users/Bargs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bargs/subscriptions","organizations_url":"https://api.github.com/users/Bargs/orgs","repos_url":"https://api.github.com/users/Bargs/repos","events_url":"https://api.github.com/users/Bargs/events{/privacy}","received_events_url":"https://api.github.com/users/Bargs/received_events","type":"User","site_admin":false}],"milestone":null,"comments":83,"created_at":"2016-06-24T15:45:50Z","updated_at":"2016-12-02T15:31:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/7545","html_url":"https://github.com/elastic/kibana/pull/7545","diff_url":"https://github.com/elastic/kibana/pull/7545.diff","patch_url":"https://github.com/elastic/kibana/pull/7545.patch"},"body":"***Phase 1***\r\n-------------\r\n\r\n### Purpose\r\n-   Implement the i18n plugin which provides a means to supply translations in a standard format that it not dependent on a localization framework\r\n-   Translate the Kibana welcome message which proves that the i18n plugin provides translations as registered for Kibana\r\n\r\n### Decide Language for Translation Algorithm\r\n-   The algorithm which decides the language for loading translations is as follows:\r\n    1.    First, do a direct comparison with the highest priority locale in the HTTP header “accept-language” against the registered translation languages. If comparison found then this is the language returned.\r\n    2.   Next, do a partial comparison of this locale whereby you try and get a language code comparison against the registered translation languages. For example, \"fr\" or \"fr-FR\" is used for all regions of French if comparison applies. If comparison found then this is the language returned.\r\n    3.   Next, repeat step 2 and if need be step 3 for the next highest priority locale in the  “accept-language” list. \r\n    4.   Continue, until match found in step 2/step 3 or end of the “accept-language” list. If no match found then return empty language.\r\n-   Deliverable:\r\n    -   As per the i18n plugin\r\n\r\n### i18n Plugin\r\n-   Manages the language translations for Kibana\r\n-   Responsible for loading translated content per language\r\n-   The translations file are JSON files with a flat keyspace, where the keys are unique. This uniqueness between translation plugins could be achieved by prefixing the keys with the plugin name. The key signifies the translation ID which would be referenced in translatable files (like JS, HTML etc.).\r\n-   The key value is the translation string\r\n\r\n-   Example translation JSON file\r\n\r\n`en.json`\r\n\r\n```json \r\n    {\r\n        \"KIBANA-WELCOME_MESSAGE\": \"is loading. Give me a moment here. I'm loading a whole bunch of code. Don't worry, all this good stuff will be cached up for next time!\",\r\n        \"KIBANA-WELCOME_ERROR\": \"Kibana did not load properly. Check the server output for more information.\"\r\n    }\r\n```\r\n\r\n-   Core Kibana plugins like ‘kibana’ and ‘status\\_page’ could come with their own English translations bundled in\r\n-   API:    \r\n    -   Return all translations registered for the default locale:\r\n        -   *getTranslationsForDefaultLocale()*\r\n        -   A Promise object which will contain on resolve a JSON object of all registered translations\r\n    -   Returns list of all registered locales:\r\n        -   *getRegisteredTranslationLocales()*\r\n        -   A string array of registered locales\r\n    -   Return translations for a suitable locale from a user side locale list:\r\n        -   *getTranslations(...languageTags)*\r\n        -   A Promise object which will contain on resolve a JSON object\r\n        -   This object will contain all registered translations for the highest priority locale which is registered with the i18n module\r\n        -   This object can be empty if no locale in the language tags can be matched against the registered locales\r\n    -   Register translations:\r\n        -   *registerTranslations(\\<absolute_path_to_translation_file\\>)*\r\n        -   The path to the translation file is registered with i18n plugin    -   \r\n    -   Set the default locale:\r\n        -    *setDefaultLocale(locale)*\r\n        -    Locale to set\r\n-   Deliverable:\r\n    -   Translate the start-up message (“Kibana is loading ...”)in the Jade template\r\n        ([*https://github.com/elastic/kibana/blob/master/src/ui/views/ui\\_app.jade*](https://github.com/elastic/kibana/blob/master/src/ui/views/ui_app.jade))\r\n    -   Translation message will be loaded using the language as per the deciding algorithm. For phase 1 the default 'en' langauge will be used.\r\n    -   Plugin Unit tests \r\n    -   Jade template verification of translation strings:\r\n        -   Enforce a pattern to be used. For example a `i18n(<key>)` function in the Jade template. A tool can then be used to find such pattern and extract the keys to file.\r\n        -   The keys in the key file(s) would then be checked against the language translation files registered\r\n    -   Core plugin registers its translation file during the initialization phase. The translation file contains strings for the welcome message and the start-up error message."},"comment":{"url":"https://api.github.com/repos/elastic/kibana/issues/comments/264481027","html_url":"https://github.com/elastic/kibana/pull/7545#issuecomment-264481027","issue_url":"https://api.github.com/repos/elastic/kibana/issues/7545","id":264481027,"user":{"login":"hickeyma","id":14892004,"avatar_url":"https://avatars.githubusercontent.com/u/14892004?v=3","gravatar_id":"","url":"https://api.github.com/users/hickeyma","html_url":"https://github.com/hickeyma","followers_url":"https://api.github.com/users/hickeyma/followers","following_url":"https://api.github.com/users/hickeyma/following{/other_user}","gists_url":"https://api.github.com/users/hickeyma/gists{/gist_id}","starred_url":"https://api.github.com/users/hickeyma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hickeyma/subscriptions","organizations_url":"https://api.github.com/users/hickeyma/orgs","repos_url":"https://api.github.com/users/hickeyma/repos","events_url":"https://api.github.com/users/hickeyma/events{/privacy}","received_events_url":"https://api.github.com/users/hickeyma/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T15:31:15Z","updated_at":"2016-12-02T15:31:15Z","body":"Ok, thanks @epixa. Sorry for being naughty! :-)"}}
{"actor":{"display_login":"hickeyma"}}