{"action":"created","comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments/128875726","pull_request_review_id":51601240,"id":128875726,"diff_hunk":"@@ -1128,9 +1128,68 @@ - (void)wakeGL:(__unused NSNotification *)notification\n         [self validateLocationServices];\n \n         [MGLMapboxEvents pushEvent:MGLEventTypeMapLoad withAttributes:@{}];\n+        \n+        [self updateLocalization];\n+    }\n+}\n+\n+- (void)updateLocalization\n+{\n+    NSString *mapboxLanguage = [[NSUserDefaults standardUserDefaults] stringForKey:@\"MGLMapboxLanguage\"];\n+    NSString *language = [[[NSBundle mainBundle] preferredLocalizations] firstObject];\n+    NSString *preferredLanguageCode = [self preferredLanguageCode];\n+    \n+    if (![mapboxLanguage isEqualToString:language] && ![mapboxLanguage isEqualToString:preferredLanguageCode]) {\n+        mapboxLanguage = preferredLanguageCode;\n+        [[NSUserDefaults standardUserDefaults] setObject:mapboxLanguage forKey:@\"MGLMapboxLanguage\"];\n+        [self setLabelLanguage:mapboxLanguage];\n+        [[NSNotificationCenter defaultCenter] postNotificationName:NSCurrentLocaleDidChangeNotification object:nil];","path":"platform/ios/src/MGLMapView.mm","position":19,"original_position":19,"commit_id":"9b753368a1bb082e37613d4cc8a13c11c55f98b6","original_commit_id":"9b753368a1bb082e37613d4cc8a13c11c55f98b6","user":{"login":"fabian-guerra","id":2745166,"avatar_url":"https://avatars2.githubusercontent.com/u/2745166?v=4","gravatar_id":"","url":"https://api.github.com/users/fabian-guerra","html_url":"https://github.com/fabian-guerra","followers_url":"https://api.github.com/users/fabian-guerra/followers","following_url":"https://api.github.com/users/fabian-guerra/following{/other_user}","gists_url":"https://api.github.com/users/fabian-guerra/gists{/gist_id}","starred_url":"https://api.github.com/users/fabian-guerra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabian-guerra/subscriptions","organizations_url":"https://api.github.com/users/fabian-guerra/orgs","repos_url":"https://api.github.com/users/fabian-guerra/repos","events_url":"https://api.github.com/users/fabian-guerra/events{/privacy}","received_events_url":"https://api.github.com/users/fabian-guerra/received_events","type":"User","site_admin":false},"body":"@friedbunny I agree on posting a Mapbox scoped notification. Changing the language preferences makes the OS to restart, we don't get this notification `NSCurrentLocaleDidChangeNotification`","created_at":"2017-07-21T22:49:26Z","updated_at":"2017-07-21T22:49:26Z","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/9582#discussion_r128875726","pull_request_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/9582","_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments/128875726"},"html":{"href":"https://github.com/mapbox/mapbox-gl-native/pull/9582#discussion_r128875726"},"pull_request":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/9582"}}},"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/9582","id":131860459,"html_url":"https://github.com/mapbox/mapbox-gl-native/pull/9582","diff_url":"https://github.com/mapbox/mapbox-gl-native/pull/9582.diff","patch_url":"https://github.com/mapbox/mapbox-gl-native/pull/9582.patch","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/9582","number":9582,"state":"open","locked":false,"title":"[ios] adapt Mapbox Streets–sourced layers for user preferred language","user":{"login":"fabian-guerra","id":2745166,"avatar_url":"https://avatars2.githubusercontent.com/u/2745166?v=4","gravatar_id":"","url":"https://api.github.com/users/fabian-guerra","html_url":"https://github.com/fabian-guerra","followers_url":"https://api.github.com/users/fabian-guerra/followers","following_url":"https://api.github.com/users/fabian-guerra/following{/other_user}","gists_url":"https://api.github.com/users/fabian-guerra/gists{/gist_id}","starred_url":"https://api.github.com/users/fabian-guerra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabian-guerra/subscriptions","organizations_url":"https://api.github.com/users/fabian-guerra/orgs","repos_url":"https://api.github.com/users/fabian-guerra/repos","events_url":"https://api.github.com/users/fabian-guerra/events{/privacy}","received_events_url":"https://api.github.com/users/fabian-guerra/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/mapbox/mapbox-gl-native/issues/7031\r\nWIP: Since trying to listen for notifications doesn't warranties the method will be called I decided to implement it during initialization (tho right know is only when you enter foreground). Load a variable with the previous language and if it has changed then update the labels. Also I'm posting the general notification to let devs know about the map localization changes. Also I re-used the code we had in the examples.","created_at":"2017-07-21T21:18:04Z","updated_at":"2017-07-21T22:49:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6dc823d836d155082df5f6923db820fe0bae3400","assignee":null,"assignees":[],"requested_reviewers":[{"login":"boundsj","id":63186,"avatar_url":"https://avatars2.githubusercontent.com/u/63186?v=4","gravatar_id":"","url":"https://api.github.com/users/boundsj","html_url":"https://github.com/boundsj","followers_url":"https://api.github.com/users/boundsj/followers","following_url":"https://api.github.com/users/boundsj/following{/other_user}","gists_url":"https://api.github.com/users/boundsj/gists{/gist_id}","starred_url":"https://api.github.com/users/boundsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boundsj/subscriptions","organizations_url":"https://api.github.com/users/boundsj/orgs","repos_url":"https://api.github.com/users/boundsj/repos","events_url":"https://api.github.com/users/boundsj/events{/privacy}","received_events_url":"https://api.github.com/users/boundsj/received_events","type":"User","site_admin":false},{"login":"1ec5","id":1231218,"avatar_url":"https://avatars0.githubusercontent.com/u/1231218?v=4","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/9582/commits","review_comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/9582/comments","review_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/9582/comments","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/9b753368a1bb082e37613d4cc8a13c11c55f98b6","head":{"label":"mapbox:fabian-adapt-user-language-7031","ref":"fabian-adapt-user-language-7031","sha":"9b753368a1bb082e37613d4cc8a13c11c55f98b6","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16286131,"name":"mapbox-gl-native","full_name":"mapbox/mapbox-gl-native","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-native","description":"Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/deployments","created_at":"2014-01-27T17:14:48Z","updated_at":"2017-07-21T18:58:46Z","pushed_at":"2017-07-21T21:26:16Z","git_url":"git://github.com/mapbox/mapbox-gl-native.git","ssh_url":"git@github.com:mapbox/mapbox-gl-native.git","clone_url":"https://github.com/mapbox/mapbox-gl-native.git","svn_url":"https://github.com/mapbox/mapbox-gl-native","homepage":"https://mapbox.com/mobile","size":171646,"stargazers_count":1995,"watchers_count":1995,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":630,"mirror_url":null,"open_issues_count":606,"forks":630,"open_issues":606,"watchers":1995,"default_branch":"master"}},"base":{"label":"mapbox:release-ios-v3.6.0-android-v5.1.0","ref":"release-ios-v3.6.0-android-v5.1.0","sha":"7aad3613c3549ae5f4388fcbeef969e13274892b","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16286131,"name":"mapbox-gl-native","full_name":"mapbox/mapbox-gl-native","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-native","description":"Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/deployments","created_at":"2014-01-27T17:14:48Z","updated_at":"2017-07-21T18:58:46Z","pushed_at":"2017-07-21T21:26:16Z","git_url":"git://github.com/mapbox/mapbox-gl-native.git","ssh_url":"git@github.com:mapbox/mapbox-gl-native.git","clone_url":"https://github.com/mapbox/mapbox-gl-native.git","svn_url":"https://github.com/mapbox/mapbox-gl-native","homepage":"https://mapbox.com/mobile","size":171646,"stargazers_count":1995,"watchers_count":1995,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":630,"mirror_url":null,"open_issues_count":606,"forks":630,"open_issues":606,"watchers":1995,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/9582"},"html":{"href":"https://github.com/mapbox/mapbox-gl-native/pull/9582"},"issue":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/9582"},"comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/9582/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/9582/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/9582/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/9b753368a1bb082e37613d4cc8a13c11c55f98b6"}}}}
{"actor":{"display_login":"fabian-guerra"}}