{"id":6318,"date":"2026-12-02T11:52:30","date_gmt":"2026-12-02T10:52:30","guid":{"rendered":"https:\/\/cevento-plugin.com\/docs\/004-multi-language\/"},"modified":"2026-12-02T11:52:30","modified_gmt":"2026-12-02T10:52:30","slug":"004-multi-language","status":"publish","type":"docs","link":"https:\/\/cevento-plugin.com\/en\/docs\/004-multi-language\/","title":{"rendered":"Multilingual Support"},"content":{"rendered":"\n<p>Cevento is developed in English and ships with German translations (<code>de_DE<\/code>, <code>de_AT<\/code>, <code>de_CH<\/code> and <code>de_DE_formal<\/code>). The language is chosen automatically: the site language (<em>Settings &rarr; General<\/em>) on the website, and the language in the user&rsquo;s profile in the WordPress admin.<\/p>\n<p>As usual in WordPress, you can customize these translations or add new languages <strong>in an update-safe way<\/strong>. This applies to all plugin texts, including those displayed by Cevento&rsquo;s JavaScript (booking form, form builder, admin notifications, &hellip;).<\/p>\n<blockquote>\n<p>Texts you enter in the Cevento settings yourself (e.g. email templates or the booking button label) are stored as settings, not translations. Change them directly in the settings.<\/p>\n<\/blockquote>\n<h2 id=\"where-translations-are-loaded-from\">Where Translations Are Loaded From<\/h2>\n<p>WordPress looks for Cevento&rsquo;s translations in two places, in this order:<\/p>\n<ol>\n<li><code>[wp_root]\/wp-content\/languages\/plugins\/<\/code>: <strong>your own translations<\/strong>. This directory is not touched by plugin updates.<\/li>\n<li><code>[plugin_root]\/languages\/<\/code>: the translations shipped with the plugin. This directory is replaced with every update, so never make changes here.<\/li>\n<\/ol>\n<p>The file names must follow the pattern <code>cevento-[locale_code].po<\/code> \/ <code>cevento-[locale_code].mo<\/code>, e.g. <code>cevento-de_DE.mo<\/code> for German (Germany) or <code>cevento-fr_FR.mo<\/code> for French. You can find all locale codes in <a href=\"https:\/\/make.wordpress.org\/polyglots\/teams\/\" rel=\"noopener\">this list<\/a>.<\/p>\n<p><strong>Important:<\/strong> your own file for a language <strong>replaces<\/strong> the shipped translation of that language completely; the two are not merged. So always start from a complete copy of the shipped file (see below). Texts missing from your file are displayed in English.<\/p>\n<h2 id=\"requirements\">Requirements<\/h2>\n<p>To edit translation files, we recommend <a href=\"https:\/\/poedit.net\/\" rel=\"noopener\">Poedit<\/a>. It edits <code>.po<\/code> files and automatically creates the <code>.mo<\/code> file WordPress uses whenever you save.<\/p>\n<p>Alternatively, you can use the command line tools of <a href=\"https:\/\/www.gnu.org\/software\/gettext\/\" rel=\"noopener\">gettext<\/a>: <code>msgfmt<\/code> compiles an edited <code>.po<\/code> file into a <code>.mo<\/code> file.<\/p>\n<h2 id=\"adjusting-existing-translations\">Adjusting Existing Translations<\/h2>\n<ol>\n<li>\n<p>Copy the <code>.po<\/code> file of the desired language from <code>[plugin_root]\/languages\/<\/code>, e.g. <code>cevento-de_DE.po<\/code>, into the directory <code>[wp_root]\/wp-content\/languages\/plugins\/<\/code>.<br>\nThe file name must match the language of your site. For an Austrian site (<code>de_AT<\/code>), for example, copy <code>cevento-de_AT.po<\/code>.<\/p>\n<\/li>\n<li>\n<p>Open the copied file and change the desired translations.<\/p>\n<\/li>\n<li>\n<p>Create the <code>.mo<\/code> file: Poedit does this automatically when saving. With gettext:<\/p>\n<pre><code class=\"language-bash\">msgfmt -o cevento-de_DE.mo cevento-de_DE.po<\/code><\/pre>\n<\/li>\n<li>\n<p>Make sure both files are in <code>[wp_root]\/wp-content\/languages\/plugins\/<\/code>. WordPress only uses the <code>.mo<\/code> file; keep the <code>.po<\/code> file for future changes.<\/p>\n<\/li>\n<\/ol>\n<p>Your changes apply immediately to all texts, including those displayed by the plugin&rsquo;s JavaScript. If a caching plugin is active, clear its cache afterwards.<\/p>\n<blockquote>\n<p>If there is also a file <code>cevento-[locale_code].l10n.php<\/code> in <code>[wp_root]\/wp-content\/languages\/plugins\/<\/code> (e.g. created by a translation tool), WordPress prefers it over the <code>.mo<\/code> file. In that case, delete it, or regenerate it after each change with <code>wp i18n make-php<\/code>.<\/p>\n<\/blockquote>\n<h2 id=\"after-a-plugin-update\">After a Plugin Update<\/h2>\n<p>New or changed texts of a new Cevento version are not part of your own file yet and are therefore displayed in English. To add them to your file:<\/p>\n<ul>\n<li><strong>Poedit:<\/strong> open your <code>.po<\/code> file, choose <em>Translation &rarr; Update from POT File&hellip;<\/em> and select the file <code>[plugin_root]\/languages\/cevento.pot<\/code>. Translate the new entries and save.<\/li>\n<li>\n<p><strong>WP-CLI:<\/strong> run<\/p>\n<pre><code class=\"language-bash\">wp i18n update-po [plugin_root]\/languages\/cevento.pot [wp_root]\/wp-content\/languages\/plugins\/cevento-de_DE.po<\/code><\/pre>\n<p>then translate the new entries and create the <code>.mo<\/code> file again as described above.<\/p>\n<\/li>\n<\/ul>\n<p>Your existing translations are kept in both cases.<\/p>\n<h2 id=\"changing-individual-texts\">Changing Individual Texts<\/h2>\n<p>If you only want to change a few texts, you don&rsquo;t need your own translation file. Use the <code>gettext_cevento<\/code> filter instead, e.g. in your (child) theme&rsquo;s <code>functions.php<\/code> or in a small plugin:<\/p>\n<pre><code class=\"language-php\">add_filter('gettext_cevento', function ($translation, $text) {\n    if ($text === 'Download iCAL') {\n        return 'Add to calendar';\n    }\n\n    return $translation;\n}, 10, 2);<\/code><\/pre>\n<ul>\n<li><code>$text<\/code> is always the <strong>original English text<\/strong> of the plugin. You can find it as <code>msgid<\/code> in the file <code>[plugin_root]\/languages\/cevento.pot<\/code>.<\/li>\n<li>The filter applies to all languages and also to the texts displayed by the plugin&rsquo;s JavaScript. To change a text for one language only, additionally check <code>determine_locale()<\/code>, e.g. <code>if ($text === 'Download iCAL' &amp;&amp; determine_locale() === 'de_DE')<\/code>.<\/li>\n<li>For texts with singular and plural forms (e.g. <code>%d participants<\/code>), use the <code>ngettext_cevento<\/code> filter instead, which also receives the number (<code>$translation, $single, $plural, $number<\/code>).<\/li>\n<\/ul>\n<h2 id=\"adding-a-new-language\">Adding a New Language<\/h2>\n<ol>\n<li>Create a new translation from the template <code>[plugin_root]\/languages\/cevento.pot<\/code>:\n<ul>\n<li><strong>Poedit:<\/strong> <em>File &rarr; New from POT\/PO File&hellip;<\/em>, select <code>cevento.pot<\/code> and choose the language.<\/li>\n<li><strong>Manually:<\/strong> copy <code>cevento.pot<\/code> and rename the copy to <code>cevento-[locale_code].po<\/code>, e.g. <code>cevento-fr_FR.po<\/code>.<\/li>\n<\/ul>\n<\/li>\n<li>Translate all texts and save the file as <code>cevento-[locale_code].po<\/code> in the directory <code>[wp_root]\/wp-content\/languages\/plugins\/<\/code>.<\/li>\n<li>\n<p>Create the <code>.mo<\/code> file (Poedit does this automatically when saving):<\/p>\n<pre><code class=\"language-bash\">msgfmt -o cevento-fr_FR.mo cevento-fr_FR.po<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>As soon as the site (or the user profile) is set to this language, Cevento uses your translation, including for the texts displayed by its JavaScript. After plugin updates, add new texts as described in <a href=\"#after-a-plugin-update\">After a Plugin Update<\/a>.<\/p>\n\n","protected":false},"featured_media":0,"parent":0,"template":"","meta":{"_acf_changed":false},"thema":[891],"class_list":["post-6318","docs","type-docs","status-publish","hentry","thema-development"],"acf":{"excerpt":"Extend & Customize Translations","toc":"<ol class=\"toc\">\n<li><a href=\"#where-translations-are-loaded-from\"  uk-scroll=\"offset: 120\">Where Translations Are Loaded From<\/a><\/li>\n<li><a href=\"#requirements\"  uk-scroll=\"offset: 120\">Requirements<\/a><\/li>\n<li><a href=\"#adjusting-existing-translations\"  uk-scroll=\"offset: 120\">Adjusting Existing Translations<\/a><\/li>\n<li><a href=\"#after-a-plugin-update\"  uk-scroll=\"offset: 120\">After a Plugin Update<\/a><\/li>\n<li><a href=\"#changing-individual-texts\"  uk-scroll=\"offset: 120\">Changing Individual Texts<\/a><\/li>\n<li><a href=\"#adding-a-new-language\"  uk-scroll=\"offset: 120\">Adding a New Language<\/a><\/li>\n<\/ol>\n"},"_links":{"self":[{"href":"https:\/\/cevento-plugin.com\/en\/wp-json\/wp\/v2\/docs\/6318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cevento-plugin.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/cevento-plugin.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"wp:attachment":[{"href":"https:\/\/cevento-plugin.com\/en\/wp-json\/wp\/v2\/media?parent=6318"}],"wp:term":[{"taxonomy":"thema","embeddable":true,"href":"https:\/\/cevento-plugin.com\/en\/wp-json\/wp\/v2\/thema?post=6318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}