Lin-Xcode5
Lin-Xcode5 copied to clipboard
Localizable.strings can't contain comments
Fails to properly parse existing entries in Localizable.strings files that contain comments.
Patch LNLocalizationCollection.m, reloadLocalizations:
- regular expression ending ";$ better ending ";(.*)$ to allow any characters after terminator, before line ending.
- change the line: if (result.range.location != NSNotFound && result.numberOfRanges == 5) { to: if (result.range.location != NSNotFound && result.numberOfRanges >= 5) { because firstMatchInString: may return a range (no. 6) for the comments.
Put your code changes into a pull request. Fixes indexing issues with comments following ";" https://github.com/questbeat/Lin-Xcode5/pull/30
I have forked the plug-in and made my own support for comments including the UI. Please check https://github.com/questbeat/Lin-Xcode5/pull/32 or https://github.com/marchv/Lin-Xcode5. Please note that the comments are expected to be on the previous line:
/* My 1st comment */
"my1stKey" = "My 1st string";
/* My 2nd comment */
"my2ndKey" = "My 2nd string";
Feedback is welcome :)