I can’t find how to merge strings for translations in Android.
There is a set of values and there is its translation of values-ru. How to add missing lines to values-ru from values? After all, strings.xml is a regular xml, I was looking for how to merge xml under GNU / Linux, I did not find anything, only paid utilities with a single merge function under windows.
If there is any utility, I need it under GNU / Linux, and I didn’t understand whether it can be done with xmlutils.
Or tell me this function is only in Android Studio?
In general, we need the utility functions of gettext (msgmerge), only for Android translations, I thought it was easy to find, and Google talks about it normally, but no. I did not find anything like it.
An example of what it is about:
There are values / strings.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello!</string> <string name="world">World</string> </resources>
And there are values-ru / strings.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Привет!</string> </resources>
how to merge these 2 files to get
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Привет!</string> <string name="world">World</string> </resources>
If someone has not heard about the "Official" way out of the situation, then yes, you just have to write your parsing. It's just strange that the standard mechanism for translating to Android does not have such necessary and simple functions as: merging and deleting already missing lines in the translation files