{"action":"created","issue":{"url":"https://api.github.com/repos/WebGoat/WebGoat/issues/289","repository_url":"https://api.github.com/repos/WebGoat/WebGoat","labels_url":"https://api.github.com/repos/WebGoat/WebGoat/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/WebGoat/WebGoat/issues/289/comments","events_url":"https://api.github.com/repos/WebGoat/WebGoat/issues/289/events","html_url":"https://github.com/WebGoat/WebGoat/pull/289","id":191274192,"number":289,"title":"Issue #265: Created LabelService to support UI localization","user":{"login":"zupzup","id":942652,"avatar_url":"https://avatars.githubusercontent.com/u/942652?v=3","gravatar_id":"","url":"https://api.github.com/users/zupzup","html_url":"https://github.com/zupzup","followers_url":"https://api.github.com/users/zupzup/followers","following_url":"https://api.github.com/users/zupzup/following{/other_user}","gists_url":"https://api.github.com/users/zupzup/gists{/gist_id}","starred_url":"https://api.github.com/users/zupzup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zupzup/subscriptions","organizations_url":"https://api.github.com/users/zupzup/orgs","repos_url":"https://api.github.com/users/zupzup/repos","events_url":"https://api.github.com/users/zupzup/events{/privacy}","received_events_url":"https://api.github.com/users/zupzup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-23T13:45:20Z","updated_at":"2016-11-23T13:49:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/WebGoat/WebGoat/pulls/289","html_url":"https://github.com/WebGoat/WebGoat/pull/289","diff_url":"https://github.com/WebGoat/WebGoat/pull/289.diff","patch_url":"https://github.com/WebGoat/WebGoat/pull/289.patch"},"body":"**Fixes**  #265\r\n\r\nThis is a basic implementation for a **LabelService**, which can be used by the UI to fetch all labels in order to implement i18n on the client.\r\n\r\nIf no language is specified in the request, the service checks the locale in the request header and takes that instead. If everything else fails, it will just provide the labels of the fallback language.\r\n\r\nIn order to do this, I had to extend the **ReloadableResourceBundleMessageSource**, as the built-in **MessageSource** doesn't support retrieving all messages at once.\r\n\r\nI also fixed a small bug in **LabelProvider**, which always used the fallback language, even if the given language was supported.\r\n\r\n**Testing:**\r\n\r\nThe Service is accessible at **service/labels.mvc** after logging in (if the labels should be fetched before login, there would beed to be an exception for this route in WebSecurityConfig).\r\n\r\nSimply calling the service will provide a map with the labels for the current Browser locale.\r\n\r\nCalling the service with the **lang**-parameter (e.g.: **service/labels.mvc?lang=de**), will return the labels for the given language (however, at the moment, the labels especially in the plugins are not fully translated, so most of them are english anyway, but there are some german ones in there :))\r\n\r\nIf the service is called with lang=\"\", lang=\"someUnsupportedLanguage\" or lang=\"someNonsense\", the default language (english) is used to generate the labels.\r\n\r\nThe output is a simple JSON map, which can easily be used by the UI, e.g.:\r\n\r\n```javascript\r\n{\r\n    \"EnterYourName\": \"Enter your Name\"\r\n    ...\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/WebGoat/WebGoat/issues/comments/262517129","html_url":"https://github.com/WebGoat/WebGoat/pull/289#issuecomment-262517129","issue_url":"https://api.github.com/repos/WebGoat/WebGoat/issues/289","id":262517129,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T13:49:41Z","updated_at":"2016-11-23T13:49:41Z","body":"\n[![Coverage Status](https://coveralls.io/builds/8965429/badge)](https://coveralls.io/builds/8965429)\n\nCoverage increased (+0.02%) to 3.085% when pulling **6acd149e5fdea61e9f379e513b921de40530893f on zupzup:feature/labelservice** into **4940a12d0d62da598a207dd2c8ce0e7964d4d439 on WebGoat:develop**.\n"}}
{"actor":{"display_login":"coveralls"}}