Skip to content

Commit b4bfe77

Browse files
authored
Merge pull request #390 from wordpress-mobile/available-languages-lint-ignore
Add `tools:ignore="InconsistentArrays"` to `available_languages.xml`
2 parents 57e9ad1 + 96fc5b3 commit b4bfe77

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _None_
1010

1111
### New Features
1212

13-
_None_
13+
- Add `tools:ignore="InconsistentArrays"` to `available_languages.xml` to avoid a linter warning on repos hosting multiple app flavors. [#390]
1414

1515
### Bug Fixes
1616

lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ def self.verify_pr_diff(main, library, main_strings, lib_strings, source_diff)
212212
def self.create_available_languages_file(res_dir:, locale_codes:)
213213
doc = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
214214
xml.comment('Warning: Auto-generated file, do not edit.')
215-
xml.resources do
216-
xml.send(:'string-array', name: 'available_languages', translatable: 'false') do
215+
xml.resources('xmlns:tools': 'http://schemas.android.com/tools') do
216+
xml.send(:'string-array', name: 'available_languages', translatable: 'false', 'tools:ignore': 'InconsistentArrays') do
217217
locale_codes.each { |code| xml.item(code.gsub('-r', '_')) }
218218
end
219219
end

spec/test-data/translations/glotpress-download/expected/values/available_languages.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--Warning: Auto-generated file, do not edit.-->
3-
<resources>
4-
<string-array name="available_languages" translatable="false">
3+
<resources xmlns:tools="http://schemas.android.com/tools">
4+
<string-array name="available_languages" translatable="false" tools:ignore="InconsistentArrays">
55
<item>en_US</item>
66
<item>es</item>
77
<item>pt_BR</item>

0 commit comments

Comments
 (0)