Skip to content

Commit

Permalink
Use localization service to lookup string
Browse files Browse the repository at this point in the history
  • Loading branch information
newmuis committed Mar 4, 2019
1 parent b995b79 commit 6128e0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/amp-story-auto-ads/0.1/amp-story-auto-ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,9 @@ export class AmpStoryAutoAds extends AMP.BaseElement {
// Store the cta-type as an accesible var for any further pings.
this.analyticsData_[this.adPagesCreated_][Vars.CTA_TYPE] = ctaType;

const ctaText = CTA_TYPES[ctaType];
const ctaLocalizedStringId = CTA_TYPES[ctaType];
const ctaText =
this.localizationService_.getLocalizedString(ctaLocalizedStringId);
if (!ctaType) {
user().error(TAG, 'invalid "CTA Type" in ad response');
return false;
Expand Down

0 comments on commit 6128e0d

Please sign in to comment.