Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .buildkite/commands/lint-localized-strings-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash -eu

echo "--- :writing_hand: Copy Files"
SECRETS_DIR=~/.configure/woocommerce-ios/secrets
mkdir -pv $SECRETS_DIR
cp -v fastlane/env/project.env.example $SECRETS_DIR/project.env

lint_localized_strings_format
31 changes: 19 additions & 12 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/bash-cache#2.8.0
- automattic/bash-cache#2.12.0
- automattic/git-s3-cache#v1.1.3:
bucket: "a8c-repo-mirrors"
# This is not necessarily the actual name of the repo or the GitHub organization
Expand Down Expand Up @@ -55,18 +55,25 @@ steps:
context: "Unit Tests"

#################
# Lint Translations
# Linters
#################
- label: "🧹 Lint Translations"
command: "gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot"
plugins:
- docker#v3.8.0:
image: "public.ecr.aws/automattic/glotpress-validator:1.0.0"
agents:
queue: "default"
notify:
- github_commit_status:
context: "Lint Translations"
- group: Linters
steps:
- label: "🧹 Lint Translations"
command: "gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot"
plugins:
- docker#v3.8.0:
image: "public.ecr.aws/automattic/glotpress-validator:1.0.0"
agents:
queue: "default"
notify:
- github_commit_status:
context: "Lint Translations"

- label: ":sleuth_or_spy: Lint Localized Strings Format"
command: .buildkite/commands/lint-localized-strings-format.sh
plugins: *common_plugins
env: *common_env

#################
# UI Tests
Expand Down
11 changes: 10 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,15 @@ platform :ios do
configure_validate
end

# Generates the `.strings` file to be imported by GlotPress, by parsing source code (using `genstrings` under the hood).
#
#
# @option [Boolean] skip_commit (default: false) If true, does not commit the changes made to the `.strings` file.
#
# @called_by complete_code_freeze
#
desc 'Updates the main `Localizable.strings` file — that will be imported by GlotPress — from code and `Info.plist` files'
lane :generate_strings_file_for_glotpress do
lane :generate_strings_file_for_glotpress do |options|
cocoapods

en_lproj_path = File.join(RESOURCES_FOLDER, 'en.lproj')
Expand Down Expand Up @@ -1006,6 +1013,8 @@ platform :ios do
destination: File.join(en_lproj_path, 'Localizable.strings')
)

next if options.fetch(:skip_commit, false)

git_commit(
path: en_lproj_path,
message: 'Freeze strings for localization',
Expand Down