OneIdentity / IdentityManager.Imx

HTML5 source code for Identity Manager web apps
Other
26 stars 107 forks source link

Translated text not used for the "show selected" button on new requests page #134

Closed rogerholtenok closed 2 months ago

rogerholtenok commented 2 months ago

After you select one or more products, the button for showing selected products does not use the translated value as seen here:

bilde

It looks like the translation service can't handle when selectionService.selectedProducts.length is updated on this line in new-request-content.component.html:

<button mat-stroked-button (click)="openSelected()"><eui-icon icon="check"></eui-icon>&nbsp;<span translate>#LDS#Show selected ({{ selectionService.selectedProducts.length }})</span></button>

Splitting the constant part of the string out into its own span tag appeared to have fixed it for us as "Show selected" is also a translatable string:

<button mat-stroked-button (click)="openSelected()"><eui-icon icon="check"></eui-icon>&nbsp;<span translate>#LDS#Show selected</span><span> ({{ selectionService.selectedProducts.length }})</span></button>

Kind regards, Roger Holten

Mathnstein commented 2 months ago

Hi @rogerholtenok - yes this appears to be a mistake. We have a separate pipe for handling dynamic strings like this: <span>{{ '#LDS#Show selected ({0})' | translate | ldsReplace: selectionService.selectedProducts.length }}</span>

The ldsReplace pipe can be used with an arbitrary amount of values.

Note: for clarity and consistenty I moved the translate into the piped form as well.

I'll mark this as a bug for someone to change.

Mathnstein commented 2 months ago

Created an internal ticket: 453124