Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
fetchLocaleTranslation example
$this
->connection = KernelLifecycleManager::
getConnection
(
)
;
}
public
function
testChangeLishLocalTranslationOfUsLocale
(
)
: void
{
$migration
=
new
Migration1675323588ChangeEnglishLocaleTranslationOfUsLocale
(
)
;
$migration
->
update
(
$this
->connection
)
;
$enLangId
=
$this
->
fetchLanguageId
(
'en-GB',
$this
->connection
)
;
if
(
$enLangId
)
{
$locale
=
$this
->
fetchLocaleTranslation
(
$enLangId
, 'en-us',
$this
->connection
)
;
static
::
assertNotNull
(
$locale
)
;
static
::
assertEquals
(
'English (US)',
$locale
)
;
}
$deLangId
=
$this
->
fetchLanguageId
(
'de-DE',
$this
->connection
)
;
if
(
$deLangId
)
{
$locale
=
$this
->
fetchLocaleTranslation
(
$deLangId
, 'en-us',
$this
->connection
)
;
static
::
assertNotNull
(
$locale
)
;
static
::
assertEquals
(
'Englisch (US)',
$locale
)
;
}
}