{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/59020996","id":59020996,"diff_hunk":"@@ -146,43 +146,42 @@ - (void)createSynthesizer\n \n - (void)createVoice:(NSString *)locale\n {\n-  if (!locale)\n-  {\n-    LOG(LERROR, (\"locale is nil. Trying default locale.\"));\n-    locale = DEFAULT_LANG;\n-  }\n+  NSMutableArray<NSString *> * candidateLocales = [@[AVSpeechSynthesisVoiceIdentifierAlex, DEFAULT_LANG] mutableCopy];\n \n-  if (!(isIOS7 || isIOS8) && [locale isEqualToString:DEFAULT_LANG])\n-    locale = AVSpeechSynthesisVoiceIdentifierAlex;\n+  if (locale)\n+    [candidateLocales insertObject:locale atIndex:0];\n+  else\n+    LOG(LERROR, (\"locale is nil. Trying default locale.\"));\n \n-  NSArray * availTTSLangs = [AVSpeechSynthesisVoice speechVoices];\n-  \n-  if (!availTTSLangs)\n-  {\n-    LOG(LERROR, (\"No languages for TTS. MWMTextFoSpeech is invalid.\"));\n-    return; // self is not valid.\n-  }\n-  \n-  AVSpeechSynthesisVoice * voice = [AVSpeechSynthesisVoice voiceWithLanguage:locale];\n-  if (!voice || ![availTTSLangs containsObject:voice])\n+  NSArray<AVSpeechSynthesisVoice *> * availTTSVoices = [AVSpeechSynthesisVoice speechVoices];\n+  AVSpeechSynthesisVoice * voice = nil;\n+  for(NSString * loc in candidateLocales)","path":"iphone/Maps/Classes/CustomViews/NavigationDashboard/Sound/MWMTextToSpeech.mm","position":39,"original_position":39,"commit_id":"7960dfcb2607af36554ac5ad3daeda97ab5fd467","original_commit_id":"7960dfcb2607af36554ac5ad3daeda97ab5fd467","user":{"login":"VladiMihaylenko","id":6297856,"avatar_url":"https://avatars.githubusercontent.com/u/6297856?v=3","gravatar_id":"","url":"https://api.github.com/users/VladiMihaylenko","html_url":"https://github.com/VladiMihaylenko","followers_url":"https://api.github.com/users/VladiMihaylenko/followers","following_url":"https://api.github.com/users/VladiMihaylenko/following{/other_user}","gists_url":"https://api.github.com/users/VladiMihaylenko/gists{/gist_id}","starred_url":"https://api.github.com/users/VladiMihaylenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladiMihaylenko/subscriptions","organizations_url":"https://api.github.com/users/VladiMihaylenko/orgs","repos_url":"https://api.github.com/users/VladiMihaylenko/repos","events_url":"https://api.github.com/users/VladiMihaylenko/events{/privacy}","received_events_url":"https://api.github.com/users/VladiMihaylenko/received_events","type":"User","site_admin":false},"body":"for (...)","created_at":"2016-04-08T13:03:05Z","updated_at":"2016-04-08T13:03:05Z","html_url":"https://github.com/mapsme/omim/pull/2851#discussion_r59020996","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/2851","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/59020996"},"html":{"href":"https://github.com/mapsme/omim/pull/2851#discussion_r59020996"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/2851"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/2851","id":65782663,"html_url":"https://github.com/mapsme/omim/pull/2851","diff_url":"https://github.com/mapsme/omim/pull/2851.diff","patch_url":"https://github.com/mapsme/omim/pull/2851.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/2851","number":2851,"state":"open","locked":false,"title":"[ios] Changed tts voice creation.","user":{"login":"igrechuhin","id":2698571,"avatar_url":"https://avatars.githubusercontent.com/u/2698571?v=3","gravatar_id":"","url":"https://api.github.com/users/igrechuhin","html_url":"https://github.com/igrechuhin","followers_url":"https://api.github.com/users/igrechuhin/followers","following_url":"https://api.github.com/users/igrechuhin/following{/other_user}","gists_url":"https://api.github.com/users/igrechuhin/gists{/gist_id}","starred_url":"https://api.github.com/users/igrechuhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igrechuhin/subscriptions","organizations_url":"https://api.github.com/users/igrechuhin/orgs","repos_url":"https://api.github.com/users/igrechuhin/repos","events_url":"https://api.github.com/users/igrechuhin/events{/privacy}","received_events_url":"https://api.github.com/users/igrechuhin/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-08T13:02:03Z","updated_at":"2016-04-08T13:03:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74745e46c40eecf909524e10f31ab029ee599986","assignee":{"login":"bykoianko","id":1768114,"avatar_url":"https://avatars.githubusercontent.com/u/1768114?v=3","gravatar_id":"","url":"https://api.github.com/users/bykoianko","html_url":"https://github.com/bykoianko","followers_url":"https://api.github.com/users/bykoianko/followers","following_url":"https://api.github.com/users/bykoianko/following{/other_user}","gists_url":"https://api.github.com/users/bykoianko/gists{/gist_id}","starred_url":"https://api.github.com/users/bykoianko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bykoianko/subscriptions","organizations_url":"https://api.github.com/users/bykoianko/orgs","repos_url":"https://api.github.com/users/bykoianko/repos","events_url":"https://api.github.com/users/bykoianko/events{/privacy}","received_events_url":"https://api.github.com/users/bykoianko/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/2851/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/2851/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/2851/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/7960dfcb2607af36554ac5ad3daeda97ab5fd467","head":{"label":"igrechuhin:tts","ref":"tts","sha":"7960dfcb2607af36554ac5ad3daeda97ab5fd467","user":{"login":"igrechuhin","id":2698571,"avatar_url":"https://avatars.githubusercontent.com/u/2698571?v=3","gravatar_id":"","url":"https://api.github.com/users/igrechuhin","html_url":"https://github.com/igrechuhin","followers_url":"https://api.github.com/users/igrechuhin/followers","following_url":"https://api.github.com/users/igrechuhin/following{/other_user}","gists_url":"https://api.github.com/users/igrechuhin/gists{/gist_id}","starred_url":"https://api.github.com/users/igrechuhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igrechuhin/subscriptions","organizations_url":"https://api.github.com/users/igrechuhin/orgs","repos_url":"https://api.github.com/users/igrechuhin/repos","events_url":"https://api.github.com/users/igrechuhin/events{/privacy}","received_events_url":"https://api.github.com/users/igrechuhin/received_events","type":"User","site_admin":false},"repo":{"id":43428422,"name":"omim","full_name":"igrechuhin/omim","owner":{"login":"igrechuhin","id":2698571,"avatar_url":"https://avatars.githubusercontent.com/u/2698571?v=3","gravatar_id":"","url":"https://api.github.com/users/igrechuhin","html_url":"https://github.com/igrechuhin","followers_url":"https://api.github.com/users/igrechuhin/followers","following_url":"https://api.github.com/users/igrechuhin/following{/other_user}","gists_url":"https://api.github.com/users/igrechuhin/gists{/gist_id}","starred_url":"https://api.github.com/users/igrechuhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igrechuhin/subscriptions","organizations_url":"https://api.github.com/users/igrechuhin/orgs","repos_url":"https://api.github.com/users/igrechuhin/repos","events_url":"https://api.github.com/users/igrechuhin/events{/privacy}","received_events_url":"https://api.github.com/users/igrechuhin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/igrechuhin/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/igrechuhin/omim","forks_url":"https://api.github.com/repos/igrechuhin/omim/forks","keys_url":"https://api.github.com/repos/igrechuhin/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/igrechuhin/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/igrechuhin/omim/teams","hooks_url":"https://api.github.com/repos/igrechuhin/omim/hooks","issue_events_url":"https://api.github.com/repos/igrechuhin/omim/issues/events{/number}","events_url":"https://api.github.com/repos/igrechuhin/omim/events","assignees_url":"https://api.github.com/repos/igrechuhin/omim/assignees{/user}","branches_url":"https://api.github.com/repos/igrechuhin/omim/branches{/branch}","tags_url":"https://api.github.com/repos/igrechuhin/omim/tags","blobs_url":"https://api.github.com/repos/igrechuhin/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/igrechuhin/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/igrechuhin/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/igrechuhin/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/igrechuhin/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/igrechuhin/omim/languages","stargazers_url":"https://api.github.com/repos/igrechuhin/omim/stargazers","contributors_url":"https://api.github.com/repos/igrechuhin/omim/contributors","subscribers_url":"https://api.github.com/repos/igrechuhin/omim/subscribers","subscription_url":"https://api.github.com/repos/igrechuhin/omim/subscription","commits_url":"https://api.github.com/repos/igrechuhin/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/igrechuhin/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/igrechuhin/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/igrechuhin/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/igrechuhin/omim/contents/{+path}","compare_url":"https://api.github.com/repos/igrechuhin/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/igrechuhin/omim/merges","archive_url":"https://api.github.com/repos/igrechuhin/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/igrechuhin/omim/downloads","issues_url":"https://api.github.com/repos/igrechuhin/omim/issues{/number}","pulls_url":"https://api.github.com/repos/igrechuhin/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/igrechuhin/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/igrechuhin/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/igrechuhin/omim/labels{/name}","releases_url":"https://api.github.com/repos/igrechuhin/omim/releases{/id}","deployments_url":"https://api.github.com/repos/igrechuhin/omim/deployments","created_at":"2015-09-30T11:08:48Z","updated_at":"2015-09-30T11:10:58Z","pushed_at":"2016-04-08T13:01:04Z","git_url":"git://github.com/igrechuhin/omim.git","ssh_url":"git@github.com:igrechuhin/omim.git","clone_url":"https://github.com/igrechuhin/omim.git","svn_url":"https://github.com/igrechuhin/omim","homepage":null,"size":2295131,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"mapsme:master","ref":"master","sha":"21c553c671e2eef0369780eb47887a08e86af377","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-04-08T10:07:41Z","pushed_at":"2016-04-08T13:02:04Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2338393,"stargazers_count":1711,"watchers_count":1711,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":253,"mirror_url":null,"open_issues_count":130,"forks":253,"open_issues":130,"watchers":1711,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/2851"},"html":{"href":"https://github.com/mapsme/omim/pull/2851"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/2851"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/2851/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/2851/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/2851/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/7960dfcb2607af36554ac5ad3daeda97ab5fd467"}}}}