Files
comaps/docs/TRANSLATIONS.md
2025-06-24 22:26:21 +02:00

12 KiB
Raw Permalink Blame History

Translations

Translations are managed through Codeberg Translate, which is based on Weblate. Please contribute translations via the Codeberg Translate, and the system and maintainers will handle the rest.

Components

The project consists of multiple components, each with its own translation files.

Weblate Component Description Translation Files
Android UI strings android/app/src/main/res/values*/strings.xml (en)
Android feature types Map feature types android/app/src/main/res/values*/type_strings.xml (en)
iOS UI strings iphone/Maps/LocalizedStrings/*.lproj/Localizable.strings (en)
iOS Type Strings OpenStreetMap Types iphone/Maps/LocalizedStrings/*.lproj/LocalizableTypes.strings (en)
iOS Plurals UI strings (plurals) iphone/Maps/LocalizedStrings/*.lproj/Localizable.stringsdict (en)
iOS Plist UI strings (system-level) iphone/Maps/LocalizedStrings/*.lproj/InfoPlist.strings (en)
TTS Voice announcement strings for navigation directions (TTS) data/sound-strings/*.json (en)
Countries Country names for downloader data/country-strings/*.json (en)
Search keywords Search keywords/aliases/synonyms data/categories.txt
Search keywords (cuisines) Search keywords for cuisine types data/categories_cuisines.txt
AppStore Descriptions AppStore descriptions iphone/metadata (en)
Android Stores Descriptions Google, F-Droid, Huawei store descriptions android/app/src/fdroid/play (en)
Website Website content comaps/website (see details)

Components without links haven't been integrated into Weblate and must be translated directly via Codeberg Pull Requests.

Translating

Workflow

Translations are managed through Codeberg Translate. Direct submissions to this repository are not recommended but possible in specific cases (like batch-changes). Please prefer using the Weblate for translations whenever possible. Weblate periodically creates pull requests, which @comaps/mergers review and merge as usual.

Cross-Component Synchronization

Android and iOS share most of the strings. Codeberg Translate automatically syncs translations between components (e.g., from Android to iOS and vice versa), so updating a string in one place is usually sufficient.

Machine Translation

Codeberg Translate is configured to generate machine translations using the best available tools. Auto-translated entries are added as suggestions.

Failing checks

Please review any issues flagged by automated checks, such as missing placeholders, inconsistencies, and other potential errors. Use the filter has:check AND state:>=translated language:de, replacing de with your target language.

Developing

Workflow

Translations are handled by the translation team via Codeberg Translate, with no direct developer involvement required. Developers are only responsible for adding English base strings to the source file (see Components). Codeberg Translate manages the rest. If you're confident in a language, feel free to contribute translations, but please avoid adding machine translations or translating languages you are not familiar with.

Tools

Android developers can utilize the built-in features of Android Studio to add and modify strings efficiently. iOS developers are advised to edit Localizable.strings as a text file, as Xcodes interface only supports "String Catalog," which is not currently in use. JSON files can be modified using any text editor. To ensure consistency, always follow the established structure and include a comment when adding new strings.

Cross-Component Synchronization

When adding new strings, first check the base file of the component for existing ones. If no relevant strings are found, look for them on the corresponding platform (e.g., iOS when adding Android strings or vice versa). To maintain consistency across platforms, always reuse the existing string key from the other platform with the same English base string.

Maintaining

Under the Hood

Codeberg Translate maintains an internal copy of the Git repository. The repository URL can be found under Manage → Repository Maintenance → Weblate Repository. All components, except for the website, share the same internal Weblate repository.

Translations are extracted from the repository and stored in an internal database, which is used by the Weblate UI. Every 24 hours, this internal database is synchronized back to the internal repository. This process can also be triggered manually via Manage → Repository Maintenance → Commit.

Codeberg Translate has its own Git repository fork of both the website and the main Git repository for pushing translation commits and then creating pull requests (PRs) on Codeberg. After committing changes from the internal database to the internal repository, Codeberg Translate pushes all updates to the weblate-comaps-<component> branch (e.g. weblate-comaps-android for Android UI strings) of its forked repository and creates or updates a PR to main branch of the main repository. This operation can be manually triggered via Manage → Repository Maintenance → Push.

Reviewing PRs

Translations are intended to be reviewed by the community on Codeberg Translate. However, if it's a user's first contribution or if there is any doubt, a quick scan and comparison with the English source can be useful.

It is recommended to add comments directly on Codeberg Translate, as translators primarily work within that platform. Since Codeberg Translate requires a Codeberg account, you may tag contributors in the pull request, but there is no guarantee that they will respond.

Resolving Conflicts

The recommended approach for resolving conflicts is as follows:

  1. Commit all changes from the internal database to the internal Git repository:
    Manage → Repository Maintenance → Commit (button).
  2. Update the weblate-comaps-<component> branch of the Translate's forked Git repository on Codeberg:
    Manage → Repository Maintenance → Push (button).
  3. Locally checkout the weblate-comaps-<component> branch.
  4. Rebase it onto main of the main repository, resolving any conflicts during the process.
  5. Push the branch to Codeberg to update the pull request, then merge the branch or PR into main.
  6. Reset Codeberg Translate to sync changes from Codeberg:
    Manage → Repository Maintenance → Reset (button).