hyperdevs-team / poeditor-android-gradle-plugin

Gradle plug-in that enables importing PoEditor localized strings directly to an Android project
Apache License 2.0
51 stars 26 forks source link

Option for disabling HTML entity unescaping #52

Closed apoi closed 1 year ago

apoi commented 2 years ago

Summary and context of the enhancement This is a resurrection of the issue https://github.com/hyperdevs-team/poeditor-android-gradle-plugin/issues/49. In our project we use HTML tags combined with format strings. That means that tags should be escaped. It would be great to have that option.

Suggested implementation Add an attribute unescapeHtmlTags to poEditor section with default value true, and enable/disable string escaping based on this value.

Additional documentation https://developer.android.com/guide/topics/resources/string-resource.html#StylingWithHTML

In some cases, however, you may want to create a styled text resource that is also used as a format string. Normally, this doesn't work [...] The work-around to this is to write the HTML tags with escaped entities.

adriangl commented 2 years ago

Hello @apoi!

Sorry for the long delay in answering to you, I've opened a PR with the added flag, hope it works with your use case 😁

Let me know if you run into any issues with it!