Fix format specifier flags in Android xml files (Fix #62) #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #62
This pull request introduces improved support for Android string format specifiers, adds comprehensive test cases for format flags and width/precision handling, and refactors the codebase to better distinguish between iOS and Android parsing logic.
Noticed we had a bunch of missing format specifiers that weren't handled properly when i started using this in my own project. Filed that issue and figured i should just improve it to make the format specifiers a bit more robust.
When i ran
swiftformatper the contribution guidelines I got a bunch of unrelated changes, not sure how those made it into the base.Android format specifier support and parsing:
androidArgumentRegexand related expressions inExpressions.swift. Parsing now distinguishes between iOS and Android strings using a newplatformproperty inFormatString.AndroidStringsFileto constructFormatStringobjects withplatform: .android, ensuring correct parsing of Android format strings.Test case and example improvements:
strings-base.xmlandstrings-translation.xmlto cover format specifier flags, width, and precision, including both correct and intentionally incorrect translations for validation.