Home > widget-integration > CartController > getTranslation
CartController.getTranslation() method
Get translation text for cart UI elements Override to customize translations for specific shops/locales
Signature:
protected getTranslation(key: string, defaultValue: string): string;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
string |
Translation key |
|
defaultValue |
string |
Fallback value if translation not found |
Returns:
string
Translated text or default value
Example
protected getTranslation(key: string, defaultValue: string): string {
const customKeys = { atcAddToCartBtnLabel: 'Custom Add to Bag' };
return customKeys[key] || super.getTranslation(key, defaultValue);
}