diff --git a/concepts/translations/built-in-translation-system.md b/concepts/translations/built-in-translation-system.md index 779331804..a9eab5272 100644 --- a/concepts/translations/built-in-translation-system.md +++ b/concepts/translations/built-in-translation-system.md @@ -70,10 +70,10 @@ determine if an update is necessary. When loading translations, the system follows a defined priority order to resolve conflicts: 1. Database translations – These have the highest priority. You can define them to override all other translations. -2. Region-specific translations (e.g. `en-GB`, `en-US` or `de-DE`) – These can be provided for country-dependent +2. Country-specific translations (e.g. `en-GB`, `en-US` or `de-DE`) – These can be provided for country-dependent translations or dialects as small patch files. For more information about the language-layer changes, you can have a look at its documentation. -3. Region-agnostic translations (`en` and `de`) – These are shipped with Shopware and its plugins. They ensure that the +3. Country-agnostic translations (`en` and `de`) – These are shipped with Shopware and its plugins. They ensure that the system always has a reliable fallback language and provide a consistent developer experience without requiring you to wait until your translations are accepted at [translate.shopware.com](https://translate.shopware.com). For more details on selecting a fallback language and structuring your snippet files, see the [Fallback Languages guide](/concepts/translations/fallback-language-selection.md). 4. Built-in translation system – Finally, the translations installed via the built-in translation system are applied. diff --git a/guides/plugins/apps/administration/adding-snippets.md b/guides/plugins/apps/administration/adding-snippets.md index c6c70460c..18cb02f7b 100644 --- a/guides/plugins/apps/administration/adding-snippets.md +++ b/guides/plugins/apps/administration/adding-snippets.md @@ -7,6 +7,8 @@ nav: # Adding translations for apps Adding snippets to the administration works the same way for plugins and apps. The only difference is the file structure and that apps are not allowed to override existing snippet keys. The only thing to do, therefore, is to create new files in the following directory: `/Resources/app/administration/snippet` -Additionally, you need JSON file for each language you want to support, using its specific language locale, e.g. `de-DE.json`, `en-GB.json`. For more details on selecting a fallback language and structuring your snippet files, see the [Fallback Languages guide](/concepts/translations/fallback-language-selection.md). +Additionally, you need JSON files for each language you want to support, using the respective language locale (e.g., `de.json`, `en.json`). You can also include patch files for dialects, such as `en-US.json`, to provide country-specific translations. + +For more details on selecting a fallback language and structuring your snippet files, see the [Fallback Languages guide](../../../../concepts/translations/fallback-language-selection.md). Since everything else works the same, please refer to our [Adding translations for plugins](../../plugins/administration/templates-styling/adding-snippets) guide for more information. diff --git a/guides/plugins/apps/content/index.md b/guides/plugins/apps/content/index.md index e1831645f..762e0b973 100644 --- a/guides/plugins/apps/content/index.md +++ b/guides/plugins/apps/content/index.md @@ -7,6 +7,4 @@ nav: # Content -create layouts, and control the visibility of content based on various conditions. It provides a flexible and intuitive system for managing and presenting your store's content, helping you deliver a seamless and engaging customer experience. - -The following section guides how to extend Shopware CMS via a custom app. +You can assign content to specific categories, create layouts, and control the visibility of content based on various conditions. It provides a flexible and intuitive system for managing and presenting your store's content, helping you deliver a seamless and engaging customer experience. diff --git a/guides/plugins/themes/index.md b/guides/plugins/themes/index.md index 05603e381..7f60e5a79 100644 --- a/guides/plugins/themes/index.md +++ b/guides/plugins/themes/index.md @@ -9,11 +9,13 @@ nav: Basically a theme can be an app/plugin that aims at changing the visual appearance of the Storefront. +```text Extensions ├── Plugin │ └── can include a Theme (not for Cloud) └── App └── can include a Theme (Cloud-ready) +``` A Shopware theme plugin/app allows businesses to customize and modify the appearance and design of their online store. It provides the ability to change the layout, styling, and visual elements, such as fonts, colors, and images, to match your brand identity and desired user experience. Businesses can easily manage and apply their custom themes, switch between them, and ensure consistent branding across their store. diff --git a/resources/references/upgrades/core/translation/extension-translation.md b/resources/references/upgrades/core/translation/extension-translation.md index b597f5eb6..ff25abbdd 100644 --- a/resources/references/upgrades/core/translation/extension-translation.md +++ b/resources/references/upgrades/core/translation/extension-translation.md @@ -4,9 +4,9 @@ title: Migrating Extensions position: 20 --- -# Migrating Extension Translations To The Region-Independent Snippet Layer +# Migrating Extension Translations to the Country-Independent Snippet Layer -Starting with **Shopware 6.7.3**, a new region-independent snippet layer has been introduced to reduce duplicate +Starting with **Shopware 6.7.3**, a new country-independent snippet layer has been introduced to reduce duplicate translations across similar language variants (e.g., `en-GB`, `en-US`, `en-CA` can share a common "en" base layer). This change implements a hierarchical fallback system that automatically resolves translations through multiple layers, @@ -16,23 +16,30 @@ significantly reducing maintenance overhead for extension developers. The snippet loading system now follows this resolution order: -1. **Region-specific layer** (e.g., `en-GB`, `de-DE`) — Highest priority +1. **Country-specific layer** (e.g., `en-GB`, `de-DE`) — Highest priority 2. **Language base layer** (e.g., `en`, `de`, `es`) **NEW fallback layer** -3. **Default fallback** (`en`) - Last resort +3. **British English fallback** (`en-GB`) - Legacy fallback to maximize compatibility +4. **Default fallback** (`en`) - Last resort When a translation key is requested, Shopware will: -- First check the specific region variant (e.g., `es-AR`) +- First check the specific country variant (e.g., `es-AR`) - If not found, check the base language (e.g., `es`) +- If not found, the legacy fallback will be checked (`en-GB`) - Finally, fall back to `en` if still not found **Result**: ~90% reduction in duplicate translations while maintaining full functionality. -## Migrating your extensions +## Migrating Your Extensions + +### Automatic + +Shipping with Shopware **6.7.3**, there's the command line tool `bin/console translation:lint-filenames` that can be used to +check the translation files, or use the `--fix` parameter to even automate the migration process. For more information, see [this migration article](../../../../../concepts/translations/fallback-language-selection.md#migration-and-linting-via-command). ### Manual -### Step 1: Rename your existing files +#### Step 1: Rename your existing files Rename your existing files from country-specific naming to the language base layer naming. @@ -40,10 +47,10 @@ Rename your existing files from country-specific naming to the language base lay ├── messages.en-GB.base.json ⇒ messages.en.base.json ├── messages.de-DE.base.json ⇒ messages.de.base.json ├── messages.fr-FR.base.json ⇒ messages.fr.base.json -└············ +└··· ``` -### Step 2: Re-create empty country-specific files +#### Step 2: Re-create empty country-specific files Re-create empty files with the former names of the country-specific naming. @@ -51,10 +58,10 @@ Re-create empty files with the former names of the country-specific naming. ├── messages.en-GB.base.json ├── messages.de-DE.base.json ├── messages.fr-FR.base.json -└············ +└··· ``` -### Step 3: Remove duplicates from other country-specific files +#### Step 3: Remove duplicates from other country-specific files Check for duplicate translations across country-specific files and remove them from the country-specific layer. @@ -66,21 +73,16 @@ Here are some example locales that are a dialect to the generic base layer. ├── messages.de-AT.base.json (dialect of de-DE with the de base layer) ├── messages.de-CH.base.json (dialect of de-DE with the de base layer) ├── messages.pt-BR.base.json (dialect of pt-PT with the pt base layer) -└············ +└··· ``` -For more details on selecting a fallback language and structuring your snippet files, see the [Fallback Languages guide](/concepts/translations/fallback-language-selection.md). - -### Automatic - -Shipping with Shopware **6.7.3**, there's the command line tool `bin/console snippet:check-files` that can be used to -check the translation files, or use the `--fix` parameter to even automate the migration process. +For more details on selecting a fallback language and structuring your snippet files, see the [Fallback Languages guide](../../../../../concepts/translations/fallback-language-selection.md). ## Testing Your Migration After the snippet files have been renamed, changing the locale to one of the empty snippet sets should still provide -all translated strings. Changing to a region-specific locale should also provide all translated strings with just -region-specific terms being replaced. +all translated strings. Changing to a country-specific locale should also provide all translated strings with just +country-specific terms being replaced. ## Best Practices