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 app translations – Localizable.strings #18200

Closed
wants to merge 9 commits into from

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Mar 24, 2022

No description provided.

mokagio added 9 commits March 24, 2022 11:19
A leftover of the previous way we did `.strings` extraction from the
file downloaded from GlotPress into the `InfoPlist.strings` and app
extension `.strings` files.

Notice that the `WordPressIntents` app extension which the variable
referred to is part of the `MANUALLY_MAINTAINED_STRINGS_FILES` `Hash`
which we pass to current iteration of the extractor action.
Since we need to do the process in two steps, therefore have two
commits, we also need a way to differentiate between the
`Localizable.strings` commit and the "other `.strings`" one.
The previous version used `Dir.glob('**/*.txt', base:
metadata_directory)`, but that didn't work for two reasons.

First, even if we use `base:`, the paths returned by `glob` are still
relative. From the docs:

> The optional base keyword argument specifies the base directory for
> interpreting relative pathnames instead of the current working
> directory. As the results are not prefixed with the base directory name
> in this case, you will need to prepend the base directory name if you
> want real paths.

See https://ruby-doc.org/core-2.7.4/Dir.html#method-c-glob .

Second, `Dir.glob` returns the files that match the given pattern, but
that excludes _deleted_ files. If a file is not there anymore, it can't
match the given pattern. This would have made the commit incomplete.

We could argue whether our code should delete the existing translations
when it doesn't find new ones. Even if we concluded that behavior is not
desirable, we'd still need to account for it locally until we update it
in the release toolkit. Otherwise, our local copies would remain dirty
after downloading the release notes metadata if no new ones are
available.
@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR is missing at least one label.
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@wpmobilebot
Copy link
Contributor

You can test the WordPress changes on this Pull Request by downloading it from AppCenter here with build number: pr18200-140d157. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

You can test the Jetpack changes on this Pull Request by downloading it from AppCenter here with build number: pr18200-140d157. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@AliSoftware AliSoftware force-pushed the release/19.5-localization-commit-fixes branch from 2e3dbf0 to 9c557da Compare March 24, 2022 17:59
@mokagio mokagio closed this Mar 24, 2022
@mokagio mokagio deleted the test/18199 branch March 24, 2022 19: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.

2 participants