8000 [PM-9907] Change language codes for Chinese and Brazilian Portuguese by Hinton · Pull Request #994 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[PM-9907] Change language codes for Chinese and Brazilian Portuguese #994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

Hinton
Copy link
Member
@Hinton Hinton commented Oct 1, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-12977

📔 Objective

iOS prefers to use the zh-Hans and zh-Hant language codes for traditional / simplified Chinese rather than zh-CN and zh-TW that we previously used. This seems to resolve the issues around the language not working however it also changes how we represent it in the language picker.

We should confirm this language codes are what we desire to use, and how they behave with the system language options.

📸 Screenshots

Before:
image

After:
image

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link
codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.05%. Comparing base (cbfda94) to head (91e8ee1).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #994   +/-   ##
=======================================
  Coverage   89.05%   89.05%           
=======================================
  Files         654      654           
  Lines       41057    41057           
=======================================
  Hits        36562    36562           
  Misses       4495     4495           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vvolkgang vvolkgang changed the title Change language codes for chinese [PM-12977] Change language codes for chinese Oct 1, 2024
Copy link
Contributor
github-actions bot commented Oct 1, 2024

Logo
Checkmarx One – Scan Summary & Details514a77ea-f85f-48c0-8dd8-deef388567af

No New Or Fixed Issues Found

@vvolkgang vvolkgang changed the title [PM-12977] Change language codes for chinese [PM-12977] Change language codes for Chinese and Brazilian Portuguese Oct 1, 2024
@Hinton Hinton marked this pull request as ready for review October 2, 2024 08:04
@vvolkgang vvolkgang changed the title [PM-12977] Change language codes for Chinese and Brazilian Portuguese [PM-9907] Change language codes for Chinese and Brazilian Portuguese Oct 2, 2024
KatherineInCode
KatherineInCode previously approved these changes Oct 2, 2024
Copy link
Contributor
@KatherineInCode KatherineInCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving because these look good to me, especially if they fix the issue, but I can't comment on the names, unfortunately.

@KatherineInCode
Copy link
Contributor

📝 You will need to also update the snapshot tests for this. Particularly, BitwardenShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_large.1.png will need to be regenerated to capture the new names. If you delete that file then run the tests it should generate the new snapshot for you.

matt-livefront
matt-livefront previously approved these changes Oct 2, 2024
Copy link
Collaborator
@matt-livefront matt-livefront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes make sense, as those codes should match what we have in the Info.plist and Localized string files.

Bitwarden/Application/Support/Info.plist:

<string>pt-PT</string>
<string>pt-BR</string>
<string>zh-Hans</string>
<string>zh-Hant</string>

BitwardenShared/UI/Platform/Application/Support/Localizations:

pt-BR.lproj
pt-PT.lproj
zh-Hans.lproj
zh-Hant.lproj

One thing I noticed though, if I set my system language (as opposed to the app's override) to simplified Chinese, I'm still only seeing English.

We currently use Locale.current.languageCode to get the user's system language code, but maybe we should instead be using the bundle's preferredLocalizations array.

(lldb) po Locale.current.languageCode
▿ Optional<String>
  - some : "zh"
(lldb) po Bundle.main.preferredLocalizations
▿ 1 element
  - 0 : "zh-Hans"

@Hinton
Copy link
Member Author
Hinton commented Oct 3, 2024

Seems I'm using Xcode 16 which isn't supported by our codebase yet 😓.

@KatherineInCode KatherineInCode dismissed stale reviews from matt-livefront and themself via 989c4b6 October 3, 2024 14:42
@KatherineInCode KatherineInCode requested review from matt-livefront and a team October 3, 2024 14:44
@KatherineInCode KatherineInCode merged commit 3544d94 into main Oct 3, 2024
9 checks passed
@KatherineInCode KatherineInCode deleted the zh branch October 3, 2024 20:55
@jiaobaba1027
Copy link

When can it be repaired?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After selecting the Chinese language in the iOS client, the language does not switch to Chinese. Bitwarden Beta Set Chinese Language Error
5 participants
0