Repository navigation
Translating
Open CAD Studio's interface texts are kept in Fluent (.ftl) files, one per language, under locales/ in the repository:
locales/en-US/opencadstudio.ftl the source catalog, in English
locales/de-DE/opencadstudio.ftl German
locales/tr-TR/opencadstudio.ftl Turkish
...
en-US is the source. Every other catalog has exactly the same keys, with the text translated. The language is picked under Options › General; with System language the interface follows the operating system.
language =
.system = System language
.english = English
text-panel = Text
.counts = { $characters ->
[one] { $characters } character
*[other] { $characters } characters
}-
languageandtext-panelare messages,.systemand.countsare their attributes. The message and attribute names (left of=) are never translated; only the text right of=is. -
{ $name }is a value the program fills in, such as a count or a file name. Keep every one of them, with the same name. You can move it within the sentence. -
{ $n -> [one] ... *[other] ... }picks a text by number. Use the plural forms of your language ([one],[few],[many],[other]...); the*marks the default, which must be there. - Command names, and the options in prompts such as
[Convert/Revert/Show/Hide]and<Convert>, are what the user types. Keep them in English, as the other catalogs do:BCONSTRUCTION Geometrie wählen oder [Convert/Revert/Show/Hide]:.
- Fork the repository on GitHub.
- Edit
locales/<language>/opencadstudio.ftl, for examplelocales/fr-FR/opencadstudio.ftl. Search for the English text inlocales/en-US/opencadstudio.ftlto find its key, then the same key in your language's file. - Open a pull request. Small pull requests (one area of the interface at a time) are reviewed fastest.
To see your change, build and run the app as described in the repository's README and choose the language under Options › General.
- Copy
locales/en-US/tolocales/<tag>/, where<tag>is the language tag, such assv-SEoruk-UA, and translateopencadstudio.ftl. Text you have not translated yet can stay in English, but every key must be there. - In
src/i18n.rs, add the language toLanguage(its tag in#[serde(rename = "...")]), toLanguage::ALL, torequested()and tolabel(). - Add the language's name to the
languagemessage (for example.swedish = Svenska) in every catalog, so it appears in the language list in all languages.
If the code part is not for you, open a pull request with only the translated .ftl file and say so; the maintainers wire it in.
The test suite checks every catalog against the source on each pull request:
- no key is missing and there are no extra or duplicate keys;
- the file is valid Fluent syntax;
- each text keeps the same
{ $name }values as the English one; - no text is empty where the English one is not.
You can run the same check locally:
cargo test --lib every_catalog_covers_and_formats_the_source_catalogA plugin can be translated the same way. Each plugin starts with the interface language in OCS_LANGUAGE (read it with ocs_plugin_api::host_language()), so a plugin can ship its own .ftl files and pick its labels from them. Translations of a plugin go to that plugin's own repository.
Open CAD Studio is free software under the GPL-3.0 licence · Source code · Download · Web app · Discussions
Get started
- Installation
- Your First Drawing
- Tutorials
- The User Interface
- Ribbon Reference
- Workspaces and Toolbars
- Navigating the Drawing
Draw and edit
- Drawing Setup and Units
- Precision Drawing
- Isometric Drafting
- Drawing Objects
- Multilines
- Selecting Objects
- Modifying Objects
- Hatches and Fills
- Layers and Properties
Annotate
Organise and reuse
Present and share
3D
Tools
Reference