Nextcloud PHP API (master)

ITranslationManager

Tags
since
26.0.0

Table of Contents

Methods

canDetectLanguage()  : bool
getLanguages()  : array<string|int, LanguageTuple>
getProviders()  : array<string|int, ITranslationProvider>
hasProviders()  : bool
translate()  : string

Methods

canDetectLanguage()

public canDetectLanguage() : bool
Tags
since
26.0.0
Return values
bool

translate()

public translate(string $text, string|null &$fromLanguage, string $toLanguage) : string
Parameters
$text : string
$fromLanguage : string|null
$toLanguage : string
Tags
since
26.0.0
throws
PreConditionNotMetException

If no provider was registered but this method was still called

throws
InvalidArgumentException

If no matching provider was found that can detect a language

throws
CouldNotTranslateException

If the translation failed for other reasons

Return values
string

        
On this page

Search results