public static void getTranslator(final Activity activity, final Status translationStatus, final Language sourceLng, final Consumer<Language> unsupportedLngConsumer, final Consumer<List<OfflineTranslateUtils.Language>> downloadingModelConsumer, final Consumer<Translator> translatorConsumer) {
        if (!isLanguageSupported(sourceLng)) {
            unsupportedLngConsumer.accept(sourceLng);
            return;
        }

        final String sourceLngCode = TranslateLanguage.fromLanguageTag(sourceLng.getCode());
        findMissingLanguageModels(sourceLngCode, missingLanguageModels -> {
            if (missingLanguageModels.isEmpty()) {
                OfflineTranslateUtils.getTranslator(sourceLngCode, translatorConsumer);
            } else {
                SimpleDialog.of(activity).setTitle(R.string.translator_model_download_confirm_title).setMessage(TextParam.id(R.string.translator_model_download_confirm_txt, String.join(", ", missingLanguageModels.stream().map(OfflineTranslateUtils.Language::toString).collect(Collectors.toList())))).confirm(() -> {
                    downloadingModelConsumer.accept(missingLanguageModels);
                    OfflineTranslateUtils.getTranslator(sourceLngCode, translatorConsumer);
                        },
                        () -> translationStatus.abortTranslation()
                );
            }
        });
    }
Utility method to get a Translator object that can be used to perform offline translation
@param activity      the calling activity
@param sourceLng     language to translate from
@param unsupportedLngConsumer    returned if the sourceLng is not supported
@param downloadingModelConsumer  returned if language models need to be downloaded, should be used to show a progress UI to the user
@param translatorConsumer        returns the translator object
main/src/main/java/cgeo/geocaching/utils/OfflineTranslateUtils.java