{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/73167577","id":73167577,"diff_hunk":"@@ -8,6 +8,13 @@ import UiExports from './ui_exports';\n import UiBundle from './ui_bundle';\n import UiBundleCollection from './ui_bundle_collection';\n import UiBundlerEnv from './ui_bundler_env';\n+import i18nPlugin from '../plugins/i18n/server/i18n/index';\n+import langParser from 'accept-language-parser';\n+\n+let kibanaTranslations = [];\n+let acceptLanguages = '';\n+\n+const DEFAULT_LANGUAGE = 'en';","path":"src/ui/index.js","position":10,"original_position":10,"commit_id":"aefbd937e030e7ed71ccb93b20f3c6be5fda0179","original_commit_id":"aefbd937e030e7ed71ccb93b20f3c6be5fda0179","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},"body":"Good point, it is not explicitly defined in the design doc. Comment added to [doc](https://github.com/elastic/kibana/issues/6515#issuecomment-236924815). Will be added to the doc accordingly.","created_at":"2016-08-02T14:40:21Z","updated_at":"2016-08-02T14:40:21Z","html_url":"https://github.com/elastic/kibana/pull/7545#discussion_r73167577","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/7545","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/73167577"},"html":{"href":"https://github.com/elastic/kibana/pull/7545#discussion_r73167577"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7545"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/7545","id":75133774,"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","issue_url":"https://api.github.com/repos/elastic/kibana/issues/7545","number":7545,"state":"open","locked":false,"title":"[wip] i18n Plugin","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},"body":"i18n Plugin\r\n-----------\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`kibana-en.json`\r\n\r\n```json \r\n    {\r\n        \"CORE-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        \"CORE-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    -   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    -   Fetch the list of currently supported languages:\r\n        -   *getRegisteredTranslationLanguages()*\r\n        -   Returns a list of all languages as language codes for which translations are registered\r\n    -   Fetch a specific language translated content bundle:\r\n        -   *getRegisteredLanguageTranslations(\\<language\\_code\\>)*\r\n        -   Returns a JSON object of all registered translations for the language code specified\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    -   Plugin Unit tests \r\n    -   Jade template verification of translation strings:\r\n        -   Enforce a pattern to be used. For example a `translate(<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.","created_at":"2016-06-24T15:45:50Z","updated_at":"2016-08-02T14:40:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7352ddb351fbb73e8fe2ea969534ce650c204653","assignee":{"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},"assignees":[{"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,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/7545/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/7545/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/7545/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/aefbd937e030e7ed71ccb93b20f3c6be5fda0179","head":{"label":"hickeyma:i18n_core_plugin","ref":"i18n_core_plugin","sha":"aefbd937e030e7ed71ccb93b20f3c6be5fda0179","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},"repo":{"id":61562949,"name":"kibana","full_name":"hickeyma/kibana","owner":{"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},"private":false,"html_url":"https://github.com/hickeyma/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":true,"url":"https://api.github.com/repos/hickeyma/kibana","forks_url":"https://api.github.com/repos/hickeyma/kibana/forks","keys_url":"https://api.github.com/repos/hickeyma/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hickeyma/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hickeyma/kibana/teams","hooks_url":"https://api.github.com/repos/hickeyma/kibana/hooks","issue_events_url":"https://api.github.com/repos/hickeyma/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/hickeyma/kibana/events","assignees_url":"https://api.github.com/repos/hickeyma/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/hickeyma/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/hickeyma/kibana/tags","blobs_url":"https://api.github.com/repos/hickeyma/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hickeyma/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hickeyma/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/hickeyma/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hickeyma/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/hickeyma/kibana/languages","stargazers_url":"https://api.github.com/repos/hickeyma/kibana/stargazers","contributors_url":"https://api.github.com/repos/hickeyma/kibana/contributors","subscribers_url":"https://api.github.com/repos/hickeyma/kibana/subscribers","subscription_url":"https://api.github.com/repos/hickeyma/kibana/subscription","commits_url":"https://api.github.com/repos/hickeyma/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/hickeyma/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/hickeyma/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/hickeyma/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/hickeyma/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/hickeyma/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hickeyma/kibana/merges","archive_url":"https://api.github.com/repos/hickeyma/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hickeyma/kibana/downloads","issues_url":"https://api.github.com/repos/hickeyma/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/hickeyma/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/hickeyma/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/hickeyma/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hickeyma/kibana/labels{/name}","releases_url":"https://api.github.com/repos/hickeyma/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/hickeyma/kibana/deployments","created_at":"2016-06-20T16:28:01Z","updated_at":"2016-06-20T16:28:05Z","pushed_at":"2016-07-29T10:57:05Z","git_url":"git://github.com/hickeyma/kibana.git","ssh_url":"git@github.com:hickeyma/kibana.git","clone_url":"https://github.com/hickeyma/kibana.git","svn_url":"https://github.com/hickeyma/kibana","homepage":"https://www.elastic.co/products/kibana","size":182330,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"20ba4691790f27c843e91fdefb6fd6d9801e7f25","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2016-08-02T13:18:48Z","pushed_at":"2016-08-02T13:57:51Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":234667,"stargazers_count":5737,"watchers_count":5737,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2110,"mirror_url":null,"open_issues_count":1122,"forks":2110,"open_issues":1122,"watchers":5737,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7545"},"html":{"href":"https://github.com/elastic/kibana/pull/7545"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/7545"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/7545/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7545/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7545/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/aefbd937e030e7ed71ccb93b20f3c6be5fda0179"}}}}
{"actor":{"display_login":"hickeyma"}}