Language Deviations
EC API automatically output localizable values with their appropriate culture.
Assuming I have a Perfion with three languages (EN, DE and NLD) and assume we have the following product:
Now consider the following request:
<Execute method="GetProducts" refreshconfiguration="true">
<Parameter id="Channel" value="My Channel" />
<Parameter id="Keys" value="DFGR1181" />
<Parameter id="IncludeMappings" value="Title" />
</Execute>
It simply fetches the “Title” from a product with key DFGR1181. The output looks like this:
<Response>
<Result>
<Channel name="My Channel">
<TotalCount>1</TotalCount>
<Products>
<Product id="623" ecommerceproduct="DFGR1181">
<Fields>
<Field name="Title" culture="en-US">Grindenstein Knock-Box, Black</Field>
<Field name="Title" culture="de-DE">Grindenstein Knock-Box, Schwarz</Field>
<Field name="Title" culture="nl-NL">Grindenstein Knock-Box, Zwart</Field>
</Fields>
</Product>
</Products>
</Channel>
</Result>
</Response>
Note how EC outputs 3 titles all marked with their individual culture.
If you are not happy with the culture EC automatically maps to or you need the same language mapped to multiple cultures, you can use Language Deviations to achieve that.
Language Deviations can be made in ECommerce Mappings. Consider the following mappings:
Notice how I ask to have English-texts put into two different cultures that I happen to name “British English” and “US English”, respectively. And that I want DE to be called “German” and NLD to be called “Dutch”.
Taking a look at the result of the exact same request as before, gives us the desired result:
<Response>
<Result>
<Channel name="My Channel">
<TotalCount>1</TotalCount>
<Products>
<Product id="623" ecommerceproduct="DFGR1181">
<Fields>
<Field name="Title" culture="British English">Grindenstein Knock-Box, Black</Field>
<Field name="Title" culture="US English">Grindenstein Knock-Box, Black</Field>
<Field name="Title" culture="German">Grindenstein Knock-Box, Schwarz</Field>
<Field name="Title" culture="Dutch">Grindenstein Knock-Box, Zwart</Field>
</Fields>
</Product>
</Products>
</Channel>
</Result>
</Response>
Notice that since “British English” and “US English” come from the same “EN”-language these contain the exact same text.