Page Builder CK (since version 2.5.0) has an integrated feature that allows you to use translatable strings everywhere in the component content (article, page, module ...). This method is useful when you need to have a single form or content structure in backend and allows the text to be multilanguage in frontend. The best example for this, is the contact form addon :
- you can have only 1 contact form
- set the texts using CKTEXT in the backend
- add your translation in the joomla language component
- have your contact form automatically translated in frontend
How to add a translatble string
In the following example we will use the Contact Form addon from Page Builder CK. Set up a field and write the label like this
CKTEXT[CUST_REFERENCE]
CKTEXT[ ]
is the container of your translatable string. You must write a string in the bracket, this string will be use in the language definition
CUST_REFERENCE
is the string that you will use in the language definition. This is a string that you define, it can be anything (uppercase, no space, no special characters)
You contact form will now look like this in the admin interface
Add the translations for your string
In the example, your string is : CUST_REFERENCE
Go in your joomla Admin >> Extensions >> Languages >> Overrides
, this will open an interface where you can tell to joomla which string to translate and give the translations for each language installed.
Click on the New
button to add a new language override (you must select a language, example English - Site
). Write the string and the translation in the fields
Click on the Save button to save your translation. You can repeat this step for each language that you want to use (english, french, etc ...)
You contact form is translated !
Just check on frontend, you will get your new string translated
News