koral-- / android-gradle-localization-plugin

Gradle plugin for generating localized string resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can i avoid escaping newline character

skiff2011 opened this issue · comments

In app.gradle

localization {
  csvFile = file('strings.csv')
  outputIndent = '  '
  defaultColumnName = 'en'
  escapeNewLines = false
  handleEmptyTranslationsAsDefault = 'true'
  outputFileName = 'strings.xml'
}

In strings.csv i have the next line
tutorial_analyses_title,"Analyses order \n DoctorOnline",,"",,,,,,,,,,

but after executing task localization i get such string after parsing in strings.xml

<string name="tutorial_analyses_title">Analyses order \\n DoctorOnline</string>

As a result string cannot be displayed in textView correctly. How can I avoid escaping this character? escapeNewLines = false config seems to be ignored. How can i avoid escaping this newline character?

Plugin version 1.0.19.

Thanks for help

escapeNewLines is responsible for translating newline characters (which are whitespaces) to \\n.
If you already have literal \n in the source string you may be interested in escapeSlashes option. However, it won't escape anything beginning with slash.

Does it solve your issue?

Yes, thanks