Jump to content

Best way to deal with multilingual images that are optional


joe_g
 Share

Recommended Posts

Hey experts, I ran into this today:

A client has a site with lots of languages (12). I just learned about multilingual fields where any field can become multilingual, which is great. My problem is that I don't know what languages the client want to make language-specific images for.

In most cases the default images-field is fine, but sometimes there is a secondary language (in this case Spanish). Is there a way I can allow the client to add a language to a multilanguage field? Perhaps a combo of repeater and images field, or some sort?

I suppose I could create a version for every language. The drawback is that I would have to remember to update this field in parallel with the real languages. If the client adds polish tomorrow, I would have to add a polish alternative version of these images. It's not the end of the world, and that is probably what I will end up doing, just curious if there is more neat way?

thanks!

 

Link to comment
Share on other sites

On 12/17/2024 at 4:31 PM, joe_g said:

In most cases the default images-field is fine, but sometimes there is a secondary language (in this case Spanish). Is there a way I can allow the client to add a language to a multilanguage field?

I didn't play with multilanguage image fields, but if it's the same behavior than with other multilanguage fields (probably) you have nothing to do: if a multilanguage field defines a value for the current user language, then this value is used, otherwise the default language value is used.

EDIT : hmm, looks like there's no multilanguage image field, so language alternate fields looks like the only solution, and then a hook like @ngrmm proposed sounds good.

Edited by da²
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...