Asana / locheck

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

Parse stringsdict & enable no-op stringsdict command #3

Closed stevelandeyasana closed 2 years ago

stevelandeyasana commented 2 years ago

The project isn't public yet, so I'm comfortable adding something unfinished.

  1. Add stringsdict examples
  2. Split LocalizedString into LocalizedStringPair and LocalizedString. LocalizedStringPair contains two LocalizedStrings, the base and translation. Stringsdict validation will only use LocalizedString.
  3. Store paths everywhere instead of files, because files aren't needed.
  4. Add SwiftyXMLParser dependency. This library isn't as mature or well-documented as I would like, but it allowed me to get up and running without needing to learn the SAX parser, and we can always remove it later.
  5. Parse stringsdict files into structs.

I haven't written tests yet because I want to see whether these structures support the validation logic well enough.

SwiftyXMLParser doesn't give us line numbers, so line numbers are not supported in stringsdict files. I'm not sure Xcode would even show them in the right place.