{"action":"created","issue":{"url":"https://api.github.com/repos/zsigmondrab/liferay-portal/issues/123","labels_url":"https://api.github.com/repos/zsigmondrab/liferay-portal/issues/123/labels{/name}","comments_url":"https://api.github.com/repos/zsigmondrab/liferay-portal/issues/123/comments","events_url":"https://api.github.com/repos/zsigmondrab/liferay-portal/issues/123/events","html_url":"https://github.com/zsigmondrab/liferay-portal/pull/123","id":117745625,"number":123,"title":"[Technical Support] LPS-60636 Redirection does not happen for locals which are not in locales.enabled","user":{"login":"zxdgoal","id":4162471,"avatar_url":"https://avatars.githubusercontent.com/u/4162471?v=3","gravatar_id":"","url":"https://api.github.com/users/zxdgoal","html_url":"https://github.com/zxdgoal","followers_url":"https://api.github.com/users/zxdgoal/followers","following_url":"https://api.github.com/users/zxdgoal/following{/other_user}","gists_url":"https://api.github.com/users/zxdgoal/gists{/gist_id}","starred_url":"https://api.github.com/users/zxdgoal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zxdgoal/subscriptions","organizations_url":"https://api.github.com/users/zxdgoal/orgs","repos_url":"https://api.github.com/users/zxdgoal/repos","events_url":"https://api.github.com/users/zxdgoal/events{/privacy}","received_events_url":"https://api.github.com/users/zxdgoal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-19T05:39:29Z","updated_at":"2015-11-24T15:18:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zsigmondrab/liferay-portal/pulls/123","html_url":"https://github.com/zsigmondrab/liferay-portal/pull/123","diff_url":"https://github.com/zsigmondrab/liferay-portal/pull/123.diff","patch_url":"https://github.com/zsigmondrab/liferay-portal/pull/123.patch"},"body":"Hey Zsigmond\r\n\r\nThis works in Trunk but not in branch 6.2.\r\n\r\nThe issue for 6.2. is that in PortletBagFactory.java\r\n```\r\n\t\t\tif (supportedLanguageIds.isEmpty()) {\r\n\t\t\t\tsupportedLanguageIds = SetUtil.fromArray(PropsValues.LOCALES);\r\n\t\t\t}\r\n\r\n\t\t\tfor (String supportedLanguageId : supportedLanguageIds) {\r\n\t\t\t\tLocale locale = LocaleUtil.fromLanguageId(supportedLanguageId);\r\n\r\n\t\t\t\tinitResourceBundle(resourceBundles, portlet, locale);\r\n\t\t\t}\r\n```\r\n\r\nThese code add all locales in \"'locales\" in portal.properties into LocaleUtil.\r\n\r\nSo ``loacles.enabled`` does not even work for LocaleUtil.\r\n\r\nThese code are simply removed by Ray in Trunk\r\n\r\nBut I do not think it is safe to remove them in branch 6.2 as PortletBagFactory.java has been changed to get adapted to OSGI in Turnk\r\n\r\nBack to the issue.\r\n\r\nIs it safe to change ``PropsValues.LOCALES`` to ``PropsValues.LOCALES_ENABLE`` for 6.2?\r\n\r\nWhat the main difference between these two properties according their definitions?\r\n\r\nAnyway, the fix for trunk is free to go.\r\n\r\nThanks\r\nJohn"},"comment":{"url":"https://api.github.com/repos/zsigmondrab/liferay-portal/issues/comments/159301515","html_url":"https://github.com/zsigmondrab/liferay-portal/pull/123#issuecomment-159301515","issue_url":"https://api.github.com/repos/zsigmondrab/liferay-portal/issues/123","id":159301515,"user":{"login":"epgarcia","id":1579803,"avatar_url":"https://avatars.githubusercontent.com/u/1579803?v=3","gravatar_id":"","url":"https://api.github.com/users/epgarcia","html_url":"https://github.com/epgarcia","followers_url":"https://api.github.com/users/epgarcia/followers","following_url":"https://api.github.com/users/epgarcia/following{/other_user}","gists_url":"https://api.github.com/users/epgarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/epgarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epgarcia/subscriptions","organizations_url":"https://api.github.com/users/epgarcia/orgs","repos_url":"https://api.github.com/users/epgarcia/repos","events_url":"https://api.github.com/users/epgarcia/events{/privacy}","received_events_url":"https://api.github.com/users/epgarcia/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T15:18:52Z","updated_at":"2015-11-24T15:18:52Z","body":"Hi @zxdgoal,\r\n\r\nThe LOCALES_ENABLE property contains only the locales enabled by default, as a subset of the LOCALES. But the enabled locales can be modified from those default values for every portal instance through the UI (Portal Configuration -> Display Settings). In other words, you shouldn't perform any action based on the LOCALES_ENABLE property, except loading the portal instance default enabled locales the first time (See [LanguageImpl](https://github.com/liferay/liferay-portal/blob/1c9fd4fc9edd3791838c62169372d019ce566fbc/portal-impl/src/com/liferay/portal/language/LanguageImpl.java#L1039)). \r\n\r\nCould not we simply redirect to default if LanguageUtil.isAvailableLocale(group, urlLocale) is false?\r\n\r\nThanks!"}}