-
Notifications
You must be signed in to change notification settings - Fork 0
Translating
Warning
Cohesion translations are still in development
The localization format is still incomplete and may change in the future, rendering translations created now with little to no use.
Thank you for your interest in helping translate Cohesion
This page explains how the localization system works and how you can contribute.
- Each language has its own file on the
localefolder. - English is the default language and is written directly in the HTML.
- Other languages override the English text using locale JSON files.
- If a translation is missing, the English text is automatically used as a fallback.
- Locale files are loaded dynamically at runtime.
This means:
- You never need to touch the HTML.
- You only translate what you want.
- Missing strings never break the UI.
- Fork the repository
- Create or update your locale file
- Test your translation
- Commit your changes
- Open a Pull Request
Please include:
- The language name
- Translation progress
-
Save your locale file
-
Open console, type
Language.set('language code, declared on meta') -
Navigate through the UI
-
Look for:
- Missing strings
- Broken grammar
- Overflowing text
Note
In the case you find overflowing text, report an issue.
The meta section describes the language itself and its translators.
Example:
"meta": {
"code": "pt-br",
"name": "Portuguese (Brazil)",
"nativeName": "Português do Brasil",
"direction": "ltr",
"status": "30%",
"translators": [
{
"name": "Your Name",
"role": "Translator",
"links": {
"github": "https://github.com/yourname",
"website": "https://example.com"
}
}
]
}-
codemust be according with the ISO 639-1 Language Codes -
namemust be in English -
nativeNamemust be written in the language itself -
directiondescribes which direction is text written,ltrmeans left to right andrtlmeans right to left -
statusis completely arbitrary, just a number that roughly describes how complete is the translation - Add yourself to
translatorsif you contribute
The strings section contains text mappings.
Example:
"strings": {
"dialogs.about.main.credits": "Credits",
"dialogs.settings.main.appearance": "Appearance"
}- Do not rename keys
- Do not delete keys
- Keys are shared across all languages
Some translations include HTML (such as links).
These entries are explicitly marked in the HTML and are safe to translate.
Example:
"strings": {
"dialogs.about.legal.notice": "This application is licensed under the <a href='https://www.gnu.org/licenses/gpl-3.0.html'>GNU GPL v3</a>."
}Please do not add HTML to strings unless it already exists in English.
Every translation helps this project grow.
Even translating a few strings makes a difference. Contributions of any size are welcome!
Learn the basic syntax of markdown and the Cohesion flavored markdown
Learn more advanced markdown applications
Learn how to use metadata on your documents to better organize your files
Learn how to create scripts and automation inside of Cohesion documents
Learn how to use commands to speed up your writing
