Hard coded text
Hard coded text in templates is managed using the Language Pack module in Jadu CMS.
A non-technical user interface is provided to add, update and remove text in the language pack.
Photon provides functions to retrieve the appropriate text based on the locale associated with the site.
The function to retrieve text takes two arguments:
- the reference for the string to retrieve.
- an array of parameters to replace placeholders in the text (optional).
{{
getTranslatedString(
'password-reset-email-ip-statement',
[app.request.getClientIp()]
)
}}
Within page and component controllers, translated text can be retrieved using the function
getTranslatedString()
ofPhoton\Core\Controller\Page
.
<?php
$crumb->setTitle($this->getTranslatedString('az-page-link'));
Site locale
The locale of a site is set within the JaduLanguagePacksToSites
database table. Where no matching record is found, requests for text fallback to the language pack installed with Jadu Central.
New language packs can be defined within Jadu Central and are associated with a locale. Available locales are defined within the JaduLanguageLocales
database table.