Skip to content
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

Update community translator field to use toggle #95593

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

andregardi
Copy link
Contributor

@andregardi andregardi commented Oct 22, 2024

Related to #95581

Proposed Changes

image

The Community translator option under Interface Settings currently uses a checkbox, whereas the Admin home field underneath uses a toggle. We should standardize so that both of these fields use a toggle.

Before After
image image

Testing Instructions

  • Apply the branch locally or use the live preview link.
  • Go to Account Settings (/me/account).
  • If you are not seeing the Community translator field, try switching to another idiom. There is some logic that compares browser local with account idiom to hide the field if translation is not possible or relevant.
  • Toggle on or off the field. Reload the page to double check if value persisted.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@andregardi andregardi self-assigned this Oct 22, 2024
@matticbot
Copy link
Contributor

matticbot commented Oct 22, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~69 bytes removed 📉 [gzipped])

name     parsed_size           gzip_size
account       -632 B  (-0.1%)      -69 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@phcp phcp left a comment

Choose a reason for hiding this comment

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

The PR works as expected. The community translator field is now displayed as a toggle instead of a checkbox. I left a suggestion, but nothing major, feel free to take it or not. And thanks for extracting it into a component!
Screenshot 2024-10-23 at 10 17 14

client/me/account/main.jsx Show resolved Hide resolved
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug agardi/toggle-community-translator on your sandbox.

@andregardi andregardi merged commit 69d884e into trunk Oct 23, 2024
11 checks passed
@andregardi andregardi deleted the agardi/toggle-community-translator branch October 23, 2024 13:47
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.

3 participants