mlkit-translate/app/src/main/java/com/google/firebase/samples/apps/mlkit/translate/java/TranslateViewModel.java
void downloadLanguage(Language language) {
        FirebaseTranslateRemoteModel model =
                getModel(FirebaseTranslateLanguage.languageForLanguageCode(language.getCode()));
        modelManager.downloadRemoteModelIfNeeded(model).addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                fetchDownloadedModels();
            }
        });
    }
// Starts downloading a remote model for local translation.
Starts downloading a remote model for local translation.
Starts downloading a remote model for local translation .
void downloadLanguage(Language language) {
        FirebaseTranslateRemoteModel model =
                getModel(FirebaseTranslateLanguage.languageForLanguageCode(language.getCode()));
        modelManager.downloadRemoteModelIfNeeded(model).addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                fetchDownloadedModels();
            }
        });
    }
void downloadLanguage ( Language language ) { FirebaseTranslateRemoteModel model = getModel ( FirebaseTranslateLanguage . languageForLanguageCode ( language . getCode ( ) ) ) ; modelManager . downloadRemoteModelIfNeeded ( model ) . addOnCompleteListener ( new OnCompleteListener < Void > ( ) { @ Override public void onComplete ( @ NonNull Task < Void > task ) { fetchDownloadedModels ( ) ; } } ) ; }
Starts downloading a remote model for local translation.
Starts downloading a remote model for local translation .