Skip to content

Remove a couple of duplicated localization keys#20030

Merged
mokagio merged 3 commits intotrunkfrom
mokagio/fix-reused-keys
Jan 30, 2023
Merged

Remove a couple of duplicated localization keys#20030
mokagio merged 3 commits intotrunkfrom
mokagio/fix-reused-keys

Conversation

@mokagio
Copy link
Contributor

@mokagio mokagio commented Jan 30, 2023

I noticed these while testing the changes from #20009. Or rather, bundle exec fastlane generate_strings_file_for_glotpress noticed these:

[16:01:52]: -------------------------------------------------
[16:01:52]: --- Step: ios_generate_strings_file_from_code ---
[16:01:52]: -------------------------------------------------
[16:01:54]: ▸ Key "jetpack.fullscreen.overlay.newUsers.stats.subtitle" used with multiple values. Value "Watch your traffic grow with helpful insights and comprehensive stats." kept. Value "Find and follow your favorite sites and communities, and share you content." ignored.
[16:01:54]: ▸ Key "jetpack.fullscreen.overlay.newUsers.stats.subtitle" used with multiple values. Value "Watch your traffic grow with helpful insights and comprehensive stats." kept. Value "Get notifications for new comments, likes, views, and more." ignored.
[16:01:55]: ▸ Key "widget.today.nodata.view.title" used with multiple values. Value "Unable to load site stats." kept. Value "Unable to load today's stats." ignored.

Testing

Checkout this branch, run bundle exec fastlane generate_strings_file_for_glotpress skip_commit:true and verify it prints no warnings:

image

The diff will also show entries for the de-duplicated keys in Localizable.strings, but it will be tricky to spot them in between all the new strings. A way to verify this would be:

  1. Checkout a new branch from trunk
  2. Run bundle exec fastlane generate_strings_file_for_glotpress
  3. Merge this PR in the new branch
  4. Run bundle exec fastlane generate_strings_file_for_glotpress skip_commit:true again
  5. This time, only the edited keys should show in the diff

However, our automation is tried and tested and I didn't feel the need to got to such length to verify it.

Regression Notes

  1. Potential unintended areas of impact – N.A.
  2. What I did to test those areas of impact (or what existing automated tests I relied on) – N.A.
  3. What automated tests I added (or what prevented me from doing so) – N.A.

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes. N.A.
  • I have considered adding accessibility improvements for my changes. N.A.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary. N.A.

…ryView`

`bundle exec fastlane generate_strings_file_for_glotpress` picked this
up:

```
[16:01:52]: -------------------------------------------------
[16:01:52]: --- Step: ios_generate_strings_file_from_code ---
[16:01:52]: -------------------------------------------------
[16:01:54]: ▸ Key "jetpack.fullscreen.overlay.newUsers.stats.subtitle" used with multiple values. Value "Watch your traffic grow with helpful insights and comprehensive stats." kept. Value "Find and follow your favorite sites and communities, and share you content." ignored.
[16:01:54]: ▸ Key "jetpack.fullscreen.overlay.newUsers.stats.subtitle" used with multiple values. Value "Watch your traffic grow with helpful insights and comprehensive stats." kept. Value "Get notifications for new comments, likes, views, and more." ignored.
[16:01:55]: ▸ Key "widget.today.nodata.view.title" used with multiple values. Value "Unable to load site stats." kept. Value "Unable to load today's stats." ignored.
```
`bundle exec fastlane generate_strings_file_for_glotpress` picked this
up

```
[16:01:52]: -------------------------------------------------
[16:01:52]: --- Step: ios_generate_strings_file_from_code ---
[16:01:52]: -------------------------------------------------
[16:01:54]: ▸ Key "jetpack.fullscreen.overlay.newUsers.stats.subtitle" used with multiple values. Value "Watch your traffic grow with helpful insights and comprehensive stats." kept. Value "Find and follow your favorite sites and communities, and share you content." ignored.
[16:01:54]: ▸ Key "jetpack.fullscreen.overlay.newUsers.stats.subtitle" used with multiple values. Value "Watch your traffic grow with helpful insights and comprehensive stats." kept. Value "Get notifications for new comments, likes, views, and more." ignored.
[16:01:55]: ▸ Key "widget.today.nodata.view.title" used with multiple values. Value "Unable to load site stats." kept. Value "Unable to load today's stats." ignored.
```
comment: "Title of the no site view in all time widget")

static let noSiteViewThisWeekTitle = AppLocalizedString("widget.thisweek.nosite.view.titlee",
static let noSiteViewThisWeekTitle = AppLocalizedString("widget.thisweek.nosite.view.title",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a typo fix, which I noticed by chance. We don't yet have tooling to spot this minor issues 😅

@wpmobilebot
Copy link
Contributor

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr20030-068c198 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr20030-068c198 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Copy link
Contributor

@staskus staskus left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes 🙏. I ran the given tests and can verify the behavior.

@mokagio mokagio enabled auto-merge January 30, 2023 09:24
@mokagio mokagio merged commit 08d3a8b into trunk Jan 30, 2023
@mokagio mokagio deleted the mokagio/fix-reused-keys branch January 30, 2023 09:37
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