Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Show Page Sections

download

Setting Up Translations Using Salesforce

The translation URL must be present on the Storefront record. Go to the Storefront record > Translation URL = /apex/APTS_EcommerceTranslation. This URL points to a static page that contains all the translations. See example code snippet.

 Expand source

<apex:page contentType="application/json; charset=utf-8" language="{!$CurrentPage.parameters.language}">

{
  "ERROR": {
    "MIN-OPTIONS": "{!$Label.eCom_MIN_OPTIONS}",
    "CART": {
      "TOO_MANY_ATTEMPTS": "{!$Label.ecom_TOO_MANY_ATTEMPTS}",
      "PRICE_CHANGE": "{!$Label.eCom_PRICE_CHANGE}",
      "PRICE_CHANGE_TOASTR_TITLE": "{!$Label.eCom_PRICE_CHANGE_TOASTR_TITLE}"
    },
    "APPLICATION_ERROR_TOASTR_TITLE": "{!$Label.eCom_APPLICATION_ERROR_TOASTR_TITLE}"
  },
  "SUCCESS": {
    "CART": {
      "ITEM_ADDED_TOASTR_MESSAGE": "{!$Label.eCom_ITEM_ADDED_TOASTR_MESSAGE}",
      "ITEM_ADDED_TOASTR_TITLE": "{!$Label.eCom_ITEM_ADDED_TOASTR_TITLE}"
    }
  },
  "ASSETS": {
    "CHANGECONFIGURATION_SUCCESS": "{!$Label.eCom_Assets_ChangeConfigurationSuccess}",
    "CHANGECONFIGURATION_START_DATE": "{!$Label.eCom_Assets_ChangeConfigurationStartDate}",
    "CHANGECONFIGURATION_END_DATE": "{!$Label.eCom_Assets_ChangeConfigurationEndDate}"
  },
  "MY_ACCOUNT": {
    "LAST_LOGIN_DATE": "{!$Label.eCom_LAST_LOGIN_DATE}"
  },
  "BUTTON": {
    "Change Configuration": "{!$Label.eCom_Button_ChangeConfiguration}"
  },
  "PRODUCT_CARD": {
    "INSTALLED_PRODUCT": "{!$Label.eCom_PRODUCT_CARD_INSTALLED_PRODUCT}",
    "STANDARD_PRICE": "{!$Label.eCom_PRODUCT_CARD_STANDARD_PRICE}"
  },
  "PAGINATION": {
    "FIRST": "{!$Label.eCom_PAGINATION_FIRST}"
  },
  "COMMON": {
    "ORDERS": "{!$Label.eCom_COMMON_ORDERS}",
    "USERNAME": "{!$Label.eCom_COMMON_USERNAME}",
    "QUANTITY": "{!$Label.eCom_COMMON_QUANTITY}",
    "CHANGE_CONFIGURATION": "{!$Label.eCom_Common_ChangeConfiguration}",
    "ADD_TO_CART": "{!$Label.eCom_Add_to_Cart}"
  },
  "CONSTRAINT_POPOVER": {
    "PRODUCTS_INCLUDED_EXCLUDED_HEADING": "{!$Label.eCom_PRODUCTS_INCLUDED_EXCLUDED_HEADING}"
  },
  "CART": {
    "PAYMENT": {
      "PAYMENT_TITLE": "{!$Label.eCom_CART_PAYMENT_TITLE}"
    },
    "CART_SUMMARY": {
      "QUANTITY": "{!$Label.eCom_CART_SUMMARY_QUANTITY}"
    },
    "CHECKOUT": "{!$Label.eCom_CHECKOUT}",
    "BILLING_AND_SHIPPING_INFORMATION": "{!$Label.eCom_BILLING_AND_SHIPPING_INFORMATION}"
  },
  "MANAGE_CART": {
    "CART_SUMMARY": {
      "CART_SUMMARY_TITLE": "{!$Label.eCom_Cart_Summary_Title}",
      "SUB_TOTAL": "{!$Label.eCom_Sub_Total}"
    },
    "CART_TABLE": {
      "ITEMS_IN_YOURCART": "{!$Label.eCom_ITEMS_IN_YOUR_CART}"
    }
  },
  "FOOTER": {
    "PRODUCTS": "{!$Label.eCom_FOOTER_PRODUCTS}"
  },
  "HEADER": {
    "SUBMIT": "{!$Label.eCom_HEADER_SUBMIT}",
    "ENTER_YOUR_SEARCH_TERM": "{!$Label.eCom_ENTER_YOUR_SEARCH_TERM}",
    "LAST_LOGIN": "{!$Label.eCom_HEADER_LAST_LOGIN}",
    "HOME": "{!$Label.eCom_HEADER_HOME}",
    "LOG_OUT": "{!$Label.eCom_HEADER_LOG_OUT}",
    "LOG_IN": "{!$Label.eCom_HEADER_LOG_IN}"
  },
  "PROMOTION": {
    "PROMO_CODE": "{!$Label.eCom_PROMOTION_PROMO_CODE}",
    "PROMOTION_APPLIED": "{!$Label.eCom_PROMOTION_APPLIED}",
    "APPLIED_PROMOTION": "{!$Label.eCom_APPLIED_PROMOTION}"
  },
  "LOGIN": {
    "USERNAME": "{!$Label.eCom_LOGIN_USERNAME}",
    "SIGN_IN": "{!$Label.eCom_LOGIN_SIGN_IN}",
    "INCORRECT_CREDENTIALS_TOASTR_MESSAGE": "{!$Label.eCom_INCORRECT_CREDENTIALS_TOASTR_MESSAGE}"
  },
  "PRODUCT_DETAILS": {
    "PRODUCT_DETAIL": "{!$Label.eCom_PRODUCT_DETAIL}",
    "PRODUCT_CODE": "{!$Label.eCom_PRODUCT_CODE}",
    "STANDARD_PRICE": "{!$Label.eCom_PRODUCT_DETAILS_STANDARD_PRICE}",
    "UPDATE_CONFIGURATION": "{!$Label.eCom_PRODUCT_DETAILS_UPDATE_CONFIGURATION}"
  },
  "INSTALLED_PRODUCTS": {
    "PRODUCT_FAMILY": "{!$Label.eCom_INSTALLED_PRODUCTS_PRODUCT_FAMILY}"
  },
  "MINI_CART": {
    "YOUR_CART_IS_EMPTY": "{!$Label.eCom_MINI_CART_YOUR_CART_IS_EMPTY}"
  }
}
</apex:page>


