How to translate auth0_prompt_partials

I’m currently adding some custom text to my universal login widget, using form_content_end in a prompt_partials. The prompt that I am adding informs users that by logging in, they agree to the terms and conditions.

I need to localize this content into 5 language, and my current method feels more clunky that I would expect.

I’m setting the form_content_end to this liquid template:

<div>{{ prompt.screen.texts.varTermsAndConditions }}</div>

and I’m then creating a auth0_prompt_custom_text named var-terms-and-conditions, which I’m overriding for each language, with the actual localised content. Here is my var-terms-conditions for en, for example:

By logging in you confirm that you accept the...

It would be much more convenient if I could specify the language directly when making my auth0_prompt_partials, so that I can avoid the indirection through the liquid. The only reason I need it is because I can’t specify a language on the partial.

1 Like

Hi @marc4,

Welcome to the Auth0 Community and sorry for the late reply.

You can actually specify the language directly when creating your auth0_prompt_partials by using the locale variable. For this option to work you’ll have to enable the locales in your tenant from Settings > General, then you can implement this by following the example described in our documentation about Dynamic Variables to Internationalize Custom Form Elements.

Additionally you can also have a look at our documentation about ui_locales from Universal Login Internationalization.

I hope this helps your case, but others as well.
Thanks,
Remus

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.