Reputation: 32253
I have an app with several translations, and I want to delete some strings.
How can I refactor and delete them only once for example in the default strings.xml
file and automatically propagate the deletion to the other strings.xml file of other translations?
Upvotes: 25
Views: 8568
Reputation: 2212
Now you can do it easily with Translations Editor.
To open it click on the Open editor
on the top right corner in xml
file.
Then in the editor right click on key you are want to delete and press Delete Keys(s)
Upvotes: 3
Reputation: 1559
This is the way that I have done to Delete a language I do not want.
1: Make a backup copy of your project.zip
2:Go to Your project folder >app>src>main>res:
In this folder, you will find all languages in the form of folders
Remove the language folder that you not want For example : values-ar-rSA
back to android studio clean your project and test
Upvotes: 0
Reputation: 906
You can remove all translations by "Translations Editor" in Android Studio.
Upvotes: 46
Reputation: 4430
File Search
\R\s*<string name="string_name">(.|\R)*?</string>
and
don't forget replace string_name
to actual string name.*.xml
Replace...
Preview >
Upvotes: 15
Reputation: 75635
default strings.xml file and automatically propagate the deletion to the other strings.xml file of other translations
ADT does not support this operation. You need to get rid of the text from all your XML files yourself, which should not be hard task anyway, as it would be sufficient to do project global search (in Eclipse CTRL-H), set file mask to *.xml
and search for your string key. Then just remove this file from each file found.
Upvotes: 0