IanM Status: Production ready. Has a fair usage limit of approx 500 translation requests per day (excluding cached translations).

If I run php flarum cache:clear, does it clear the cached translations on posts as well? Thanks!

  • IanM replied to this.

    Lurker If I run php flarum cache:clear, does it clear the cached translations on posts as well? Thanks!

    No, the cached translations are stored in the database, so not affected by the cache:clear command

      IanM I just tested this now and I must say that it's impressive. With the default Google driver, it easily detects the language and provides the option (based on permission) for on-demand translation. Amazing work! With the ongoing Black Friday deal, I must say that this is a steal! 💰

      Question: How do I enable the dropdown language menu? Do I have to install a separate extension for that one?

      Finding: I tried using a local dialect and since it is very uncommon to be used in forums, I get this line instead: This post is in un instead of the usual This post is in French (if using a common language like French). For reference, I used "Cebuano". The extension is still able to identify it as a foreign language and give the option to translate to English.

        Lurker How do I enable the dropdown language menu? Do I have to install a separate extension for that one?

        The available languages in the dropdown are driven by a couple of factors:

        • The installed language packs (flarum-lang/....)
        • The permission View translation in any forum locale

        Lurker Also, I tried using a local dialect and since it is very uncommon to be used in forums, I get this line instead: This post is in un instead of the usual This post is in French (if using a common language like French). For reference, I used "Cebuano".

        The display of the language name here is driven by the browsers support of Intl.DisplayNames. If the language code cannot be localized, it will fallback to displaying the code itself, rather than leave the text missing

          IanM I see. Thanks for the explanation. One more question if I may. What would happen if a user hits the fair usage limit?

          • IanM replied to this.

            Lurker One more question if I may. What would happen if a user hits the fair usage limit?

            If the translation is already cached in your database, they would be able to view the translation as normal. If the translation has to be fetched from the provider and the limit has been reached, then they'll see a message saying This translation is not currently available, please try again later.

            IanM The available languages in the dropdown are driven by a couple of factors

            Please correct me if I’m wrong. If I wanted to create a bilingual forum, I just need to install and enable 2 language packs then configure the permission level. After that, users will have the option to choose their local language in the forum header and freely translate posts between the 2 languages installed.

            • IanM replied to this.

              Review: I did some comparison tests between DeepL and Google Translate and found the following:

              DeepL

              • For unsupported languages, the driver displays random languages in the auto-detect line (i.e. "This language is in Indonesian then Slovenian, etc...") and shows the original message in the translation box which is the expected behaviour.
              • For supported languages, a lot of people prefer this over Google Translate based on online reviews.

              Google Translate

              • Due to its wide language support, it's able to provide a good level of translation. For uncommon languages, grammatical mistakes are more frequent but the context is preserved. Despite the errors, it is better than not having any translation at all.
              • If the language is not found in the Intl.DsiplayNames database, the driver will display "This language is in un." in the auto-detect line.

              Overall, I would say that the free Google Translate would suffice for most forum needs. The only time I would choose DeepL over Google Translate is when translating longer paragraphs of text where context and tone are considered essential.

              Verdict: I'm glad I picked this up early. Though I'm still in my setup phase for my forum, I'll keep this as an admin/moderator feature until more multicultural members join. If you're reading this and you're still thinking about it, I say grab this now while the price is right. There will always come a time when you'll need this extension. 👍

              Bonus Usage: Translate spam posts before deleting them. 😂

              0.2.1

              • fix an issue where translations would not display under some circumstances
              • fix an issue where the language translation dropdown caused undesirable effects on mobile

              Note: I am aware of an issue when the DeepL driver is in use where the forum response times are increased. A further update will be released shortly to address this.

              Updating
              composer update ianm/translate
              php flarum cache:clear

              Thanks for the extension! My two cents, if you don't mind: I think some integration of Discussion Language would make sense here? For example to determine the current language - as it doesn't make sense to translate a English-tagged post into English, and also hide hide the option if it's the same language.

              • IanM replied to this.

                pkernstock My two cents, if you don't mind:

                Of course not, all feedback is welcome 🙂

                pkernstock some integration of Discussion Language would make sense here

                I do plan to integrate with fof/discussion-language in the new year actually. 👍

                pkernstock For example to determine the current language - as it doesn't make sense to translate a English-tagged post into English, and also hide hide the option if it's the same language.

                Did you run the detect command (php flarum translate:detect) after enabling the extension? 🤔 For posts where the language has been detected by the extension, the option to translate to the same language is removed already.. If the language is not detected (even if marked by discussion-language), then all languages (as dictated by the current permissions) are offered.

                New posts created whilst the extension is active will be detected automatically.

                The easiest way to tell if the extension has detected the language is by spotting the language header at the top of the post, like this:
                image

                  IanM Did you run the detect command

                  Oh! Apologies. I've successfully over-read that part in late night hours installing this extension. I'm now running the command, and it takes a while. Thanks!

                    pkernstock no problem. Yes, it can take a while to run the detection, if you have a large number of existing posts. Thankfully this is a one time process

                      @IanM, greetings. Awesome extension!
                      What does a license mean for non -commercial use and how much will one-time license cost for a commercial? Thanks

                        18 days later

                        IanM how well does this play with SEO? Do the cached translation turn into SEO juice as in if a post is in English and then cached and translated into Spanish for example, can Google see the Spanish translation of the post?

                        Also, does this translate Primary and secondary tags?

                        • IanM replied to this.

                          Syirrus how well does this play with SEO? Do the cached translation turn into SEO juice as in if a post is in English and then cached and translated into Spanish for example, can Google see the Spanish translation of the post?

                          There's currently no integration with SEO directly

                          Syirrus Also, does this translate Primary and secondary tags?

                          No, this extension focuses on the translation of user content only. Localizd by @glowingblue is the only extension I'm aware of to offer tag translations

                            IanM Thank you for responding to my questions 🙂. In your opinion, is your plug pretty stable? It looks like an awesome plugin I'm thinking about picking up.

                            • IanM replied to this.

                              Syirrus yes, on the whole the extension is pretty stable and is in use on a few production sites.

                              There is currently an issue with increased latency when the DeepL driver is in use, which I plan to release an update to address soon. The current workaround is to use either the Google Translate or Google Cloud Translate drivers, which do not cause this issue.