Multilingual Packages

Hey guys,

I’m currently developing a package which adds a single page to the dashboard.
Now the information presented on the new single page has to be available in different languages.

So I used the t() and t2() function in my template and used this command afterwards to generate the .po and .mo files:

concrete5 c5:package-translate handyman -l de_DE

That worked out fine. After the execution my package had a “language” directory with the .po and .mo files.

But what’s next? The documentation does not describe further and I can’t find anything relating to the issue.

Thanks for help in advance!

Translations are managed through https://translate.concretecms.org/. This site manages an open pool of translatable phrases and translations.

If your package is submitted to the marketplace, it is automatically submitted to https://translate.concretecms.org/. If it is not in the marketplace, my understanding is that you can upload it directly to https://translate.concretecms.org/

For marketplace packages, the translations for a package can be pulled in to a site through the site dashboard. I don’t know how much of that functionality you get for non-marketplace packages. @mlocati is the expert on translation, so hopefully he can add some detail here.

(Don’t let that be the foundation of a marketplace or not decision, there are many other factors to consider for a marketplace package).

There is also a section of the multilingual part of the site dashboard where you can review current translations, fill in the gaps and make corrections specific to your site, so you are not wholly dependant on https://translate.concretecms.org/.

1 Like

The package is planned to be uploaded to the marketplace soon. I’ve aleardy finished todo’s like keeping the style guidelines for CSS and PHP code by using best practises.

But since I live in Germany and work for a german company, I know how to translate it properly. I just don’t know where I can insert my german translation. I checked the section in the multilingual module but as soon as I click the “reload strings” button, it throws an exception which I don’t understand yet. I will upload a screenshot of that.

If I might get more details from @mlocati, that’d be nice!

The “Reload strings” button:

Exception:

For the marketplace, we require the package to be in English and all text to be in t() functions. We don’t require translations to be in place and bundled with the package. In many ways it is better to not bundle translations and use the dashboard to pull them in from https://translate.concretecms.org/ as that decouples translation from code version.

Assuming you are on v9.1.3, please report the exception as an issue on GitHub and mention @mlocati.

I see, so there is no need to put the translations into the package, is that correct?
So in my understanding the process is like this:

  1. Put my translatable strings into t() functions
  2. Upload the package into the marketplace (The translator group handles the translations)
  3. Soon after I can put the translation from the dashboard into the site

Is that correct?

Alright, I will report it on GitHub!

The translator group will not necessarily handle the translations.
2a) To make sure, you should join the translation site as a translator and make sure all your translations are entered there.

Why wouldn’t they not necessarily handle it?

Anyway, thank you very much for your support. It helped a lot to understand the process!

The translate site provides the translation files for any site to install. But these files may only be partially complete.

It is up to volunteer translators to login to the translate site and provide the translated phrases that are used to populate the translation files.

Hence the fastest way to progress your own German translation files to 100% complete is to volunteer as a translator and input the translations for any fragments used in your package not already translated.

1 Like

The standard way packages are translated is:

  1. you create a package using English texts, enclosing them in t()/tc()/t2() calls
  2. you submit the package to the Concrete Marketplace for approval
  3. the packages submitted to the Concrete Marketplace will soon be listed at Translate :: Concrete CMS
  4. volunteer translators translate the package
  5. people using the package may fetch the translations inserted at translate.concretecms.org in 2 ways:
    1. with the System & Settings > Basics > Languages > Install/Update Languages dashboard page
    2. with the c5:install-language CLI command

Please remark that you too can contribute to package translations (even just to to translate your own packages).
For example, if you want to help translating to German, you can ask to join the German Translators Group at Teams :: Concrete CMS. Once your request has been approved, you can start translating.