This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Translate Android strings.xml files using DeepL API. | |
| Requires an API key from https://www.deepl.com/pro-api | |
| Usage: | |
| - Set the DEEPL_API_KEY environment variable to your key or pass it via --auth-key | |
| - Run the script with --res-dir pointing to your Android res folder (or without args to see help) | |
| - Optionally specify source and target languages, and files to translate. | |
| (Default: Extend existing translations in values folders from EN strings.xml) | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.annotation.SuppressLint; | |
| import android.content.Context; | |
| import android.content.SharedPreferences; | |
| import android.os.Build; | |
| import android.preference.PreferenceManager; | |
| import android.util.Log; | |
| import androidx.annotation.NonNull; | |
| import androidx.annotation.Nullable; | |
| import androidx.annotation.RequiresApi; |