Wherever you are displaying a label on the UI, a translation pipe is used.



This translation pipe calls the translation loader service, which uses the translation get method to look for the translation URL whether it is in the code base or defined on the storefront object. The translation get method looks at the URL, reads the file, gets all the key values, and displays the response on the template.

Defining translations on Salesforce using Custom Labels

For the translation URL defined on the Storefront record, you must define custom labels.

To define custom labels

  1. Go to Setup > App Setup > Create and click Custom Labels.
  2. Click New Custom Label.
  3. Enter a Short Description for the custom label you are creating.
  4. Enter a Name for the custom label.
  5. The default language is English.
  6. In Categories, enter text to categorize the label.
  7. In the Value text box, enter text. This value can be translated into any language that Salesforce supports.
  8. Click Save.

Translations for custom labels determine what text to display for the label’s value when a user’s default language is the translation language.

  1. Go to Setup > App Setup > Create and click Custom Labels.
  2. Select the name of the custom label to open.
  3. In the Translations related list, click New to enter a new translation or Edit next to the language to change a translation.
  4. Select the Language you are translating into.
  5. Enter the Translation Text. This text overrides the value specified in the label's Value field when a user's default language is the translation language.
  6. Click Save.

Defining translations for custom objects

Salesforce supports Product Translations, Category Translations, and Attribute Group Translations.

To define translations for Products

  1. Go to the Product Translations tab and click New. - OR - Go to the Product tab, select a product for which you want to define translation, and from the Product Translations related list, click New Product Translations.
  2. Enter a Translation Name.
  3. Enter translated text for the following fields:
    • Description
    • Language
    • Name
    • Product
    • ProductCode
      Note:

      Currently, Family is not supported.



Now when you browse a product on the cart for which you have defined translations in Salesforce, the translated text is displayed.



Note:

For illustration purposes, the translated categories are prefixed with es_ in the above image. In the actual scenario, the correct language is displayed.

Similarly, you can define category translations.

To define translations for Categories

  1. Go to the Product tab, select a product for which you want to define the category translation.
  2. Go to the Categories related list and click the category classification Id.
  3. From the Product Classification page, click the Category.

    - OR -

  4. Go to the Categories tab and select the Category for which you want to define translations.
  5. From the Category Translations related list, click New Category Translation.
  6. Enter a Category Translation Name.
  7. Search and select the Category Hierarchy.
  8. Enter a Language and a Label.
  9. Select a currency.
  10. Click Save.

To define translations for Product Attribute Group

  1. Go to the Product Attribute Groups tab and select a product attribute group for which you want to define the attribute group translation.
  2. Go to the Attribute Group Translations related list and click New Attribute Group Translation.
  3. Enter a Translation Name.
  4. The Product Attribute Group field is already populated.
  5. In Name, enter the translated attribute group name.
  6. Enter a Language.
  7. Select a currency.
  8. Click Save.