Home > Forum > Forms > Display 'Data Protection Declaration' in different languages.

Display 'Data Protection Declaration' in different languages.
0

Account deleted

Hi community

I am currently implementing a process where the form is filled out by "visitors" of our company. (In short, it is a visitor registration at the reception).
By law and for company policy reasons, we have to display a "Data Protection Notice" on the form before the visitor can complete the registration.
By company policy, we are required to provide this notice in each country in _all_ possible languages. [We have the Data Protection Notice in 8 languages.]

What would be the best way to provide this information to a visitor on the form?
I have already thought about a tab panel and an HTML field. Unfortunately, I haven't come up with an idea yet how to display the HTML field depending on the selected/user language.
(Or if there is a possibility for the user/visitor to select the language in which the data protection notice should be displayed via a choice field).

Does anyone have an idea how to implement this or has already implemented something like this? Or has another idea?

Thanks.

MVP

Hi,

depending on the the amount of information and styling options the html fields would surely be the best option.

For you current solution you could create a form rule in JavaScript mode and hide/show the fields.


switch (G_BROWSER_LANGUAGE.substr(0, 2)) {
case "de":
HideField('#{FLD:5019}#');
ShowField('#{FLD:5020}#');
break;
case "pl":
break;
default:
break;
}

Alternatively you could prepare the data protection notice in the switch and add it to a container:
The below code is just an idea and is not tested, there can be syntax errors and the like.
<div id="dataProtection"></div>

<script>
var dataProtectionContent = ""
switch (G_BROWSER_LANGUAGE.substr(0, 2)) {
case "de":
dataProtectionContent =
`
My html content
`;
break;
case "pl":
break;
default:
break;
}
document.getElementById("dataProtection").insertAdjacentHTML("beforeend", dataProtectionContent );
</script>

If it's not to much content. you can also use a Business Rule which uses the Text function. This allows to define text in multiple languages and will display the correct one for the current user. But the other options would allow you to add some language selection. :)

Best regards,
Daniel

Account deleted
In reply to: Daniel Krüger (Cosmo Consult)

Hi,

depending on the the amount of information and styling options the html fields would surely be the best option.

For you current solution you could create a form rule in JavaScript mode and hide/show the fields.


switch (G_BROWSER_LANGUAGE.substr(0, 2)) {
case "de":
HideField('#{FLD:5019}#');
ShowField('#{FLD:5020}#');
break;
case "pl":
break;
default:
break;
}

Alternatively you could prepare the data protection notice in the switch and add it to a container:
The below code is just an idea and is not tested, there can be syntax errors and the like.
<div id="dataProtection"></div>

<script>
var dataProtectionContent = ""
switch (G_BROWSER_LANGUAGE.substr(0, 2)) {
case "de":
dataProtectionContent =
`
My html content
`;
break;
case "pl":
break;
default:
break;
}
document.getElementById("dataProtection").insertAdjacentHTML("beforeend", dataProtectionContent );
</script>

If it's not to much content. you can also use a Business Rule which uses the Text function. This allows to define text in multiple languages and will display the correct one for the current user. But the other options would allow you to add some language selection. :)

Best regards,
Daniel

Hi Daniel,

Thank you very much for your support.

I was hoping that Webcon would be capable of a more sophisticated solution.

What I have now come to is the following solution.
I have created an HTML field and used the following configuration for it.

----------HTML Field Config----------
<div id="company_agreement_text"></div>
<script>
var DataProtectionNoticeField = document.getElementById("company_agreement_text");
DataProtectionNotice_de_DE = `
<p>A LOT of HTML</p>
`;
DataProtectionNotice_it_IT = `
<p>A LOT of HTML</p>
`;
DataProtectionNotice_default = `
<p>A LOT of HTML</p>
`;
if ("#{USERLAN}#" == "de-DE") {
DataProtectionNoticeField.innerHTML = DataProtectionNotice_de_DE;
} else if ("#{USERLAN}#" == "it-IT") {
DataProtectionNoticeField.innerHTML = DataProtectionNotice_it_IT;
} else {
DataProtectionNoticeField.innerHTML = DataProtectionNotice_default;
}
</script>
------------------------------------

Furthermore, in order to give the user the flexibility to display the data protection notice in different languages on the form, I decided to insert a choice field with the languages.
On the choice field I have created a form rule on value change (JavaScript Mode).

----------Choice Field form rule----------
var DataProtectionNoticeField = document.getElementById("company_agreement_text");
DataProtectionNotice_de_DE = `
<p>A LOT of HTML</p>
`;
DataProtectionNotice_it_IT = `
<p>A LOT of HTML</p>
`;
DataProtectionNotice_default = `
<p>A LOT of HTML</p>
`;
var LanguageSelected= GetPairName(GetValue('#{Language:ChoiceField}#'));
switch (LanguageSelected) {
case "German":
DataProtectionNoticeField.innerHTML = DataProtectionNotice_de_DE;
break;
case "Italian":
DataProtectionNoticeField.innerHTML = DataProtectionNotice_it_IT;
break;
default:
DataProtectionNoticeField.innerHTML = DataProtectionNotice_default;
break;
}
----------------------------------------

I realise that I could have written both solutions as well as <if else> or <switch case>. After I created the HTML field, I just wanted to try the <switch case> with the choice field, then I was just too lazy to rewrite the HTML field to <switch case> as well to stay consistent throughout. If it works, it works.

*Indeed, I hope that future versions of Webcon will offer better solutions in this direction.