theredcorner / trctranslate
Use the âtâ function to output translations.
Installs: 900
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Type:craft-plugin
Requires
- craftcms/cms: ^3.0.0-RC1
This package is auto-updated.
Last update: 2024-06-09 21:07:59 UTC
README
Use the t()
Twig function to output I18n
like strings.
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require the-red-corner/trctranslate
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for TRCTranslate.
Configuring TRCTranslate
- Add a section with the handle
translations
. - Add a field with the handle
key
to thetranslations
section. You also have to include thetitle
field for this section.
Using TRCTranslate
Use the following syntax to display a translated string in your templates:
{{ t('footer.address.phoneNumber') }}
footer.address.phoneNumber
is the key of the translation entry.
Brought to you by The Red Corner