Skip to content

Commit

Permalink
Update L10n tooling via new release-toolkit plugin action (#17519)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio authored Nov 23, 2021
2 parents a8b3a0c + dc76204 commit 01ccb69
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 181 deletions.
1 change: 1 addition & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_JOBS: "16"
BUNDLE_WITHOUT: "screenshots"
38 changes: 22 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
GIT
remote: [email protected]:wordpress-mobile/release-toolkit
revision: eccf5a273276e976cd42c66590af087d1654037f
branch: develop
specs:
fastlane-plugin-wpmreleasetoolkit (2.1.0)
activesupport (~> 5)
bigdecimal (~> 1.4)
chroma (= 0.2.0)
diffy (~> 3.3)
git (~> 1.3)
jsonlint (~> 0.3)
nokogiri (~> 1.11)
octokit (~> 4.18)
parallel (~> 1.14)
progress_bar (~> 1.3)
rake (>= 12.3, < 14.0)
rake-compiler (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -165,19 +184,6 @@ GEM
trainer
xcodeproj
xctest_list (>= 1.2.1)
fastlane-plugin-wpmreleasetoolkit (2.1.0)
activesupport (~> 5)
bigdecimal (~> 1.4)
chroma (= 0.2.0)
diffy (~> 3.3)
git (~> 1.3)
jsonlint (~> 0.3)
nokogiri (~> 1.11)
octokit (~> 4.18)
parallel (~> 1.14)
progress_bar (~> 1.3)
rake (>= 12.3, < 14.0)
rake-compiler (~> 1.0)
ffi (1.15.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
Expand Down Expand Up @@ -226,7 +232,7 @@ GEM
http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.8.10)
i18n (1.8.11)
concurrent-ruby (~> 1.0)
jmespath (1.4.0)
json (2.5.1)
Expand Down Expand Up @@ -340,11 +346,11 @@ DEPENDENCIES
fastlane-plugin-appcenter (~> 1.8)
fastlane-plugin-sentry
fastlane-plugin-test_center
fastlane-plugin-wpmreleasetoolkit (~> 2.1)
fastlane-plugin-wpmreleasetoolkit!
octokit (~> 4.0)
rake
rmagick (~> 3.2.0)
xcpretty-travis-formatter

BUNDLED WITH
2.2.27
2.2.31
158 changes: 0 additions & 158 deletions Scripts/localize.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class AppSettingsViewController: UITableViewController {
NSUserActivity.deleteAllSavedUserActivities {}
}

let notice = Notice(title: NSLocalizedString("Siri Reset Confirmation", comment: "Notice displayed to the user after clearing the Siri activity donations."), feedbackType: .success)
let notice = Notice(title: NSLocalizedString("Siri Reset Confirmation", value: "Successfully cleared Siri Shortcut Suggestions", comment: "Notice displayed to the user after clearing the Siri activity donations."), feedbackType: .success)
ActionDispatcher.dispatch(NoticeAction.post(notice))
}
}
Expand Down Expand Up @@ -435,7 +435,7 @@ private extension AppSettingsViewController {

if #available(iOS 12.0, *) {
let siriClearCacheRow = DestructiveButtonRow(
title: NSLocalizedString("Siri Reset Prompt", comment: "Label for button that clears user activities donated to Siri."),
title: NSLocalizedString("Siri Reset Prompt", value: "Clear Siri Shortcut Suggestions", comment: "Label for button that clears user activities donated to Siri."),
action: clearSiriActivityDonations(),
accessibilityIdentifier: "spotlightClearCacheButton")

Expand Down
39 changes: 36 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ platform :ios do
desc 'Creates a new release branch from the current develop'
lane :complete_code_freeze do |options|
ios_completecodefreeze_prechecks(options)
ios_localize_project
version = ios_get_app_version
trigger_beta_build(branch_to_build: "release/#{version}")
generate_strings_file_for_glotpress

UI.confirm('Ready to push changes to remote and trigger the beta build?') unless ENV['RELEASE_TOOLKIT_SKIP_PUSH_CONFIRM']
push_to_git_remote
trigger_beta_build(branch_to_build: "release/#{ios_get_app_version}")
end

#####################################################################################
Expand Down Expand Up @@ -399,6 +401,37 @@ platform :ios do
)
end

#####################################################################################
# generate_strings_file_for_glotpress
# -----------------------------------------------------------------------------------
# Generate the `.strings` file to be imported by GlotPress,
# by parsing source code for `NSLocalizedString` (using `genstrings` under the hood).
#
# Typically called by complete_code_freeze.
# -----------------------------------------------------------------------------------
# Usage:
# bundle exec fastlane generate_strings_file_for_glotpress
#####################################################################################
lane :generate_strings_file_for_glotpress do
cocoapods

en_lproj = 'WordPress/Resources/en.lproj'
ios_generate_strings_file_from_code(
paths: ['WordPress/', 'Pods/WordPress*/', 'Pods/WPMediaPicker/', 'WordPressShared/WordPressShared/', 'Pods/Gutenberg/'],
exclude: ['*Vendor*', 'WordPress/WordPressTest/I18n.swift', 'WordPress/WordPressStatsWidgets/Views/Localization/LocalizedStringKey+extension.swift', '*/Secrets.swift'],
output_dir: en_lproj
)

# @TODO: Remove once we migrated the codebase of the widgets to use the app bundle for .strings
today_widget_base = 'WordPress/WordPressTodayWidget/Base.lproj'
ios_generate_strings_file_from_code(paths: ['WordPress/WordPressTodayWidget'], output_dir: today_widget_base)
share_ext_base = 'WordPress/WordPressShareExtension/Base.lproj'
ios_generate_strings_file_from_code(paths: ['WordPress/WordPressShareExtension'], output_dir: share_ext_base)
# END TODO

git_commit(path: [en_lproj, today_widget_base, share_ext_base], message: 'Update strings for localization', allow_nothing_to_commit: true)
end

#####################################################################################
# download_localized_strings_and_metadata
# -----------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ group :screenshots, optional: true do
gem 'rmagick', '~> 3.2.0'
end

gem 'fastlane-plugin-wpmreleasetoolkit', '~> 2.1'
# gem 'fastlane-plugin-wpmreleasetoolkit', '~> 2.1'
# This comment avoids typing to switch to a development version for testing.
# gem 'fastlane-plugin-wpmreleasetoolkit', git: '[email protected]:wordpress-mobile/release-toolkit', branch: ''
gem 'fastlane-plugin-wpmreleasetoolkit', git: '[email protected]:wordpress-mobile/release-toolkit', branch: 'develop'

gem 'fastlane-plugin-sentry'
gem 'fastlane-plugin-appcenter', '~> 1.8'
Expand Down

0 comments on commit 01ccb69

Please sign in to comment.