locked
Images and resource files for multi-lingual applications RRS feed

  • Question

  • User1090916182 posted

    I am in the process of translating a massive web application from English into Norwegian.  I am using RESX files placed in App_LocalResources folders, and all is going well so far.

    My question relates to pages that contain images.  Many images in the application are screen-grabs, and therefore also have localized content.  Therefore, now I've managed to get Vista to actually boot up into Norwegian I can do these screen grabs again.  This leaves me with two versions of each image, for example:

    myscreengrab01.gif   -- English screen grab
    myscreengrab01.no.gif    -- Norwegian screen grab

    Can anyone please advise on the best way to display images based on culture settings?  Can I do something as simple as this:

    <asp:Image runat="server" ImageUrl="<%$ Resources:imageUrl %>" />


    or is there a better way, such as placing the images inside the RESX files??  I have no experience with either approach, so some advice 'from the trenches' would be really good and save me time!


    Wednesday, March 3, 2010 11:47 AM

Answers

  • User-1873178297 posted

    The best way is to set the ImageUrl in the resource file

    img01.ImageUrl myscreengrab01.gif

    And in the markup:

    <asp:Image runat="server" meta:resourcekey="img01" /> 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 3, 2010 12:39 PM

All replies

  • User-1873178297 posted

    The best way is to set the ImageUrl in the resource file

    img01.ImageUrl myscreengrab01.gif

    And in the markup:

    <asp:Image runat="server" meta:resourcekey="img01" /> 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 3, 2010 12:39 PM
  • User-1636183269 posted

    Hello,

    In such scenario we generally give images name smartly like below:

    For En:

    myscreengrabEn.gif

    For En:

    myscreengrabUs.gif

    So when you use image name the you no need to use case respective to language specific imagename.

    myscreengrab + culturename + ".gif".

    Hope you understood, it is easy way to do this even same way you can set classname.

    Thursday, March 4, 2010 3:50 AM
  • User-1200560727 posted

    Hi Rouchie,

    Please go through below links:

    http://www.neodynamic.com/ND/FaqsTipsTricks.aspx?tabid=66&prodid=0&sid=53

    http://bytes.com/topic/c-sharp/answers/253290-how-add-image-files-resx

    I hope it will solve your problem. Please let me know if you have any query for the same.

    Regards,

    Tapan


    Thursday, March 4, 2010 7:06 AM
  • User1090916182 posted

    Thank you all for your suggestions.  Goldnarms, I think the method you mentioned seems as good as any others.

    What is the actual benefit of moving the images into the resources files, rather than referencing them by text?  Is there actually any benefit?



    Thursday, March 4, 2010 7:36 AM