cancel
Showing results for 
Search instead for 
Did you mean: 

Change Image Source

Former Member
0 Kudos

I need to change the source of an image based on the logon language, sy-langu. I have 2 images that are identical except for the text in the images where one is English and the other is French.

Is this possible? I can't seem to get it to work using CL_WD_IMAGE.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In the properties section of your image UI in your screen layout, point the 'Source' attribute to a string attribute in your context. Simply set the value of the attribute to the name of the image that you want to show.

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

It is an interesting exception - that images do not fit into the standard translation framework.

You are, as previously mentioned, required to do this work yourself. Given that custom images are most easily stored in the mimes of a WD application, it sometime makes sense to stored these when translation is required as <image_name>_<language>.<file extension>. Then store in your assistance class a public constant which refers to the <image_name> part. Then concatenate the sy-langu and file extension to get your file name - add this into the context and bind to the required image ui element. Remember to handle the case where a user logs in in language for which you do not have an image - choose a default language and ensure that there is always an image in the language for example.

How do you find translation for the rest of WDA?

Former Member
0 Kudos

Thanks Bob, that's what I was missing, the context!

Chris,

The particular project I'm working on is intense. I've needed to set up a bunch of assistance classes for hard coded messages. For the objects it was pretty straight forward using SE63 to translate each WD component. Not only that, but I found I had a lot of external components such as message classes, domains, and custom tables that required translation. Custom tables needed a language key added. That part was a nightmare trying to find where the tables got used and modify their queries to include the language key.

ChrisPaine
Active Contributor
0 Kudos

Hi Scott,

Just out of interest - when you do your translations do you get your development team to enter the translations, or train up a native language speaker? Do you set up a specific translation worklist for each WDA development, or is it more generic?

If you want to reply via this thread I can at least assign a few points for your reply ;-).

I'm very interested as it is something I am just starting to do, and I'm very interested in how people have approached this task. I'm certainly considering writing a tool to allow inspection of a given WDA and returning a list of texts to be translated, and then allowing that list to be loaded and have the system insert the translations. (but that will depend on when I can find the time.)

As to text tables without language keys... it's a question I always tend to ask when interviewing a potential recruit - how to create a maintain view for a table with texts. If I don't get a response with two tables being created - one for the key and one for the text and view to unite the two, they tend not to get hired. - Been there, feel your pain.

Thanks for the very interesting response.

Cheers,

Chris