LocaleTest
extends CiviEndToEndTestCase
in package
Class LocaleTest
Tags
Table of Contents
Methods
- getLanguageExamples() : array<string|int, mixed>
- setUpBeforeClass() : void
- testSetLanguage() : mixed
- APIv4 allows you to request that operations be processed in a specific language.
Methods
getLanguageExamples()
public
getLanguageExamples() : array<string|int, mixed>
Return values
array<string|int, mixed>setUpBeforeClass()
public
static setUpBeforeClass() : void
testSetLanguage()
APIv4 allows you to request that operations be processed in a specific language.
public
testSetLanguage(string $civiLocale, string $expectUfLocale, string|array<string|int, mixed> $translator, string $inputString, string $expectString) : mixed
Parameters
- $civiLocale : string
-
The locale to specify in Civi. (eg Civi\Api4\Foo::bar()->setLanguage($civiLocale)) Ex: 'de_DE'
- $expectUfLocale : string
-
The corresponding locale in the UF. Ex: 'de'
- $translator : string|array<string|int, mixed>
-
The user-framework's translation method. Ex: 't' (Drupal) or '__' (WordPress)
- $inputString : string
-
The string to translate. Ex: 'Yes', 'Login', 'Continue'
- $expectString : string
-
The string that should be returned. Ex: 'Ja', 'Anmeldung', 'Fortsetzen'