• Devi18n
  • Simplify translation process with Weblate

Justoverclock That is how it works - bot always overwrites translations files with state from Weblate, because Weblate is the single source of truth. You need to made these translations on Weblate to avoid this.

In general you should not edit .yml files directly in your language pack. There is not much point in using Weblate if you want to do that.

    Justoverclock Hopefully Flarum 1.0.0 will be released tomorrow, Weblate will switch to translations for stable Flarum, and we leave this whole 0.1.0-beta mess behind. I hope that Flarum 1.x -> 2.0.0 transition will use some sane versioning and I will be able to prepare better for it, so this situation will not happen again.

      rob006 I really like how you set up weblate to translate Flarum! I already have translated my SSO extension to italian in its repo. Can they be imported/synced with its Weblate component?

        maicol07 i dont remember well, but i think this could be done if is in json format, @rob006 can confirm this. if yes i could do this for you

        edit: oh...just a few line...i will do this manually

        maicol07 I could add an exception for your extension, so it won't be displayed on Weblate for languages, that are already bundled in your extension. In general it is better to keep translations in extension, so I suggest to keep it that way and adjust Weblate to not duplicate translations.

          maicol07 I could do that, but as I said, keeping them in extension is more reliable. In that way translations are always available (for example right now there are two Italian language packs - if you remove bundled translations from your extension, it won't be translated if someone is using https://packagist.org/packages/nearata/lang-italian) and always match extension version, so you never have situation where translations from language pack are for different version of extension than you have installed. Do far if extension have bundled translations maintained by extension author, I ignored them on Weblate, because it is just easier to maintain it in one place by one person. I just never do that retroactively, and support for Italian language was added to Weblate after your extension was added to list of supported extensions, so I never noticed that Italian translation is not needed for your extension.

            rob006 I think that maybe if someone wants to translate the extension is easier on Weblate instead of forking the repo and then create the PR. Syncing the extension repo with Weblate will push PRs directly to the master branch and then I'll merge them with the extension. This way the translations are bundled with the extension

              maicol07 I was talking only about Italian language - if you're able to translate extension to Italian by yourself, it is better to do that directly in extension and not rely on Weblate and language packs (there will always be a delay in adjusting language pack, and translators may not fully understand the context of specific phrases, so as an author of extension you may be more competent to translate them correctly). For other languages it is better to keep translations on Weblate and language packs, since you will not be able to verify them anyway.

              But in any case I don't think it is a good idea to have duplicated translations both in extension and language pack. I'm not sure how Flarum merges duplicated translations for the same key, but there is always the risk that outdated translation will take precedence.

              Translations for Flarum core and official extensions are updated for 1.0.0 on Weblate, so currently Flarum 1.x is a target. I'll keep old extensions for beta 16 for few months to give developers time to catch up. As always I recommend to use translation status pages to find which extensions are compatible and focus on them.

                Justoverclock If by "reupload new translation files" you mean upload them to Weblate, then yes, you can always do that and you didn't have to wait for 1.0.0 release. But if you want to upload them directly to language pack, then bot will overwrite them again and 1.0.0 relase didn't changed anything in this matter - language pack will always be overwritten by state from Weblate.

                  rob006 i think i will create new repo with a dedicated language pack for 1.0, i have my translated files i do not want to translate all again 🙉

                    Justoverclock Wait, what?! There are only few changes in core and official extensions for 1.0.0, you should be able to copy them from old commits. If you don't want to use Weblate, I can remove your language from Weblate and bot will no longer overwrite your changes, there is no need for separate repo.

                      rob006 there's a way to filter only the 1.0 changes? i would keep weblate, i will look into this