• Extensions
  • Linguist, customize translations with ease

Linguist by FriendsOfFlarum

MIT license Latest Stable Version Total Downloads

With this extension you can configure alternate or missing translation strings for your forum. Includes:

  • No manual translation file editing required, everything is configured via the admin UI
  • Translate frontend or backend strings
  • Override the translation for a specific locale or all installed locales
  • Easily search for strings by name or value in any language
  • Multiple filters to find strings that are missing translations or belong to a specific extension

After editing translations, Linguist will offer you the opportunity to clear the forum cache.
For performance reasons, Linguist won't attempt to clear the cache by itself.

If the new translations don't show up, try clearing the cache again by using Dashboard > Tools > Clear cache or by running php flarum cache:clear.

Also note Flarum uses a "one place, one translation key" approach to translations, so you might have to edit several keys to replace a specific keyword.

Installation

Use Bazaar or install manually:

composer require fof/linguist

Updating

To the next minor version:

composer update fof/linguist
php flarum migrate
php flarum cache:clear

To the latest compatible version:

composer require fof/linguist
php flarum migrate
php flarum cache:clear

Updating from Flagrow

This extension replaces Flagrow Linguist.

To upgrade from the old extension to the new one:

  • Disable the Linguist extension in the admin panel.

  • Run:

composer require fof/linguist

Composer should let you know that flagrow/linguist has been automatically removed.

  • Enable the new extension in the admin panel.

  • Your existing translations will be migrated to FoF Linguist automatically.

  • Edit a translation or clear the cache to apply the existing translations to the forum.

Configuration

Once enabled, a new tab will show up in the admin to configure translations.

The tab will list all translations strings registered by extensions on your forum.
You can customize the text by entering your own value in the field.

A special field "all" allows you to define a single text that will be shown in all languages.

Keep in mind some strings contain references in the form {referencename} that you have to keep identical if you want the data to show up.

Links

An extension by FriendsOfFlarum

    7 months later
    a month later

    Just released an update to Linguist UI (0.2.0). It now looks a lot more like other translation tools, and it should be a lot easier to search, browse and find the strings you want to replace !

    No actual new "features" in this release, it still works exactly the same in the background !

    You should be able to upgrade with

    composer require flagrow/linguist
    php flarum cache:clear

    This new UI should solve some usability issues that were reported previously. Let me know what you think !

    16 days later
    5 months later

    Now compatible with beta 8, for your greatest pleasure 👌

    With @Toby having just added translations caching in core, you can already expect Linguist to break again whenever that feature is released in a next Flarum upgrade. But I suppose it won't be before beta 9, so I have some time to find a way to make it work...

      8 days later

      Hello, it's possible to export translation?

      that's not a feature that's built-in at this time.

      But you can easily use a database tool like phpMyAdmin to export the content of the flagrow_linguist_strings table and import them back on another install.

      a month later

      manny For now there's no plan to allow translating anything that's not going through Flarum's translator. That could really hurt compatibility with other extensions that use emails as well.

      Can't you use Pretty Mail or Pretty Mail + Linguist to achieve it though ?

        7 days later
        15 days later

        szrcmk it looks like Bazaar translations aren't loaded inside Flarum to begin with. What language pack are you using ? Did Bazaar text appear prior to using Linguist ?

        Did you try clearing the cache manually, via the admin or the command line ?

        Could you post the output of php flarum info ? It would give us flarum version, linguist version and which language pack(s) you have.

        What you're doing there in Linguist shouldn't make any difference, English should be used by default if Bazaar isn't translated by your language pack and English text contains the same string you're trying to set.

        5 months later

        @clarkwinkelmann

        How about adding "default fallback". So as long as the field is empty, it'll fall back to english, which everyone supports atm.

        It's a huge headache with extentions that isn't multilingual.

          ThomasBang Flarum should fallback to english automatically, but doesn't do so in the front-end as reported in this issue flarum/core1774

          And it looks to me that fixing the issue in Flarum directly will require less work than trying to implement a fix via an extension like Linguist. The underlying problem in based on the fact that if you cross-reference translations that exist in English versus those that don't exist in English to find the ones to override, it goes over the standard memory limit and crashes PHP. If someone got any idea on a memory-frienly approach, feel free to add your thoughts to the Flarum issue linked above.

          If you really need to fix some extensions, you could filter translations by extensions, then copy every English translation you need manually to "default translation".

          16 days later

          Public service anouncement: as expected (since the beta 8 release already and announced above) this extension is affected by a breaking change in beta 9 and will require some changes to be compatible.

          I recommend not installing the current version at all on beta 9 as it might mess up with the new translation logic.

          You can follow the GitHub issue here: flagrow/linguist8

          I'll try to take a look in the next few weeks. You may contact me directly if you'd like to sponsor the update to get it sooner 😉

          Or if someone wants to have a try at a PR let me know so we don't start two different updates.

          I'm adding the incompatible tag here in the meantime.

            10 days later

            And if the opportunity to somehow pull out my translation, while you solve this problem?

              Alkir you can extract your translations from the flagrow_linguist_strings database. Then you'll need to write a script or do some manual editing to put it into a Yaml file for a translation.

              It's possible others have been able to continue using Linuist on beta9, by manually clearing the cache after every change. But I'm not 100% sure because nobody reported here.

                clarkwinkelmann

                I just did a clean install, I installed the Flagrow Linguist, I activated it, then imporeti the old table to the new database.

                worked perfectly on beta9

                I used laragon to import with 100% certainty