Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Localizable.strings can't contain comments #28

Open
FredTheBishop opened this issue Apr 14, 2014 · 2 comments
Open

Localizable.strings can't contain comments #28

FredTheBishop opened this issue Apr 14, 2014 · 2 comments

Comments

@FredTheBishop
Copy link

Fails to properly parse existing entries in Localizable.strings files that contain comments.

Patch LNLocalizationCollection.m, reloadLocalizations:

  1. regular expression ending ";$ better ending ";(.*)$ to allow any characters after terminator, before line ending.
  2. 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.
@Ziewvater
Copy link

Put your code changes into a pull request. Fixes indexing issues with comments following ";"
#30

@marchv
Copy link

marchv commented Jun 3, 2014

I have forked the plug-in and made my own support for comments including the UI. Please check #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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants