HCL Commerce Version 9.1.8.0 or later

Adding Internationalization (i18n) strings

This document provides information about adding the i18n strings, which are used in displaying user interface components and the message snack bar.

Before you begin

Note: This tutorial is only valid for HCL Commerce version 9.1.8.0 to version 9.1.10.0, as the wishlist feature is included as a default feature for HCL Commerce version 9.1.11.0 and onwards.

About this task

In this tutorial, only English-local (en-US) is used to explain the addition of i18n strings.

Procedure

  1. Open assets/common/public/locales/en-US/translation.json file and add all the required translation strings.
  2. Add the success messages that will be displayed in the message snack bar. Use the following code to add the success message:
    "success-message": {
        "ITEM_ADD_SUCCESS": "Item was added to cart. ",
        "ViewCart": "View Cart",
        "COPY_CART_SUCCESS": "Order was added to cart. ",
        "RecurringOrderCancelled": "The order has been successfully cancelled.",
        "ADD_ADDRESS_SUCCESS": "Your new address \"{{0}}\" has been added successfully",
        "EDIT_ADDRESS_SUCCESS": "Your address \"{{0}}\" has been updated successfully",
        "DELETE_ADDRESS_SUCCESS": "Your address \"{{0}}\" has been deleted successfully",
        "RESEND_VERIFICATION_CODE": "The verification code has been sent to your email address successfully",
        "PASSWORD_RESET_SUCCESS": "The password has been reset successfully",
        "CREATE_WISHLIST_SUCCESS": "New wish list \"{{0}}\" has been created successfully",
        "DELETE_WISHLIST_SUCCESS": "Wish list \"{{0}}\" has been deleted successfully",
        "WISHLIST_ADD_SUCCESS": "Item has been successfully added to \"{{0}}\" list"
      },
  3. Once the success messages are added, add the translation strings that will be used in displaying user interface components. Use the following code to do this:
    "WishList": {
        "WishListMessage": "Add a new wish list",
        "AddWishList": "Create List",
        "WishListName": "Wish List Name",
        "Title": "Wish List",
        "FilterLabel": "Filter By Address Type",
        "NoWishListMessage": "You have not created any wish list yet.",
        "WishListEmptyMessage": "The list is currently empty",
        "ViewList": "ViewList",
        "Delete": "Delete",
        "WishListItemsMessage": "Here's some of the items in your list",
        "InvalidWishListName": "Invalid wish list name",
        "Confirm": "Confirm",
        "Cancel": "Cancel"
      }
    }
  4. Save and close the assets/common/public/locales/en-US/translation.json file.

Results

After adding translation strings, follow the Developing wishlist UI widgets document to proceed further.