![]() |
Summary | Help translating themes and theme components by easily sharing the translations done in the Discourse interface |
![]() |
Preview | Sharing themes on theme creator is currently not possible |
![]() |
Repository | GitHub - moin-Jana/share-theme-translations |
![]() |
Install Guide | How to install a theme or theme component |
![]() |
New to Discourse Themes? | Beginner’s guide to using Discourse Themes |
Install this theme component
Discourse makes it easy to translate themes and theme components. But these translations often stay only on your local site.
This component helps you share your translations with the community and the author as a pull request to the repository or by posting them in the topic here on Meta.
How it works
This component adds a section below the translation interface when a remote theme or component contains translatable texts. From there, you can open a modal that helps you share your translations in various ways.
Note on default branches
The component assumes that the repository’s default branch is namedmain
. If the repository uses a different name (likemaster
), some links may not work correctly and might require manual adjustment.
Create new translation files on GitHub
If the theme is hosted on GitHub and the language doesn’t yet have a translation file, the button will:
- open the GitHub editor with the correct path (e.g.
locales/de.yml
) - pre-fill the editor with your translations, properly formatted
- include theme descriptions and settings (optional)
Descriptions can’t be translated in the Discourse UI, but you can edit them directly in the GitHub editor before saving. If you don’t want to translate them you can also un-check the checkbox to exclude them.
Detailed steps
- After translating, click the button to open the modal
- Click “Create pull request”
- Fork the repository
- The editor will open with your translations pre-filled. If you want to you can translate the descriptions directly in the file.
When you disabled the checkbox to exclude descriptions, those won’t be included which simplifies the text in the editor.
- When you are ready click “Commit changes…”, then “Propose changes”, and finally “Create pull request” (twice).
That’s it - you’ve shared your translations!
Improve and add translations on GitHub
Even if a translation for your language exists, you can still improve it and add missing translations. This process is a bit less streamlined. The button will:
- open the GitHub editor with the correct path (e.g.
locales/en_GB.yml
) - instead of pre-filling the GitHub editor, the translations will be copied to your clipboard so you can easily paste them in.
- including additional information like the theme description and settings is possible if the language of your interface is the same as the translations you are editing. Otherwise the component cannot get the descriptions in the correct language and these are excluded and you copy only the translated texts. In that case, make sure not to overwrite the descriptions when pasting your changes. The component will warn you beforehand, so you can easily switch your interface language and include descriptions.
Detailed steps
- When your interface language doesn’t match the translation language (in this case my interface language is English US and I am translating to English UK) you have two options:
A. Change your interface language before opening the modal
B. Continue and open the modal without switching the language. - You will see the modal highlighting your edits
A. In case your interface language is also the language you translate to, you can choose to exclude descriptions using the checkbox
B. Otherwise, the checkbox will be disabled.
- Click “Copy & open GitHub” and fork the repository
- You will see the editor with the translations currently saved on GitHub.
A. If descriptions were included you can simply simply replace the entire file contents.
B. In case you didn’t switch your locale or you unchecked the checkbox only the theme translations were copied. So only replace those with your translations. Pay attention that everything is indented correctly.
- You can also edit the descriptions. When you are ready click “Commit changes…”, then “Propose changes”, and finally “Create pull request” (twice).
That’s it - you’ve shared your translations!
Some theme components use a translation platform for translations. For example many official components are translated on Crowdin. Those files have a warning at the top which tells you where you can contribute your translations instead.
Share translations on Meta
When you don’t have a GitHub Account and the link to the Meta topic is available, you can also post your translations there and ask the author to include them in the next update. Clicking “Copy & open Meta” will format your translations, copy them to your clipboard, and open the Meta topic in a new tab. Then simply click Reply and paste the formatted translations that were copied for you.
Detailed steps
- After translating, click the button to open the modal.
- Click “Copy & open Meta”.
- Click “Reply” to open the composer and paste your translations.
- If you didn’t exclude the descriptions you can edit them directly before posting your translations.
You shared your translations
If no Meta topic link was provided you can copy the translations and search for the relevant topic manually. Don’t forget the formatting of your post in that case.
Share translations on other platforms
If the theme is hosted on GitLab or another platform, your translations will be copied to your clipboard, and the repository will open in a new tab. Unlike GitHub, GitLab does not support prefilled content in the URL for the file editor. So you’ll need to paste the translations manually, even for new files.
I didn’t research how links for editing files are built on other platforms. So in that case you are taken to the file or directory in the repository and need to find out how to create or edit a file on your own.
Settings
This component includes one setting: hide_texts
It hides the introductory explanation and displays a shorter message shown when your interface language doesn’t match the language you’re translating into.
Thoughts for the Future
Currently, the component can’t detect if a theme is translated externally - for example, via Crowdin. This would be technically possible if the about.json
file included an optional translation_url
field, just like it already can include a license or meta topic link. For example:
"translation_url": "https://discourse.crowdin.com/discotoc"
With that in place, the component could:
- hide the sharing button when translations are handled elsewhere
- display a message that explains where to contribute instead
- avoid unnecessary pull requests or confusion
This wouldn’t only help this component - it would be helpful in general for admins to find where to contribute translations.