Комментарии:
DID YOU GET MASSIVE VALUE FROM TODAY'S VIDEO?! IF YES: 🔥
1. SMASH that LIKE & SUBSCRIBE button! 👊
2. COMMENT below what you learned or what tutorials you want to see next ✍
Good job bro, JESUS IS COMING BACK VERY SOON;WATCH AND PREPARE
ОтветитьAre you Bosnian? That's so--on point, I'm making a love-letter / website for my wife who has lived in Bosnia all her life, making it multi-lingual is pretty important to me
ОтветитьThere no way yo integrate Google Translate into a website
Ответитьwhat should I do if all my website data from data base directly. how can I translate it?
ОтветитьToo zemo, kralj si. Ovo mi je trebalo :) Awesome as always!
ОтветитьI would consider of using another approach. When instead associative array you would use a function like t("manu_support", "Support"), which will resolve to default "English" text out of the box unless a translation was provided & requested. This way for English you would not even have to touch the database.
To make this easier, you could then build a basic tool which would register all functions, scan all PHP files in a project and run (simple regex on each files) that would then register all phases in to database (if not exists). So you don't need to manually register them, and all you would have to do is to translate.
Well... This is good for a small websites, but it'll get super hard to do it on larger projects. So I would probably use something like Deepl API and then display the translation using js.
And if you want to use your translation I would also use js to get your translated strings in JSON and then apply them to the frontend, so you don't need to change every string manually in the backend code, and you could also make a cookie to remember the selected language.
But as an example, your video is good enough!
Also, Senaid, it is not too difficult to translate from English to Bosnian, because you speak Bosnian also. What if you need to translate into say, 5 other languages, what's the best way to translate each part of your pages before entry to the database?
ОтветитьBest video
Ответить