Asana / locheck

Validate iOS, Android, and Mac localizations. Find errors in .strings, .stringsdict, and strings.xml files.
MIT License
98 stars 12 forks source link

unknown type: 'string-array' (xml_schema_error) #35

Closed nbleiberg closed 2 years ago

nbleiberg commented 2 years ago

String arrays are a common practice in Android string xml files: https://developer.android.com/guide/topics/resources/string-resource#StringArray But they seem to not be recognized by locheck (above error)

stevelandeyasana commented 2 years ago

Thanks for the report. I would be happy to add support for this if you could provide a gist of an XML file that uses this feature, and potentially describe any additional error checking we should do.

nbleiberg commented 2 years ago

Thanks! Here is a simple one you would find under res/values

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
    <string-array name="string_array_name">
        <item>en_one</item>
        <item>en_two</item>
    </string-array>
</resources>

and you'd expect the same name and same number of items under the string.xml in each other value-* folder, e.g.:

<resources>
    <string-array name="string_array_name">
        <item>de_ein</item>
    </string-array>
</resources>

Should flag something like "'string_array_name' is missing items in de (items_missing_from_array)" If the string_array_name doesn't exist at all it would be a similar "key_missing_from_translation" error.