public static void downloadLanguageModels(final Context context) {
        final List<Language> languages = getSupportedLanguages();
        getDownloadedLanguageModels(availableLanguages -> {
            languages.removeAll(availableLanguages.stream().map(Language::new).collect(Collectors.toList()));

            final SimpleDialog.ItemSelectModel<Language> model = new SimpleDialog.ItemSelectModel<>();
            model.setItems(languages)
                    .setDisplayMapper((l) -> TextParam.text(l.toString()))
                    .setChoiceMode(SimpleItemListModel.ChoiceMode.MULTI_CHECKBOX);

            SimpleDialog.ofContext(context).setTitle(R.string.translator_model_download_select)
                    .selectMultiple(model, lngs -> {
                        for (Language lng : lngs) {
                            RemoteModelManager.getInstance()
                                    .download(new TranslateRemoteModel.Builder(lng.getCode()).build(), new DownloadConditions.Builder().build())
                                    .addOnSuccessListener(s -> Toast.makeText(context, context.getString(R.string.translator_model_download_success, lng.toString()), Toast.LENGTH_SHORT).show())
                                    .addOnFailureListener(e -> Toast.makeText(context, context.getString(R.string.translator_model_download_error, lng.toString(), e.getMessage()), Toast.LENGTH_LONG).show());
                        }
                    });
        });
    }
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