|
|
Line 1: |
Line 1: |
| =Localization= | | =Localization= |
| | | |
− | {{NoteFormat|Offers plugin is different from other plugins because all the strings displayed in the UI are not hard coded and passed in via the Open command. Thus you will have to learn how localization works under the hood to get it working with offers. For information on how to setup localization, please refer to the Localization section in the [[Documentation:GWC:Deployment:GWCInternat|Deployment Guide]]|1}} | + | {{NoteFormat|Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/SDK/Offers-combined#Localization.}} |
− | | |
− | ==Offers localization overview==
| |
− | Localization works by looking for specific query strings containing "@18n:" and replacing them with strings defined in your localization JSON file. There are 2 things that you will need to set up to get everything working:
| |
− | * Pass in the appropriate @18n: query strings to the open command
| |
− | * Update your JSON internationalization files
| |
− | | |
− | ==Open command usage==
| |
− | There are 2 ways you can pass in a @18n: query string into the open command:
| |
− | {| border="1"
| |
− | |-
| |
− | |'''Default way''':<br/>
| |
− | '@i18n:offers.title'
| |
− | | Use the plugin name in the string to specify which plugin internationalization file to use.
| |
− | |-
| |
− | | '''Advanced and Flexible:'''<br/>
| |
− | '@i18n:offers.offer1A.title'
| |
− | |The JSON file allows for multiple different nested definitions. This is extremely useful when trying to implement internationalization for multiple different offers. Please note that the offers JSON structure and the examples below are just one way to structure your offers JSON. You can structure your offers section of the i18n JSON however you desire.
| |
− | |}
| |
− | ===Examples:===
| |
− | You should not be using localization strings for the "Display Options" section of parameters. These control how the content is displayed, but not the content itself.<br>
| |
− | The strings that need to be localized are under the Strings/Content section. These are the strings that the customer will see in your offer.<br>
| |
− | You can also localize the video URL (video), and image URL (image) if you want to link to localized content. <br>
| |
− | <source lang='javascript'>oMyPlugin.command('Offers.open', {
| |
− | // Display Options
| |
− | 'mode':'overlay',
| |
− | 'layout':'leftText',
| |
− | 'downloadVideoLib' : true,
| |
− | 'timeout' : 11000,
| |
− | 'actionID':2,
| |
− | 'media':'',
| |
− | // Strings/Content
| |
− | 'title':'@i18n:offers.title',
| |
− | 'headline':'@i18n:offers.headline',
| |
− | 'body':'@i18n:offers.body',
| |
− | 'button':'@i18n:offers.button',
| |
− | 'cta':'@i18n:offers.cta',
| |
− | // URL strings
| |
− | 'video':'@i18n:offers.video',
| |
− | 'image':'@i18n:offers.image'
| |
− | });</source>
| |
− | <br>
| |
− | <source lang='javascript'>oMyPlugin.command('Offers.open', {
| |
− | // Display Options
| |
− | 'mode':'overlay',
| |
− | 'layout':'rightText',
| |
− | // Strings/Content
| |
− | 'title':'@i18n:offers.offer1A.title',
| |
− | 'headline':'@i18n:offers.offer1A.headline',
| |
− | 'body':'@i18n:offers.offer1A.body',
| |
− | 'button':'@i18n:offers.offer1A.button',
| |
− | 'cta':'@i18n:offers.offer1A.cta',
| |
− | // URL strings
| |
− | 'image':'@i18n:offers.offer1A.image'
| |
− | });</source>
| |
− | <br>
| |
− | <source lang='javascript'>oMyPlugin.command('Offers.open', {
| |
− | // Display Options
| |
− | 'mode':'overlay',
| |
− | 'layout':'stacked',
| |
− | // Strings/Content
| |
− | 'headline':'@i18n:offers.offer1A.headline',
| |
− | 'body':'@i18n:offers.offer1A.body',
| |
− | 'button':'@i18n:offers.offer1A.button',
| |
− | 'countdownText':'@i18n:offers.offer1A.countdownText',
| |
− | 'cta':'@i18n:offers.offer1A.cta',
| |
− | // URL strings
| |
− | 'image':'@i18n:offers.offer1A.image'
| |
− | });</source> | |
− | <br>
| |
− | <source lang='javascript'>oMyPlugin.command('Offers.open', {
| |
− | // Display Options
| |
− | 'mode':'overlay',
| |
− | 'layout':'minimal',
| |
− | // Strings/Content
| |
− | 'headline':'@i18n:offers.offer1A.headline',
| |
− | 'body':'@i18n:offers.offer1A.body',
| |
− | 'button':'@i18n:offers.offer1A.button',
| |
− | 'countdownText':'@i18n:offers.offer1A.countdownText',
| |
− | 'cta':'@i18n:offers.offer1A.cta',
| |
− | // URL strings
| |
− | 'image':'@i18n:offers.offer1A.image'
| |
− | });</source> | |
− | <br>
| |
− | <source lang='javascript'>oMyPlugin.command('Offers.open', {
| |
− | // Display Options
| |
− | 'mode':'toaster',
| |
− | // Strings/Content
| |
− | 'title':'@i18n:offers.offer1B.title',
| |
− | 'headline':'@i18n:offers.offer1B.headline',
| |
− | 'body':'@i18n:offers.offer1B.body',
| |
− | 'button':'@i18n:offers.offer1B.button',
| |
− | 'cta':'@i18n:offers.offer1B.cta'
| |
− | });</source>
| |
− | | |
− | | |
− | ==Example JSON definition==
| |
− | This is an example JSON definition for offers that needs to go into your i18n JSON file. It is compatible with the open command examples above.
| |
− | <source lang='javascript'>{
| |
− | "offers": {
| |
− | "title": "GenericTitle",
| |
− | "headline": "headline",
| |
− | "body": "GenericBody",
| |
− | "button": "GenericButton",
| |
− | "cta": {
| |
− | "url": "GenericCtaURL",
| |
− | "target": "_blank"
| |
− | },
| |
− | "offer1A": {
| |
− | "title": "title1A",
| |
− | "headline": "headline1A",
| |
− | "body": "body1A",
| |
− | "button": "button1A",
| |
− | "cta": {
| |
− | "command": "SendMessage.open",
| |
− | "commandOptions": {
| |
− | "userData": {
| |
− | "testing": "ok",
| |
− | "hoping": "please"
| |
− | }
| |
− | }
| |
− | },
| |
− | "image": "imageURL1A",
| |
− | "countdownText": "Offer will close in"
| |
− | },
| |
− | "offer1B": {
| |
− | "title": "title1B",
| |
− | "headline": "headline1B",
| |
− | "body": "body1B",
| |
− | "button": "button1B",
| |
− | "cta": {
| |
− | "command": "WebChat.open",
| |
− | "commandOptions": {
| |
− | "proactive": true,
| |
− | "userData": {
| |
− | "category": "shoes"
| |
− | }
| |
− | },
| |
− | "url": "ctaurl",
| |
− | "target": "_blank"
| |
− | }
| |
− | }
| |
− | }
| |
− | }</source>
| |
| | | |
| [[Category:V:PSAAS:Public]] | | [[Category:V:PSAAS:Public]] |