LocalizationService
This service class contains functions related to localization functionality.
All public functions are available in the Twig template renderer.
Namespace
IO\Services
Methods
public getLocalizationData():array
Get localization data for the frontend. This data contains active shipping countries, active languages, the current shipping country and the shop language.
public setLanguage($newLanguage, $fireEvent = true)
Set a new language
Type |
Name |
Description |
|
The new language (ISO-639-1) |
|
|
Optional: Fire a LanguageChanged event (Default: false) |
public getTranslations($plugin, $group, $lang = null):mixed
Get translations for a plugin. This function is primarily used in the frontend to enable clientside translation.
Type |
Name |
Description |
|
The plugin, whose translation is to be fetched. E.g "Ceres" in "Ceres::Widgets.exampleTranslation" |
|
|
The translation group, which is to be fetched. E.g "Widgets" in "Ceres::Widgets.exampleTranslation" |
|
|
Optional: The language for the translations. By default uses the current active language. |
public hasCountryStates($countryId):bool
Check if a specific country has states
Type |
Name |
Description |
|
An countries id |