Skip to content

Commit

Permalink
chore: localization and documentation adjustments (#1706)
Browse files Browse the repository at this point in the history
* adjustments after localization diff review, capitalization of "Punchout"
* localize apostrophes
* used ICU Message Format for pluralization since 'zero' as pluralization case did not work as expected
* migration guide text improvements
  • Loading branch information
mglatter authored Aug 23, 2024
1 parent 7f47655 commit c026e60
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 87 deletions.
67 changes: 34 additions & 33 deletions docs/guides/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,59 @@ kb_sync_latest_only
>
> To use the fitting resource ID encoding for ICM 7.10 or ICM 11, the feature toggle `legacyEncoding` needs to be enabled.
The function `encodeResourceID` has been moved to a method `encodeResourceId` of the [`api.service`](../../src/app/core/services/api/api.service.ts) and it is now used to encode all dynamic resource IDs in any REST API call to ICM.
This was previously only done for the login but is now consistently used for all resource IDs.
For ICM 7.10 and ICM 11 a duplicated `encodeURIComponent` encoding is applied, for ICM 12 and newer a single `encodeURIComponent` encoding with additional `+` character handling is used.
To migrate custom code a simple search for `encodeResourceID(` and replace with `this.apiService.encodeResourceId(` should be sufficient.
The function `encodeResourceID` has been moved to a method `encodeResourceId` of the [`api.service`](../../src/app/core/services/api/api.service.ts), and it is now used to encode all dynamic resource IDs in any REST API call to ICM.
This was previously only done for the login, but is now consistently used for all resource IDs.
For ICM 7.10 and ICM 11, a duplicated `encodeURIComponent` encoding is applied.
For ICM 12 and newer, a single `encodeURIComponent` encoding with additional `+` character handling is used.
To migrate custom code, searching for `encodeResourceID(` and replacing it with `this.apiService.encodeResourceId(` is sufficient.
Please be aware when migrating that there is an intermediate [commit](https://github.com/intershop/intershop-pwa/commit/3e7c0ae2ff1d6e676f98d7c399b70b505f389e16) for the resource ID encoding in the 5.2 release that was improved with a later [commit](https://github.com/intershop/intershop-pwa/commit/TODO_with_release_creation) to work with the `legacyEncoding` feature toggle for ICM 7.10 and ICM 11 encoding not requiring any code adaptions anymore.

The store action and method `addBasketToNewOrderTemplate` of the OrderTemplatesFacade have been renamed to `createOrderTemplateFromLineItems` and refactored slightly.

The Intershop PWA specific Pipes `sanitize`, `makeHref` and `htmlEncode` were renamed using the common `ish` prefix that is used for the other custom Pipes as well.
When migrating all occurrences of these Pipes need to be renamed to `ishSanitize`, `ishMakeHref` and `ishHtmlEncode`.
The code generation was adapted to generate new Pipes from the beginning with the correct prefixes now.
When migrating, rename all occurrences of these Pipes to `ishSanitize`, `ishMakeHref` and `ishHtmlEncode`.
The code generation has been adapted to generate new Pipes from the beginning with the correct prefixes now.

A few Stylelint rules were changed and the `.scss` files were adapted.
`color-function-notation` was changed to the default `modern` resulting in changed color notations from `rgba(0, 0, 0, 0.125)` to `rgb(0 0 0 / 0.125)`
`scss/no-global-function-names` was enabled resulting in changes e.g. from `map-get($grid-breakpoints, 'xs')` to `map.get($grid-breakpoints, 'xs')` with the necessary `@use` references or from `darken($color-label-new, 20%)` to `color.adjust($color-label-new, $lightness: -20%)`.
In addition empty comments in `.scss` files are no longer allowed and removed.
In migration projects either keep the Stylelint rules with the old settings or migrate all your styling files accordingly running `npm run format`.
A few Stylelint rules have been changed and the `.scss` files have been adapted.
`color-function-notation` has been changed to the default `modern` resulting in changed color notations from `rgba(0, 0, 0, 0.125)` to `rgb(0 0 0 / 0.125)`.
`scss/no-global-function-names` has been enabled resulting in changes, e.g., from `map-get($grid-breakpoints, 'xs')` to `map.get($grid-breakpoints, 'xs')` with the necessary `@use` references, or from `darken($color-label-new, 20%)` to `color.adjust($color-label-new, $lightness: -20%)`.
In addition, empty comments in `.scss` files are no longer allowed and have been removed.
In migration projects, either keep the Stylelint rules with the old settings or migrate all your styling files accordingly running `npm run format`.

With the Intershop PWA version 5.2.0 the rendering of our demo/example view contexts was disabled by default.
With Intershop PWA version 5.2.0, the rendering of our demo/example view contexts was disabled by default.
Each integrated view context triggers a REST call that will potentially decrease the SSR rendering performance, something that is not necessary if this feature is not actively used in a PWA project.
For that reason the examples were commented out in the source code and have to be activated in the project source code if needed.
For this reason, the examples were commented out in the source code and have to be activated in the project source code if needed.
See [CMS Integration - View Contexts](../concepts/cms-integration.md#view-contexts) for more information.

The `ExternalDisplayPropertiesProvider` `setup` notation was changed from providing only the `product` context to providing a combined `{ product, prices }` context object.
For that reason any custom `ContextDisplayPropertiesService` that implements the `ExternalDisplayPropertiesProvider` needs to be adapted accordingly (see the changes of #1657).
The `ExternalDisplayPropertiesProvider` `setup` notation has been changed from providing only the `product` context to providing a combined `{ product, prices }` context object.
For this reason, any custom `ContextDisplayPropertiesService` that implements the `ExternalDisplayPropertiesProvider` needs to be adapted accordingly (see the changes of #1657).

The dead code detection script was improved and extended and is now checking Angular components in more detail.
The dead code detection script has been improved and extended and is now checking Angular components in more detail.
This resulted in more variables and methods being declared as `private` and some unused code being removed.
This should not affect PWA based projects as long as such internal declarations were not used, else compiling will fail and the code would need to be adapted/reverted accordingly.
This should not affect PWA based projects as long as such internal declarations have not been used, else compiling will fail and the code would need to be adapted/reverted accordingly.

Product variations were eagerly loaded via effects.
In projects with a lot of Variations, this can lead to performance issues, especially if the variations data is not needed for the current views.
For that reason product variations are now loaded lazily through the following changes that might need adaptions with project customizations.
Product variations have been eagerly loaded via effects.
In projects with many variations, this can lead to performance issues, especially if the variation data is not needed for the current views.
For this reason, product variations are now loaded lazily through the following changes that might need adaptions with project customizations.

- The `variations` property on the product view interface was removed. Variations can now be retrieved via the product context facade or the shopping facade.
- The `variations` property on the product view interface has been removed. Variations can now be retrieved via the product context facade or the shopping facade.
- The `productMaster` property on the product view model has been removed. The master product should be individually retrieved.
- The `ish-product-item-variations` component has been refactored.

The Formly wrapper `textarea-description` was renamed to the better suited name `maxlength-description` and the rendering logic and compatibility to the general `description` wrapper was improved.
The renaming should better convey the fact that this wrapper can be used not only for `ish-textarea-field` (where it is configured by default) but with other input field types as well.
Besides this the main difference to the general `description` wrapper is its remaining `maxlength` calculation.
Together with the renaming the implementation was changed so that the description will only be rendered if the according field has a `props.maxLength` value configured.
And the `props` key to provide an alternative translation key was changed from `customDescription` to `maxLengthDescription`.
This change provides the possibility to use the `description` wrapper with its `customDescription` together with the `maxlength-description` wrapper with a customized `maxLengthDescription`.
For the migration of customer projects it needs to be checked whether a `customDescription` is configured for a `ish-textarea-field` and if so it needs to be replaced with `maxLengthDescription`.
Additionally it needs to be checked if the `textarea-description` wrapper is configured anywhere else then the default assignment to the `ish-textarea-field`.
If so these wrapper configurations need to be replaced with `maxlength-description`.
The Formly wrapper `textarea-description` has been renamed to the more appropriate name `maxlength-description`, and the rendering logic and compatibility to the general `description` wrapper has been improved.
The renaming should better convey the fact that this wrapper can be used not only for `ish-textarea-field` (where it is configured by default), but with other input field types as well.
Besides this, the main difference to the general `description` wrapper is its remaining `maxlength` calculation.
Together with the renaming, the implementation has been changed so that the description will only be rendered if the corresponding field has a `props.maxLength` value configured.
Additionally, the `props` key to provide an alternative translation key has been changed from `customDescription` to `maxLengthDescription`.
This change allows to use the `description` wrapper with its `customDescription` together with the `maxlength-description` wrapper with a customized `maxLengthDescription`.
When migrating customer projects, check to see if a `customDescription` is configured for an `ish-textarea-field`, and if so, replace it with `maxLengthDescription`.
You also need to check if the `textarea-description` wrapper is configured somewhere other than the default assignment to the `ish-textarea-field`.
If so, replace these wrapper configurations with `maxlength-description`.

B2B users with the permission `APP_B2B_MANAGE_ORDERS` (only available for admin users in ICM 12.1.0 and higher) see now the orders of all users of the company on the My Account order history page.
They can filter the orders by buyer in order to see only e.g. the own orders again.
B2B users with the permission `APP_B2B_MANAGE_ORDERS` (only available for admin users in ICM 12.1.0 and higher) now see the orders of all users of the company on the My Account order history page.
They can filter the orders by buyer in order to see, e.g., only their own orders again.

In preparation of the cXML punchout self service configuration we switched from a hidden route parameter that conveys the punchout type context information to an URL query parameter (e.g. `?format=cxml`).
In preparation of the cXML punchout self service configuration, we switched from a hidden route parameter that conveys the punchout type context information to a URL query parameter (e.g., `?format=cxml`).
So customized routing within the punchout area needs to be adapted accordingly.

## From 5.0 to 5.1
Expand Down
18 changes: 9 additions & 9 deletions src/assets/i18n/de_DE.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"account.address.address1.error.required": "Geben Sie eine Straße ein.",
"account.address.apo_fpo.link": "Feldpost",
"account.address.apo_fpo.tooltip": "Geben Sie APO oder FPO im Feld \"Ort\" ein und wählen Sie eine der drei Möglichkeiten aus dem Auswahlmenü \"Bundesland\": AA für Armed Forces of America, AE für Armed Forces Europe, AP für Armed Forces Pacific.",
"account.address.apo_fpo.tooltip": "Geben Sie APO oder FPO im Feld Ort ein und wählen Sie eine der drei Möglichkeiten aus dem Auswahlmenü Bundesland: AA für Armed Forces of America, AE für Armed Forces Europe, AP für Armed Forces Pacific.",
"account.address.apo_fpo.tooltip.headline": "Feldpostadressen",
"account.address.city.error.required": "Geben Sie einen Ort ein.",
"account.address.city.label": "Ort",
Expand Down Expand Up @@ -354,8 +354,8 @@
"account.punchout.configuration.form.heading.format": "Format",
"account.punchout.configuration.form.heading.mapping": "Mapping",
"account.punchout.configuration.form.heading.transformed-attribute": "Parameterwert",
"account.punchout.configuration.form.mapping.from.error": "Der \"Mapping von\"-Wert fehlt.",
"account.punchout.configuration.form.mapping.to.error": "Der \"Mapping nach\"-Wert fehlt.",
"account.punchout.configuration.form.mapping.from.error": "Der Mapping von-Wert fehlt.",
"account.punchout.configuration.form.mapping.to.error": "Der Mapping nach-Wert fehlt.",
"account.punchout.configuration.form.tooltip.mapping.content": "Das Daten-Mapping ermöglicht es, Ihrer Konfiguration individuelle Werte zuzuordnen. Die Feldwerte aus dem externen Punchout-Katalog werden Ihrem Procurement-System zugeordnet. Bitte beachten Sie Folgendes:<ul class=\"pl-3\"><li>Eine Mappingregel kann nur für Felder mit einem Parameterwert eingegeben werden.</li><li>Eine Mappingregel muss immer einen &quot;von&quot;- und einen &quot;nach&quot;-Wert haben, sonst wird sie nicht gespeichert.</li><li>Wenn mehrere Zuordnungsregeln existieren, wird nur die erste Zuordnungsregel angewendet. Eine Verkettung von Regeln ist nicht möglich.</li><li>Eine Regel wird nur einmal innerhalb eines Strings angewendet.</li><li>Ein Sternchen (*) entspricht einer beliebigen Anzahl von Zeichen, zum Beispiel 2345* 23450000.</li></ul>",
"account.punchout.configuration.form.tooltip.mapping.headline": "Daten-Mapping",
"account.punchout.configuration.form.tooltip.placeholder.headline": "Verfügbare Platzhalter",
Expand All @@ -372,15 +372,15 @@
"account.punchout.cxml.configuration.link": "Konfiguration",
"account.punchout.cxml.configuration.no_configuration": "Derzeit ist keine Konfiguration angelegt.",
"account.punchout.cxml.configuration.save_success.message": "Die cXML-Punchout-Konfiguration wurde gespeichert.",
"account.punchout.cxml.info.url.helptext": "Bitte verwenden Sie die folgende URL für die Punchout-Konfiguration in Ihrem cXML-Procurement-System. Verwenden Sie für die Absender-Anmeldeinformationen den Benutzernamen als \"Identity\" und das Kennwort als \"SharedSecret\".",
"account.punchout.cxml.info.url.helptext": "Bitte verwenden Sie die folgende URL für die Punchout-Konfiguration in Ihrem cXML-Procurement-System. Verwenden Sie für die Absender-Anmeldeinformationen den Benutzernamen als Identity und das Kennwort als SharedSecret.",
"account.punchout.heading": "Punchout",
"account.punchout.link": "Punchout",
"account.punchout.no.protocols.info": "Punchout-Protokolle werden derzeit nicht unterstützt. Wenn das Problem weiterhin besteht, wenden Sie sich bitte an den Kundensupport.",
"account.punchout.no_user.text": "Derzeit haben Sie keine {{0, translate, account.punchout.type.text}}-Punchout-Benutzer.",
"account.punchout.oci.formatter.aria_label": "Format des Wertes",
"account.punchout.oci.info.url.helptext": "Bitte verwenden Sie die folgende URL für die Konfiguration in Ihrem OCI-Procurement-System. Ersetzen Sie <USERNAME> und <PASSWORD> durch die OCI Punchout-Benutzerdaten und setzen Sie die <HOOK_URL> entsprechend Ihrem Procurement-System.",
"account.punchout.oci.map_from.aria_label": "Wert 'map from'",
"account.punchout.oci.map_to.aria_label": "Wert 'map to'",
"account.punchout.oci.map_from.aria_label": "Wert map from",
"account.punchout.oci.map_to.aria_label": "Wert map to",
"account.punchout.oci.transform.aria_label": "Parameterwert",
"account.punchout.password.confirmation.error.required": "Bitte bestätigen Sie das Kennwort.",
"account.punchout.password.confirmation.label": "Kennwort bestätigen",
Expand Down Expand Up @@ -754,7 +754,7 @@
"checkout.orderReferenceId.success.message": "Ihre Kundenbestellnummer wurde übernommen.",
"checkout.orderReferenceId.title": "Kundenbestellnummer eingeben",
"checkout.order_details.heading": "Bestellübersicht",
"checkout.order_review.heading.text": "Prüfen Sie die Details Ihrer Bestellung und nehmen Sie, falls notwendig, noch Änderungen vor. Klicken Sie auf \"Bestellung absenden\", um den Bestellvorgang abzuschließen.",
"checkout.order_review.heading.text": "Prüfen Sie die Details Ihrer Bestellung und nehmen Sie, falls notwendig, noch Änderungen vor. Klicken Sie auf Bestellung absenden, um den Bestellvorgang abzuschließen.",
"checkout.order_review.heading.title": "Ihre Bestelldaten prüfen",
"checkout.order_review.send.button": "Bestellung absenden",
"checkout.order_summary.heading": "Bestellübersicht",
Expand Down Expand Up @@ -1066,7 +1066,7 @@
"product.reviews.your_review.heading": "Ihre Produktbewertung",
"product.short_description.label": "Kurzbeschreibung",
"product.specific_attributes.label": "Spezifische Attribute",
"product.variations.text": "{{ 0, plural, zero{keine Variationen} one{eine Variation} other{# Variationen}}}",
"product.variations.text": "{{ 0, plural, =0{Keine Variationen} =1{Eine Variation} other{# Variationen}}}",
"product.warranty.code.text": "Garantie-Code:",
"product.warranty.detail.text": "Details",
"product.warranty.expire_date.text": "Läuft aus am:",
Expand Down Expand Up @@ -1251,7 +1251,7 @@
"store_locator.form.country.label": "Land",
"store_locator.form.postalCode.label": "PLZ",
"store_locator.form.submit.label": "Suchen",
"store_locator.howto": "Wählen Sie einfach ein Land aus der Dropdown-Liste aus, geben Sie Bundesland, Postleitzahl oder Stadt ein und klicken Sie auf \"Suchen\".",
"store_locator.howto": "Wählen Sie einfach ein Land aus der Dropdown-Liste aus, geben Sie Bundesland, Postleitzahl oder Stadt ein und klicken Sie auf Suchen.",
"store_locator.link.subtitle": "Finden Sie eine Filiale in Ihrer Nähe",
"store_locator.link.title": "Filialen",
"store_locator.notFound": "<p>Keine Filiale gefunden:</p><p>Leider gibt es keine Filiale in dieser Region.</p><p>Sie können unsere Produkte jedoch jederzeit im <a href=\"{{0}}\">Online-Shop</a> bestellen.</p>",
Expand Down
Loading

0 comments on commit c026e60

Please sign in to comment.