Closed Bug 1237149 Opened 10 years ago Closed 10 years ago

Incorrect search engines are shown for zh-CN

Categories

(Firefox for iOS :: General, defect)

Other
iOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Tracking Status
fxios 1.4+ ---

People

(Reporter: st3fan, Assigned: st3fan)

References

Details

Attachments

(2 files, 1 obsolete file)

For zh-CN we show an alternative list of search engines and a different default. The files in Client/Assets/SearchPlugins/zh-CN/ look correct but when I change my iPhone to Simplified Chinese and China as the Region, I still get the US specific search engines and Yahoo as a default. I checked NSLocale.currentLocale().localeIdentifier and it is correctly set to zh_CN. I also checked the built .ipa file and all the SearchPlugins/zh-CN files are correctly included.
Flags: needinfo?(bnicholson)
Oh so when we use let language = NSLocale.preferredLanguages().first! We get zh-Hans-CN back. So that will not match any of the directories in SearchPlugins. Is there a reason we don't use NSLocale.currentLocale().localeIdentifier here?
Since this is related I figured I should ask here and get some additional verification. While I was uplifting the patches for the search engine .xml changes there were conflicts. Who would be the best person to NI to double check these? https://github.com/mozilla/firefox-ios/tree/v1.x/Client/Assets/SearchPlugins/zh-CN
Patch comment: This patch introduces a `directoriesForLanguageIdentifier()` function that returns a list of `SearchPlugins` directories to search for the given *language identifier*. This change was made so that we correctly handle the `zh-Hans-CN` *language identifier* which does not map to any of the `SearchPlugins` subdirectories but should default to the `zh-CN` one.
Assignee: nobody → sarentz
Comment on attachment 8704857 [details] [review] PR: https://github.com/mozilla/firefox-ios/pull/1409 Looks good, a couple minor comments in the PR.
Flags: needinfo?(bnicholson)
Attachment #8704857 - Flags: review?(bnicholson) → review+
Whiteboard: [needsuplift]
Merged.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
v1.x 9d61f45
Whiteboard: [needsuplift]
Reopen it because it still shows the incorrect search engine on iOS 8.4.1.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached file Pull request for comment 8 (obsolete) —
Attachment #8705916 - Flags: review?(sarentz)
Comment on attachment 8705916 [details] [review] Pull request for comment 8 I am ok with this change, but: Please fix the testDirectoriesForLanguageIdentifier() test, which currently fails because directoriesForLanguageIdentifier() now returns a different preference for language identifiers.
Attachment #8705916 - Flags: review?(sarentz) → review+
Flags: needinfo?(dxue)
Attachment #8705916 - Flags: review?(bnicholson)
This is an alternative for the existing pull request that renames the directories. I think I would prefer to just normalize the language identifier to get some commonality between iOS 8 and iOS 9. Specially because the search engine directories are generated by a script and are based on the Android ones. So I would prefer to keep the same locale identifiers in their names.
Comment on attachment 8705916 [details] [review] Pull request for comment 8 See newly attached pull request with new and simpler approach.
Attachment #8705916 - Flags: review+ → review?
Attachment #8706161 - Flags: review?(dxue)
Attachment #8706161 - Flags: review?(bnicholson)
I am ok with this change.
Flags: needinfo?(dxue)
Attachment #8705916 - Attachment is obsolete: true
Attachment #8705916 - Flags: review?(bnicholson)
Attachment #8705916 - Flags: review?
Comment on attachment 8706161 [details] [review] PR: https://github.com/mozilla/firefox-ios/pull/1427 LGTM. Might be worth exploring using currentLocale soon so we can properly handle other languages that have similar IDs.
Attachment #8706161 - Flags: review?(bnicholson) → review+
Whiteboard: [needsuplift]
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
v1.x e59f3b5
Whiteboard: [needsuplift]
Target Milestone: --- → 1.4
Verified on v1.4(1404). It can shows the right search engines for zh-CN both on iOS 8.4.1 and iOS 9.2.
Changing the status to Verified based on the previous comment
Status: RESOLVED → VERIFIED
Attachment #8706161 - Flags: review?(dxue) → review+
See Also: → 1252289
See Also: 1252289
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: