{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/14650","labels_url":"https://api.github.com/repos/owncloud/core/issues/14650/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/14650/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/14650/events","html_url":"https://github.com/owncloud/core/pull/14650","id":59511681,"number":14650,"title":"Make getLanguageCode() return the current language when it's being forced","user":{"login":"nickvergessen","id":213943,"avatar_url":"https://avatars.githubusercontent.com/u/213943?v=3","gravatar_id":"","url":"https://api.github.com/users/nickvergessen","html_url":"https://github.com/nickvergessen","followers_url":"https://api.github.com/users/nickvergessen/followers","following_url":"https://api.github.com/users/nickvergessen/following{/other_user}","gists_url":"https://api.github.com/users/nickvergessen/gists{/gist_id}","starred_url":"https://api.github.com/users/nickvergessen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickvergessen/subscriptions","organizations_url":"https://api.github.com/users/nickvergessen/orgs","repos_url":"https://api.github.com/users/nickvergessen/repos","events_url":"https://api.github.com/users/nickvergessen/events{/privacy}","received_events_url":"https://api.github.com/users/nickvergessen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/5%20-%20To%20review","name":"5 - To review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/31","html_url":"https://github.com/owncloud/core/milestones/8.1-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/31/labels","id":912160,"number":31,"title":"8.1-current","description":"","creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":265,"closed_issues":250,"state":"open","created_at":"2014-12-22T12:04:01Z","updated_at":"2015-03-03T15:51:51Z","due_on":"2015-04-02T22:00:00Z","closed_at":null},"comments":7,"created_at":"2015-03-02T17:16:05Z","updated_at":"2015-03-03T16:22:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/14650","html_url":"https://github.com/owncloud/core/pull/14650","diff_url":"https://github.com/owncloud/core/pull/14650.diff","patch_url":"https://github.com/owncloud/core/pull/14650.patch"},"body":"The method has fooled me more then once already. The name implies behavior that is not given.\r\n\r\n3 Examples of what you would think:\r\n```php\r\n'de' === OC_L10N::get('lib', 'de')->getLanguageCode();\r\n'de' === (new \\OC\\L10N\\Factory())->get('lib', 'de')->getLanguageCode();\r\n'de' === \\OC::$server->getL10N('lib', 'de')->getLanguageCode();\r\n```\r\n\r\nHowever the old `getLanguageCode()` was more a `tryToFindTheCorrectLanguageForThisUserAndAGivenApp()` (always returns the personal language of the user instead of the one set via the constructor)\r\nThe only method that was using it in this way was `Util::addTranslations()`. I changed that method to use OC_L10N::findLanguage() directly, instead of creating an object and then call a method on the object which then calls `findLanguage()`.\r\n\r\n@DeepDiver1975 can we have this please? Otherwise I need to create a new method with a name that is close to similar which reflects the correct behaviour. No one should manually rely on this method in it's old way anyhow, since they can just keep `null` in the constructor and will have the old behaviour.\r\n\r\nFix owncloud/activity#145"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/76978221","html_url":"https://github.com/owncloud/core/pull/14650#issuecomment-76978221","issue_url":"https://api.github.com/repos/owncloud/core/issues/14650","id":76978221,"user":{"login":"nickvergessen","id":213943,"avatar_url":"https://avatars.githubusercontent.com/u/213943?v=3","gravatar_id":"","url":"https://api.github.com/users/nickvergessen","html_url":"https://github.com/nickvergessen","followers_url":"https://api.github.com/users/nickvergessen/followers","following_url":"https://api.github.com/users/nickvergessen/following{/other_user}","gists_url":"https://api.github.com/users/nickvergessen/gists{/gist_id}","starred_url":"https://api.github.com/users/nickvergessen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickvergessen/subscriptions","organizations_url":"https://api.github.com/users/nickvergessen/orgs","repos_url":"https://api.github.com/users/nickvergessen/repos","events_url":"https://api.github.com/users/nickvergessen/events{/privacy}","received_events_url":"https://api.github.com/users/nickvergessen/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T16:22:39Z","updated_at":"2015-03-03T16:22:39Z","body":"Rebased version passed at #14674\r\n@LukasReschke second +1"}}