Chapters
44 Chapters
|
4:19:56
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
17.
No Data Duplication! Fancy Computed Prop
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
This course is also built to work with Vue 3!
What JavaScript libraries does this tutorial use?
// package.json
{
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.15.1", // 5.15.1
"@symfony/webpack-encore": "^0.30.0", // 0.30.2
"axios": "^0.19.2", // 0.19.2
"bootstrap": "^4.4.1", // 4.5.3
"core-js": "^3.0.0", // 3.6.5
"eslint": "^6.7.2", // 6.8.0
"eslint-config-airbnb-base": "^14.0.0", // 14.2.0
"eslint-plugin-import": "^2.19.1", // 2.22.1
"eslint-plugin-vue": "^6.0.1", // 6.2.2
"regenerator-runtime": "^0.13.2", // 0.13.7
"sass": "^1.29.0", // 1.29.0
"sass-loader": "^8.0.0", // 8.0.2
"vue": "^2.6.11", // 2.6.12
"vue-loader": "^15.9.1", // 15.9.4
"vue-template-compiler": "^2.6.11", // 2.6.12
"webpack-notifier": "^1.6.0" // 1.8.0
}
}
4 Comments
Thank you for this formation, however could you do an episode on translation in Vue.js?
Hi sidi!
As of today, we have no plans on releasing a tutorial covering i18n and Vue, although this has been added to our ideas list!
In my view (and my coworkers here might be able to share better insights of this). i18n is very well covered by Symfony, and what sites usually do is: use Twig to create a JavaScript object with the translated phrases your application uses (this can be also generated into separated js files and cached), then use this object to populate your various strings along the app.
Aside from this, there is a plugin called Vue-i18n that is worth looking at which might provide a better solution for client-side only translations!
Hi Matias!
Thank you very much for your answer, how do you do in twig to get the list of all the translations by language you have in your symfony apps?
Hey Sidi!
As far as I know, the best course of action would be to isolate the phrases that the Vue app needs. Set them up in variables inside the controller (it could be an associative array for multiple phrases) like this:
As stated in the Translations official documentation <a href="https://symfony.com/doc/current/translation.html#basic-translation">here</a>.
Once you have this, you can easily transfer those translated phrases onto the twig template, where you can get them into a JavaScript object.
"Houston: no signs of life"
Start the conversation!