serge-community / serge

Continuous localization platform
https://serge.io/
Other
237 stars 53 forks source link

parse_strings parser doesn't support multi-line values #63

Open liuwin7 opened 7 years ago

liuwin7 commented 7 years ago

Hi there,

In my xxx.strings file, I have one string, for example,

/* Button's title */
"Button.Title"="Hello 
world!"

Note: Xcode supports this style.

I cannot get the "Hello \n world!", what should I do for this ?

iafan commented 7 years ago

@liuwin7 thanks for reporting! Indeed, our current .strings parser doesn't support such multi-line strings; we internally don't have such strings, and genstrings tool we use to extract strings from source code also produces single-line strings with \n inside.

In order to support such multi-line strings, the parser needs to be rewritten to support streaming mode. Until this happens, you might just want to replace your actual newlines with \n, like follows:

/* Button's title */
"Button.Title"="Hello\nworld!"
liuwin7 commented 7 years ago

@iafan Thanks for your reply. I have found the source code, and the Serge only accepts the single-line strings. I haved modified my original strings file just like as what you said. many thanks.