Solved

How do I localize Images using a GlobalResource file (.resx) in asp.net?

Posted on 2009-07-16
2
345 Views
Last Modified: 2013-12-25
Hello, I have a banner in different languages for different versions of my website(english, french, etc) I have a .resx file for each language so it changes all the labels and textboxes to the selected language. However, I'd like to change the banner according to the selected language. Is there any way to do that?

0
Comment
Question by:CharLieYv
2 Comments
 
LVL 15

Assisted Solution

by:jinal
jinal earned 20 total points
ID: 24870628
Ues server side <asp:Image runat="server" ID='ControlImage' />

Generate resource file for each language you get ImageUrl property in that so set path over there. so it work that way.
0
 

Accepted Solution

by:
CharLieYv earned 0 total points
ID: 24871014
Well, thank you for your input Jinal. However, I find out a solution myself which is in code below... you only need to have an image folder and have each language image in each folder. I created a method that changes the image, depending on culture. Just call that method on PageLoad()


protected void Image_Chg()
    {
        string cul = Thread.CurrentThread.CurrentUICulture.Name;
        if (cul.Equals("en-US"))
           Image1.ImageUrl = "~/Images/en-US/CIDH_Banner_en.jpg";
        if (cul.Equals("es-ES"))
           Image1.ImageUrl = "~/Images/es-ES/CIDH_Banner.jpg";
        if (cul.Equals("pt-PT"))
           Image1.ImageUrl = "~/Images/pt-PT/CIDH_Banner_pt.jpg";
        if (cul.Equals("fr-FR"))
           Image1.ImageUrl = "~/Images/fr-FR/CIDH_Banner_fr.jpg";
 
    }

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question