# Syncing Content with Languages

### Case

Assume you have a source and destination system with multiple languages. Each language may need values adjusted per language. Or all languages need the same value set. Maybe even the languages are mismatched between the systems.

**Source content**

<figure><img src="https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FukJtHQ5kioP4gIiiqDv5%2Fimage.png?alt=media&#x26;token=76c51c94-1c3a-4183-8a43-d4f25febca87" alt=""><figcaption></figcaption></figure>

#### Solution

ImpulseSync can solve these cases with it's [applyToLanguages](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/common-manipulator-options) common manipulator option and [language](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/language) manipulator.

In this case, we'll be using a single job with 4 manipulators.&#x20;

* 2 [regex manipulators](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/regex)
* 1 [liquid manipulator](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/liquid-field)
* 1 [langauge manipulator](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/language)

<figure><img src="https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FdhOjTRKpYOrxXcw7LdKS%2Fimage.png?alt=media&#x26;token=df6f0667-fea2-4b87-9920-56e262d502e3" alt=""><figcaption></figcaption></figure>

**Regex manipulators**

<figure><img src="https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2F0EofYaKoGXPqbK7Pcfxy%2Fimage.png?alt=media&#x26;token=d5dbdddc-eabd-4691-b691-2f2716b8a303" alt=""><figcaption></figcaption></figure>

This first regex manipulator is set to replace "de" with "German". But we only want this applied to the caption field values for the `de-DE` language. The other languages values will not have this manipulator applied to them.&#x20;

<figure><img src="https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FEURUF3t3WlpmL76o2oLB%2Fimage.png?alt=media&#x26;token=9b98c695-457a-4bbc-a26d-7f495dbd3a7d" alt=""><figcaption></figcaption></figure>

This second regex manipulator is set to do something similar. It will replace "en" with "english" but only for the languages `en-US` and `en-AU` . Other languages will not have this manipulator applied to them.&#x20;

**Liquid manipulator**

<figure><img src="https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FZNXPGT8abfgeFw05tu8Q%2Fimage.png?alt=media&#x26;token=953bbf42-4221-4be6-842e-00820868eb9f" alt=""><figcaption></figcaption></figure>

This liquid manipulator is configured to create (or replace) the field `altText`. The field value of altText uses a liquid template to copy the content's current english (en) caption field value.&#x20;

Notice how unlike our regex manipulators, the `applyToLanguages` option is not set. Without that option, the manipulator will apply to every language. So this altText field will be created with this field value for every language.&#x20;

**Language manipulator**

<figure><img src="https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FpUEW1On7eePe6CmIHa0N%2Fimage.png?alt=media&#x26;token=1299137e-2e33-45b2-8195-e4dde718d83f" alt=""><figcaption></figcaption></figure>

The final manipulator, the language manipulator, is configured to change the source language `de-DE` into the destination language `de-BE`.&#x20;

{% hint style="info" %}
The `Fieldname` value is set to a white space ' '. This is due to a [known issue](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/language#known-bugs-workarounds) where a value is required, but setting the value to an existing field (such as caption) can cause the fields to be empty. Thus, because this manipulator does not use the parameter, we can set it to a white space.
{% endhint %}

Once this job is run we can see the end result from our manipulators.&#x20;

<figure><img src="https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FaWvgAHX6kqDSecvfqzry%2Fimage.png?alt=media&#x26;token=570ae2c4-86a2-4110-a24b-ba4c2365e95f" alt=""><figcaption></figcaption></figure>

We can see the regex manipulators worked because "en" was replaced for the appropriate languages. And "de" was replaced in the German language.&#x20;

We can also see the langauge manipulator worked because the language is set to "German (Belgium)" instead of "German (Germany)" as it was in the source.&#x20;

<figure><img src="https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fzl8Ik24UJ9raqMDaeyek%2Fimage.png?alt=media&#x26;token=ea9af6e3-99a9-46a7-93b5-5a0e2232586b" alt=""><figcaption></figcaption></figure>

We can also see the liquid manipulator worked and populated the altText field for every language with the same value from the content's english (en) caption field value.&#x20;
