You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
configure({ generateMessage: localize({ es: { messages: { required_if: "Este campo es obligatorio si 0:{fields} es 1:{value_required}", }, }, en: { messages: { required_if: "This field is required if 0:{fields} es 1:{value_required}", }, }, }), });
The rule works fine but i need translate the rule argument in the messages, for example: monday => lunes.
Can you help me please?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I have created a custom required_if rule and I need to translate its arguments in messages.
The call rule in component:
<k-range-time id="range-time-monday" v-model="formData.extraData.days_times.monday" name="monday_time" rules="required_if:monday,activated" :disabled="disableField.monday" />
The rule:
export function useRequiredIfValidation() { defineRule("required_if", (value, [target, valueTarget], ctx) => { return !( String(ctx.form[target]) == String(valueTarget) && isEmptyValue(value) ); }); }
The message:
configure({ generateMessage: localize({ es: { messages: { required_if: "Este campo es obligatorio si 0:{fields} es 1:{value_required}", }, }, en: { messages: { required_if: "This field is required if 0:{fields} es 1:{value_required}", }, }, }), });
The rule works fine but i need translate the rule argument in the messages, for example: monday => lunes.
Can you help me please?
Beta Was this translation helpful? Give feedback.
All reactions