From 4cba6d42e67da63c66b78f2d78036c67130d2f60 Mon Sep 17 00:00:00 2001 From: anvalchev <32509996+anvalchev@users.noreply.github.com> Date: Wed, 18 Apr 2018 17:02:33 +0300 Subject: [PATCH] feat: Multilingual UI support for the adLabel "N of N" string (#592) * Multilingual UI support for the adLabel "N of N" string * Multilingual UI support for the adLabel "N of N" string - correct line max length * Multilingual UI support for the adLabel "N of N" string - correct indentation --- README.md | 1 + src/ad-ui.js | 3 ++- src/controller.js | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 88750fd8..053e0b53 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ the previous snippet. A summary of all settings follows: | adTagUrl | string | REQUIRED IF adsResponse IS NOT PROVIDED A URL which returns a VAST, VMAP or ad rules,response. | | adsResponse | string | REQUIRED IF adTagUrl IS NOT PROVIDED The VAST, VMAP, or ad rules response to use,in lieu of fetching one an ad tag. | | adLabel | string | Replaces the "Advertisement" text in the ad label. Added for multilingual UI support. | +| adLabelNofN | string | Replaces the "of" text in the ad label (e.g. ... (1 of 2) ...). Added for multilingual UI support. | | adsRenderingSettings | object | JSON object with ads rendering settings as defined in the IMA SDK,Docs(1). | | autoPlayAdBreaks | boolean | Whether or not to automatically play VMAP or ad rules ad breaks. Defaults,to true. | | **deprecated** adWillPlayMuted | boolean | Notifies the SDK whether the player intends to start ad while muted. Changing this setting will have no impact on ad playback. Defaults,to false. | diff --git a/src/ad-ui.js b/src/ad-ui.js index 7524fe47..226f9efd 100644 --- a/src/ad-ui.js +++ b/src/ad-ui.js @@ -268,7 +268,8 @@ AdUi.prototype.updateAdUi = } let podCount = ': '; if (totalAds > 1) { - podCount = ' (' + adPosition + ' of ' + totalAds + '): '; + podCount = ' (' + adPosition + ' ' + + this.controller.getSettings().adLabelNofN + ' ' + totalAds + '): '; } this.countdownDiv.innerHTML = this.controller.getSettings().adLabel + podCount + diff --git a/src/controller.js b/src/controller.js index e6fa99a0..754a7844 100644 --- a/src/controller.js +++ b/src/controller.js @@ -78,6 +78,7 @@ Controller.IMA_DEFAULTS = { timeout: 5000, prerollTimeout: 1000, adLabel: 'Advertisement', + adLabelNofN: 'of', showControlsForJSAds: true, };