Sprachdefinitionen

Um verschiedene Übersetzungen korrekt darzustellen, werden Informationen über den Namen der Sprache, die Leserichtung, die Pluraldefinitionen und den Sprachcode benötigt.

Integrierte Sprachdefinitionen

Definitions for about 600 languages are included in Weblate and the list is extended in every release. Whenever Weblate is upgraded (more specifically whenever weblate migrate is executed, see Generic upgrade instructions) the database of languages is updated to include all language definitions shipped in Weblate.

This feature can be disable using UPDATE_LANGUAGES. You can also enforce updating the database to match Weblate built-in data using setuplang.

Parsing language codes

While parsing translations, Weblate attempts to map language code (usually the ISO 639-1 one) from the Dateimaske to any existing language object.

You can further adjust this mapping at project level by Sprachaliasnamen.

If no exact match can be found, an attempt will be made to best fit it into an existing language. Following steps are tried:

  • Case insensitive lookups.

  • Normalizing underscores and dashes.

  • Suche nach integrierten Sprachaliasen.

  • Nach Sprachnamen suchen.

  • Ignoring the default country code for a given language—choosing cs instead of cs_CZ.

Should that also fail, a new language definition will be created using the defaults (left to right text direction, one plural). The automatically created language with code xx_XX will be named as xx_XX (generated). You might want to change this in the admin interface later, (see Ändern von Sprachdefinitionen) and report it to the issue tracker (see Zu Weblate beitragen), so that the proper definition can be added to the upcoming Weblate release.

Hinweis

In case you see something unwanted as a language, you might want to adjust Sprachen-Filter to ignore such file when parsing translations.

Ändern von Sprachdefinitionen

You can change language definitions in the languages interface (/languages/ URL).

While editing, make sure all fields are correct (especially plurals and text direction), otherwise translators will be unable to properly edit those translations.

Mehrdeutige Sprachcodes und Makrosprachen

In vielen Fällen ist es keine gute Idee, einen Makrosprachencode für eine Übersetzung zu verwenden. Ein typischer Problemfall ist die kurdische Sprache, die je nach Variante in arabischer oder lateinischer Schrift geschrieben werden kann. Um ein korrektes Verhalten in Weblate zu erreichen, wird empfohlen, nur einzelne Sprachcodes zu verwenden und Makrosprachen zu vermeiden.

Sprachdefinitionen

Jede Sprache besteht aus den folgenden Feldern:

Sprachkürzel

Code zur Identifizierung der Sprache. Weblate bevorzugt Zwei-Buchstaben-Codes, wie sie in ISO 639-1 definiert sind, verwendet aber ISO 639-2 oder ISO 639-3 Codes für Sprachen, die keinen Zwei-Buchstaben-Code haben. Es kann auch erweiterte Codes unterstützen, wie in BCP 47 definiert.

Sprachenname

Sichtbarer Name der Sprache. Die in Weblate enthaltenen Sprachennamen werden auch je nach Sprache der Benutzeroberfläche lokalisiert.

Leserichtung

Bestimmt, ob die Sprache von rechts nach links oder von links nach rechts geschrieben wird. Diese Eigenschaft wird für die meisten Sprachen automatisch richtig erkannt.

Anzahl der Pluralformen

Anzahl der in der Sprache verwendeten Pluralformen.

Pluralformel

Gettext compatible plural formula used to determine which plural form is used for given count.

Anzahl der Sprecher

Anzahl der weltweiten Sprecher dieser Sprache.

Neue Übersetzungen hinzufügen

Geändert in Version 2.18: In Versionen vor 2.18 war das Verhalten beim Hinzufügen neuer Übersetzungen dateiformatspezifisch.

Weblate kann automatisch eine neue Übersetzung für alle Dateiformate starten.

Some formats expect to start with an empty file and only translated strings to be included (for example Android string resources), while others expect to have all keys present (for example GNU gettext). The document-based formats (for example OpenDocument-Format) start with a copy of the source document and all strings marked as needing editing. In some situations this really doesn’t depend on the format, but rather on the framework you use to handle the translation (for example with JSON-Dateien).

When you specify Vorlage für neue Übersetzungen in Component configuration, Weblate will use this file to start new translations. Any exiting translations will be removed from the file when doing so.

When Vorlage für neue Übersetzungen is empty and the file format supports it, an empty file is created where new strings will be added once they are translated.

The Stil des Sprachcodes allows you to customize language code used in generated filenames:

Standard basierend auf dem Dateiformat

Dependent on file format, for most of them POSIX is used.

POSIX-Stil mit Unterstrich als Trennzeichen

Typically used by gettext and related tools, produces language codes like pt_BR.

POSIX-Stil mit Unterstrich als Trennzeichen, einschließlich Ländercode

POSIX style language code including the country code even when not necessary (for example cs_CZ).

BCP-Stil mit Bindestrich als Trennzeichen

Typically used on web platforms, produces language codes like pt-BR.

BCP-Stil mit Bindestrich als Trennzeichen, einschließlich Ländercode

BCP style language code including the country code even when not necessary (for example cs-CZ).

BCP-Stil mit Bindestrich als Trennzeichen, Codes für ältere Sprachen

Uses legacy codes for Chinese and BCP style notation.

BCP-Stil mit Bindestrich als Trennzeichen, Kleinbuchstaben

BCP-Schreibweise, alles in Kleinbuchstaben (zum Beispiel cs-cz).

Apple App Store Metadaten-Stil

Style suitable for uploading metadata to Apple App Store.

Google Play Metadaten-Stil

Style suitable for uploading metadata to Google Play Store.

Android-Stil

Only used in Android apps, produces language codes like pt-rBR.

Linux-Stil

Locales as used by Linux, uses legacy codes for Chinese and POSIX style notation.

Additionally, any mappings defined in Sprachaliasnamen are applied in reverse.

Bemerkung

Weblate recognizes any of these when parsing translation files, the above settings only influences how new files are created.