# Translator Contributor Guide URL: /docs/content/i18n/translator-guide/ Section: i18n -------------------------------------------------------------------------------- Translator Contributor Guide This guide explains how to contribute translations to a Bengal site using the standard gettext PO workflow. PO File Structure Translations live in: i18n/ ├── en/LC_MESSAGES/messages.po ├── es/LC_MESSAGES/messages.po └── ar/LC_MESSAGES/messages.po Each .po file contains: Header: Metadata (charset, plural forms) Entries: msgid (source) and msgstr (translation) PO File Format # English translations for My Site msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "MIME-Version: 1.0\n" msgid "Home" msgstr "Home" msgid "About" msgstr "About" msgid "Read more" msgstr "Read more" msgid: The source string (from templates) msgstr: The translation. Empty msgstr "" means untranslated (fallback to key) Conventions Use UTF-8 for all PO files. Set Content-Type: text/plain; charset=UTF-8 in the header. Keep msgid unchanged — it's the lookup key. Never translate the msgid. Preserve placeholders — if the source has {name}, keep it in the translation: Hola {name}. Plural forms — use msgid_plural and msgstr[0], msgstr[1] for languages with plural rules. Workflow for Contributors Get the template: Ask the maintainer for messages.pot or run bengal i18n extract in the repo. Create your locale: mkdir -p i18n/XX/LC_MESSAGES (e.g. XX = fr for French). Copy and translate: Copy messages.pot to i18n/XX/LC_MESSAGES/messages.po and fill in msgstr values. Submit: Open a PR with your new or updated .po file. Tools Poedit: GUI editor for PO files, handles plural forms Lokalize: KDE translation tool VS Code: Extensions like "Gettext" for PO editing Checking Your Work After adding translations: bengal i18n compile bengal build bengal i18n status bengal i18n status shows coverage. Aim for 100% for your locale. Plural Forms For strings with counts (e.g. "1 item" vs "5 items"): msgid "%d item" msgid_plural "%d items" msgstr[0] "%d elemento" msgstr[1] "%d elementos" The plural rule depends on the language. See Unicode CLDR for rules. -------------------------------------------------------------------------------- Metadata: - Author: lbliii - Word Count: 288 - Reading Time: 1 minutes