You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ _None_
16
16
17
17
### Bug Fixes
18
18
19
-
_None_
19
+
* Fix `ios_lint_localizations` action so that it no longer mistakely reports missing keys not yet translated in the other locales' `.strings` as violations. [#353]
Copy file name to clipboardExpand all lines: lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb
+20-34Lines changed: 20 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -58,8 +58,7 @@ def install_swiftgen!
58
58
#
59
59
# @param [String] input_dir The path (ideally absolute) to the directory containing the `.lproj` folders to parse
60
60
# @param [String] base_lang The code name (i.e the basename of one of the `.lproj` folders) of the locale to use as the baseline
61
-
# @return [Hash<String, String>] A hash whose keys are the language codes (basename of `.lproj` folders) for which violations were found,
62
-
# and the values are the output of the `diff` showing these violations.
61
+
# @return [Hash<String, Array<String>>] A hash of violations, keyed by language code, whose values are the list of violation messages for that language
# Because we use English copy verbatim as key names, some keys are the same except for the upper/lowercase.
143
-
# We need to sort the output again because SwiftGen only sort case-insensitively so that means keys that are
144
-
# the same except case might be in swapped order for different outputs
141
+
# Returns a Hash mapping the list of expected parameter types for each of the keys based in the %… placeholders found in their `.strings` files
145
142
#
146
143
# @param [String] dir The temporary directory in which the file to sort lines for is located
147
144
# @param [String] lang The code for the locale we need to sort the output lines for
145
+
# @return [Hash<String, String>] A hash whose keys are the strings keys, and corresponding value is a String describing the types expected as parameters.
# Prepares the template and config files, then run SwiftGen, run `diff` on each generated output against the baseline, and returns a Hash of the violations found.
159
157
#
160
158
# @param [String] input_dir The directory where the `.lproj` folders to scan are located
161
159
# @param [String] base_lang The base language used as source of truth that all other languages will be compared against
162
160
# @param [Array<String>] only_langs The list of languages to limit the generation for. Useful to focus only on a couple of issues or just one language
163
-
# @return [Hash<String, String>] A hash of violations, keyed by language code, whose values are the diff output.
161
+
# @return [Hash<String, Array<String>>] A hash of violations, keyed by language code, whose values are the list of violation messages for that language
164
162
#
165
163
# @note The returned Hash contains keys only for locales with violations. Locales parsed but without any violations found will not appear in the resulting hash.
# If the lang ends up not having any translation at all (e.g. a `.lproj` without any `.strings` file in it but maybe just a storyboard or assets catalog), ignore it
180
-
nextniliffile.nil? || only_empty_lines?(file)
181
-
182
-
# Compute the diff
183
-
diff=`diff -U0 "#{base_file}" "#{file}"`
184
-
# Remove the lines starting with `---`/`+++` which contains the file names (which are temp files we don't want to expose in the final diff to users)
185
-
# Note: We still keep the `@@ from-file-line-numbers to-file-line-numbers @@` lines to help the user know the index of the key to find it faster,
186
-
# and also to serve as a clear visual separator between diff entries in the output.
187
-
# Those numbers won't be matching the original `.strings` file line numbers because they are line numbers in the SwiftGen-generated intermediate
188
-
# file instead, but they can still give an indication at the index in the list of keys at which this difference is located.
0 commit comments