Tutorial

Localization

Localization

Keywords hardcoded in the default story template provided by AMP library can be translated to other languages by making use of localization feature. Pass the translation of the below words as an object to AmpLib via opts > featureConfig > localization, check localization in the opts tutorial for the API. If the translation isn't provided, fallback english words will be used.

Keyword : Object key

  • By : by
  • Published : published
  • Updated at : updatedAt
  • Also Read Story Element : alsoReadStoryElement
  • Related Stories Header Text : relatedStoriesHeaderText
// sample
const sampleOpts = {
  localization: {
   translations: {"by": "द्वारा",
    "published": "प्रकाशित"}
  ...
  }
}