LanguageTranslator::findTranslations() method

Find all translation(s) for given text

Scans all textdomains to find translations.

Available since version 3.0.237.

Usage

// basic usage
$array = $languageTranslator->findTranslations(string $text);

// usage with all arguments
$array = $languageTranslator->findTranslations(string $text, $context = '', array $options = []);

Arguments

NameType(s)Description
textstring
context (optional)string, array
  • Optional context label for the text, to differentiate from others that may be the same in English, but not other languages.
    • If context is not needed you may optionally specify the $options array here.
options (optional)array
  • getInfo (bool): Return verbose array of information for each found translation? (default=false)
  • limit (int): Limit to this many results or 0 for no maximum (default=0)

Return value

array
  • Returns array of strings containing translations of given text.
  • Returns array of arrays, each with verbose info, if getInfo option requested.

LanguageTranslator methods and properties

API reference based on ProcessWire core version 3.0.248

Latest news

  • ProcessWire Weekly #582
    The 582nd issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 5 July 2025
  • New ProcessWire admin redesign
    When you upgrade to ProcessWire 3.0.248 or newer (currently the dev branch), you’ll immediately notice something new and beautiful…
    Blog / 9 May 2025
  • Subscribe to weekly ProcessWire news

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer