skip to Main Content

I’m relatively new to Laravel, and my manager has tasked me with automatically translating our website from English to Arabic and vice versa, while ensuring that the localization of content is respected for each language. I’ve been searching for solutions for the past two weeks, but I haven’t been able to find a satisfactory method.

I’d prefer not to use the lang folder to manage translations because it’s not practical, especially considering that the person managing the website is not a developer and shouldn’t have to edit code each time a translation is needed.

I’ve heard about ChatGPT and its potential to assist with automatic translation, but I’m unsure about the process. Can anyone provide guidance or suggest alternative solutions to achieve automatic translation and localization in Laravel?

Your help would be greatly appreciated. Thank you!

2

Answers


  1. Chosen as BEST ANSWER

    I tried using it, but unfortunately, its translations are not satisfactory. Additionally, I encountered difficulties managing the localization of content. I also explored DeepL as an alternative, but it's not available for free.


  2. Why not use google translate plugin ?

    Here is a quick copy paste example of one I used in my projects:

    <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit">
        </script>
    
        <script type="text/javascript">
            function googleTranslateElementInit() {
                new google.translate.TranslateElement({
                        pageLanguage: 'bg',
                        includedLanguages: 'en,el,ro,sr,mk,bg',
                        autoDisplay: false,
                        gaTrack: true,
                        gaId: '{replace with your gaId}'
                    },
                    'google_translate_element')
            }
        </script>
    

    Here is a screenshot of how the end result looks on my site: https://prnt.sc/Zt38hoWaqb_S

    Edit: You also need an empty google_translate_element div:

    <div id="google_translate_element"></div>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search