FIRModelManager(Translate)

Extensions to ModelManager for Translate-specific functionality.

  • Deletes the downloaded translate remote model.

    Translator instances need models for both languages involved in the translation. Deleting a language will make all Translator instances having that language as a source or target inoperable (unless the instance has already been used for translation, in which case it will keep working until process exit). Deleting built-in models (currently only English) does nothing and completes successfully.

    Declaration

    Swift

    func deleteDownloadedTranslateModel(_ remoteModel: FIRTranslateRemoteModel, completion: @escaping (Error?) -> Void)

    Parameters

    remoteModel

    Which model to delete locally.

    completion

    Called back on success (error is nil) or failure.

  • Retrieves a set of already-downloaded translate models (including built-in models, currently only English) for the given Firebase app. These models can be then deleted through deleteDownloadedTranslateModel:completion: API to manage disk space.

    Declaration

    Swift

    func availableTranslateModels(app: FIRApp) -> Set<AnyHashable>

    Parameters

    app

    The Firebase app.

    Return Value

    a set of all currently available language models.