Skip to content

Commit a3d8afb

Browse files
committed
Improve action documentation/wording
1 parent ad62207 commit a3d8afb

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_extract_keys_from_strings_files.rb

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,43 +48,44 @@ def self.keys_list_per_target_file(original_files)
4848
#####################################################
4949

5050
def self.description
51-
'Extracts a subset of keys from a `.strings` file into a separate `.strings` file'
51+
'Extracts a subset of keys from a `.strings` file into separate `.strings` file(s)'
5252
end
5353

5454
def self.details
5555
<<~DETAILS
56-
Extracts a subset of keys from a `.strings` file into a separate `.strings` file, for each `*.lproj` subdirectory.
56+
Extracts a subset of keys from a `.strings` file into separate `.strings` file(s), for each `*.lproj` subdirectory.
5757
58-
This is especially useful to extract keys for `InfoPlist.strings` or `<SomeIntentDefinitionFile>.strings`
59-
from the `Localizable.strings` file, for each locale.
58+
This is especially useful to extract, for each locale, the translations for files like `InfoPlist.strings` or
59+
`<SomeIntentDefinitionFile>.strings` from the `Localizable.strings` file that we exported/downloaded back from GlotPress.
6060
61-
Since we typically merge all `*.strings` original files (e.g. `en.lproj/Localizable.strings` + `en.lproj/InfoPlist.strings`)
62-
via `ios_merge_strings_file` before sending the originals to translations, this is why we then need to extract
63-
the relevant keys and translations back into `InfoPlist.strings` after we pull those translations back from GlotPress
64-
(`ios_download_strings_files_from_glotpress`) using this `ios_extract_keys_from_strings_files` action.
61+
Since we typically merge all `*.strings` original files (e.g. `en.lproj/Localizable.strings` + `en.lproj/InfoPlist.strings` + …)
62+
via `ios_merge_strings_file` before sending the originals to translations, we then need to extract the relevant keys and
63+
translations back into the `*.lproj/InfoPlist.strings` after we pull those translations back from GlotPress
64+
(`ios_download_strings_files_from_glotpress`). This is what this `ios_extract_keys_from_strings_files` action is for.
6565
DETAILS
6666
end
6767

6868
def self.available_options
6969
[
7070
FastlaneCore::ConfigItem.new(key: :source_parent_dir,
7171
env_name: 'FL_IOS_EXTRACT_KEYS_FROM_STRINGS_FILES_SOURCE_PARENT_DIR',
72-
description: 'The parent directory containing all the `*.lproj` subdirectories in which the `.strings` files reside',
72+
description: 'The parent directory containing all the `*.lproj` subdirectories in which the source `.strings` files reside',
7373
type: String,
7474
verify_block: proc do |value|
7575
UI.user_error!("`source_parent_dir` should be a path to an existing directory, but found `#{value}`.") unless File.directory?(value)
7676
UI.user_error!("`source_parent_dir` should contain at least one `.lproj` subdirectory, but `#{value}` does not contain any.") if Dir.glob('*.lproj', base: value).empty?
7777
end),
7878
FastlaneCore::ConfigItem.new(key: :source_tablename,
7979
env_name: 'FL_IOS_EXTRACT_KEYS_FROM_STRINGS_FILES_SOURCE_TABLENAME',
80-
description: 'The basename of the `.strings` file (without the extension) to extract the keys and translations from',
80+
description: 'The basename of the `.strings` file (without the extension) to extract the keys and translations from for each locale',
8181
type: String,
8282
default_value: 'Localizable'),
8383
FastlaneCore::ConfigItem.new(key: :target_original_files,
8484
env_name: 'FL_IOS_EXTRACT_KEYS_FROM_STRINGS_FILES_TARGET_ORIGINAL_FILES',
8585
description: 'The path to the `<base-locale>.lproj/<target-tablename>.strings` file(s) for which we want to extract the keys to. ' \
86-
+ 'Those files containing the originals (typical `en` or `Base` locale) will be used to determine which keys to extract from the `source_tablename`, ' \
87-
+ 'and into each target file in each of the other `*.lproj` sibling folders',
86+
+ 'Those files, containing the originals (typical `en` or `Base` locale), will be used to determine which keys to extract from the `source_tablename`, ' \
87+
+ 'and the target file path(s) in which to extract the translations will be determined from those path, writing them in the file with the same basename ' \
88+
+' in each of the other `*.lproj` sibling folders of those target paths',
8889
type: Array,
8990
verify_block: proc do |values|
9091
UI.user_error!('`target_original_files` must contain at least one path to an original `.strings` file.') if values.empty?

0 commit comments

Comments
 (0)