Generated file contains strings from default resource value
See original GitHub issueThis gradle plug-in works pretty well, but I noticed a problem when there are some missing template translations
For instance:
With file values/strings.xml
<string name="template_string_1">This is an example for ${app_name}</string>
<string name="template_string_2">This is a second example for ${app_name}</string>
And French file values-fr/strings.xml with missing translation for template_string_2
<string name="template_string_1">C\'est un exemple pour ${app_name}</string>
Generated file values-fr/resolved.xml will contain
<string name="string_1">C\'est un exemple pour My wonderful app</string>
<string name="string_2">This is a second example for My wonderful app</string>
I do not expect string_2 to be include in the generated file for French, since it will be already included in the generated file values/resolved.xml.
This can lead to issue reported from lint (Typos, etc.).
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Read resource text file to String in Java [closed] - Stack Overflow
Yes, Guava provides this in the Resources class. For example: URL url = Resources.getResource("foo.txt"); String text = Resources.
Read more >String resources - Android Developers
A string resource provides text strings for your application with optional text styling and formatting. There are three types of resources ...
Read more >Create resource files - .NET - Microsoft Learn
Create a text file that contains string resources. You can use Resource File Generator (resgen.exe) to convert the text file into a binary ......
Read more >String Resources - Apple Developer
Resource files that contain localizable strings are referred to as strings files because of their filename extension, which is . strings . You ......
Read more >The Java Plugin - Gradle User Manual
resourcesDir — File. Default value: $buildDir/resources/$name , e.g. build/resources/main. The directory to generate the resources of this source set into.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks @LikeTheSalad ! Migrating to 2.0.0 is fine so far!
Hi @bmarty - The new version 2.0.0 is now available, it is no longer needed to define your templates by adding the “template_” to your string names anymore, which means that Lint shouldn’t treat them as separate strings, thus avoiding the “translation” issue. Although, please bear in mind that a lot of things have changed in this new version 2.0.0, there’s a rebranding along with new dependencies parameters and plugin ID, so in order to add the new version into your project, I recommend you to check again the README’s instructions: https://github.com/LikeTheSalad/android-stem#21--changes-to-your-roots-buildgradle-file