As many of us know, translating strings into many different languages can be extremely tedious when done manually. Determined to find a better way, I googled "easy way to translate strings in xml" and stumbled on this glorious free Python code available in GitHub with a corresponding web tool if you don't feel like setting up your own Python program. It uses Google Translate, and the web tool prints to an html so you can watch it as it goes. Then you can download the translated file.
Link to source code on GitHub: https://github.com/Ra-Na/GTranslate-strings-xml
Link to web tool: https://asrt.gluege.boerde.de
The author has a donate button on the web tool page, and I know many of us can relate to coding stuff for free and wanting some thanks. So show this person some love if you find this useful. It was a game changer for me, and I'm glad I didn't have to start from scratch to make my own code for this.
----------
UPDATE March 24, 2024:
Google has since started cracking down on automated pings to Google Translate, such that you have to subscribe to an account if you want to run a script that translates a lot of strings at a time instead of one-by-one. The above web tool no longer works, I assume for this reason. When I tried downloading the GitHub Python source code and running it on my local machine (after making some edits), it worked for a while, but then I started getting error messages from Google saying that they detected automated pings. Note that the GitHub also includes scripts for other translation platforms, but these also require subscriptions. When I started looking into the subscription for Google, it involved some setup in Google Cloud (i.e., not a simple sign up). It might be worth it if you have lots and lots of strings and translations for several apps, but it wasn't worth it for me.
A feasible alternative is the VS Code extension Google Translate by benshabatnoam. With it, you can highlight a string and translate it with a simple keyboard shortcut in VS Code. You can specify the 'translate to' language in the VS Code User Settings for the extension. I assume the 'translate from' language is automatically detected.
I found it convenient to have the settings.json file open in its own tab alongside all of my different strings.xml files in their own tabs, so when I wanted to change the translation language, I just typed it in the json file. You can also have a list of languages to choose from, but every time you press the keyboard shortcut, you have to choose which language you want. I found it easier to set one language, translate all strings in the corresponding xml, then switch to the next language for the next xml, etc.
I also found that this extension is useful for translating app descriptions for the CIQ website, e.g., in a txt file. I'm using separate files for Description and What's New so I can select all when I copy and paste it online.
DISCLAIMER: As with any automated translation, Google Translate is not perfect, and it may need some proofreading. Even if you're not fluent in a language, you can probably spot inconsistencies (such as "Soleil" instead of "Dim" for the abbreviation "Sun" for "Sunday"), so make sure to do a quick check for each string as you go.
Note that the extension uses Google's language codes which are different from Garmin's. The developer provides a list of language codes in the info page, but I like having a cheat sheet comparison to Garmin's codes so I can quickly choose the appropriate xml based on the resources directory name. For starters, here's my cheat sheet:
CIQ Google Language
ces cs Czech
chs zh-CN Chinese (Simplified)
cht zh-TW Chinese (Traditional)
dan da Danish
deu de German
dut nl Dutch
est et Estonian
fin fi Finnish
fre fr French
gre el Greek
heb iw Hebrew
hrv hr Croatian
hun hu Hungarian
ind id Indonesian
ita it Italian
jpn ja Japanese
nob no Norwegian
pol pl Polish
por pt-BR Portuguese (Brazil)
por pt-PT Portuguese (Portugal)
ron ro Romanian
rus ru Russian
slo sk Slovak
slv sl Slovenian
spa es Spanish
swe sv Swedish
tha th Thai
tur tr Turkish
vie vi Vietnamese
zsm ms Malay
Google Language CIQ Website
cs Czech Čeština
da Danish Dansk
de German Deutsch
el Greek Ελληνικά
es Spanish Español
fi Finnish Suomi
fr French Français
hr Croatian Hrvatski
hu Hungarian Magyar
id Indonesian Bahasa Indonesia
it Italian Italiano
iw Hebrew עִברִית
ja Japanese 日本語
ko Korean 한국어
ms Malay Bahasa Melayu
nl Dutch Nederlands
no Norwegian Norsk
pl Polish Polski
pt-BR Portuguese (Brazil) Português (Brasil)
pt-PT Portuguese (Portugal) Português (Portugal)
ru Russian Русский
sk Slovak Slovenčina
sl Slovenian Slovenščina
sv Swedish Svenska
th Thai ไทย
zh-CN Chinese (Simplified) 简体中文
zh-TW Chinese (Traditional) 繁體中文