Search the FirstSpirit Knowledge Base
Hello client wants us to set up a rule with release scope to one toggle.
During saving a Dataset, the Translation Toggle should be checked and given a Warning (yellow "Scope release"), if all Translation Toggles in all Languages (i have 10) are "false" (at least 1 has to be true).
I tried the properties:
<PROPERTY name="TRANSLATED" source="#global"/>
<PROPERTY name="INCLUDED" source="#global"/>
but then you need to fill up for all languages,
Also, I tried to add all languages with this property:
<EQUAL>
<PROPERTY name="LANG" source="#global"/>
<TEXT>EN</TEXT>
</EQUAL>
but this doesn't work.
Do you know is possible to achieve through rules?
All the best,
Aleksandar
Hi Aleksandar,
Unless I missed a recent change, there are no cross-language operating rules.
Most of the times (at least in projects I saw so far) restricting the "one" to the master language sufficed.
Another solution, you could try, is to use a hidden, language-independent field that you set to true (or any checkable value) if a translation is given, and then have a rule to check for this field to be set (in case of datasets, there is no need for mapping it to a table column). Not sure, if this works outside of visible forms, though.
Best regards,
Stefan
There is one issue I noticed
if the translated flag has been set to true for multiple languages and is then put to false for one of them, it's already changing the test toggle to "false" and showing the warning then - even if the translated flag is true for one of the other languages.
The solution is to create a hidden toggle for each language, and then through rules check if one of them checked:
<RULE>
<IF>
<EQUAL>
<PROPERTY name="LANG" source="#global"/>
<TEXT>EN</TEXT>
</EQUAL>
</IF>
<WITH>
<PROPERTY name="VALUE" source="csTranslated"/>
</WITH>
<DO>
<PROPERTY name="VALUE" source="testEn"/>
</DO>
</RULE>
<RULE>
<WITH>
<OR>
<PROPERTY name="VALUE" source="testEn"/>
<PROPERTY name="VALUE" source="testDe"/>
<PROPERTY name="VALUE" source="testFr"/>
<PROPERTY name="VALUE" source="testEs"/>
<PROPERTY name="VALUE" source="testIt"/>
</OR>
</WITH>
<DO>
<VALIDATION scope="release">
<PROPERTY name="VALID" source="csTranslated"/>
<MESSAGE lang="*" text=" Has to be yes for at least one language"/>
</VALIDATION>
</DO>
</RULE>
Also, all fields need to be mapped, because on save data source doesn't work for all entries.
All the best,
Aleksandar
Hi,
If that works for you, then it should be fine.
My suggestion was a bit different: The hidden field should be false initially and only set to true using a rule that checks for a language to be translated. It should never be set to false by such a rule, as this would obviously not work.
Cheers,
Stefan