ride / web-i18n-expose
Ride module to expose the i18n translator to javascript
Installs: 3 614
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 12
Forks: 0
Open Issues: 0
Requires
- ride/app: ^1.0.0
- ride/app-i18n: ^1.0.0
- ride/lib-config: ^1.0.0
- ride/lib-event: ^1.0.0
- ride/lib-i18n: ^1.0.0
- ride/lib-mvc: ^1.0.0
- ride/web: ^1.0.0
- ride/web-i18n: ^1.0.0
This package is auto-updated.
Last update: 2024-12-13 00:01:49 UTC
README
Ride module to expose the i18n translator to javascript.
How It Works?
When this module is installed, the translator.js will be added to your HTML views. This will make the Ride translator object available in Javascript. You can request translations from it through the translate method. Once all your translations are requested, you will have to submit the keys through the submitTranslationKeys. Those keys will be included in the view from then on in the following requests.
Code Sample
You can translate a string in javascript with the following function:
rideApp.translator.translate('button.save'); rideApp.translator.translate('success.data.saved', {data: "Sme"});
Once all translations are requested, you need to submit these keys to make them available in the following requests:
rideApp.translator.submitTranslationKeys();
Related Modules
- ride/app
- ride/app-i18n
- ride/lib-config
- ride/lib-event
- ride/lib-mvc
- ride/lib-http
- ride/lib-i18n
- ride/web
- ride/web-i18n
Installation
You can use Composer to install this application.
composer require ride/web-i18n-expose