locked
A few questions on this scenario RRS feed

  • Question

  • User-587364632 posted

    I have a scenario here and a few questions...

    1. I have a page where I need two different setups for two different cities, with the same language, let's say Boston and Chicago. Is it possible to name two resource files like default.aspx.en-Bo.resx and default.aspx.en-Ch.resx for Boston respectively Chicago? Also, can I set which culture file to use depending on which URL the user is on. Like chicago.myurl.com reads the resource en-Bo file and boston.myurl.com reads the en-Ch file?

    2. Is it possible to have one resource file for the entire solution? Is this globalization? As I understand it in globalization, every ListView will have the same resource text if I use globalization. Which means that two different pages can't have two different texts. But maybe I've got this wrong? (I don't really know what I'm talking about here, as you can see =)

    3. Is it possible to setup some kind of solution where the admin to my site can log in and get a list of all texts from the resource.resx that he's using? I'd like the admin to be able to reach the resource.resx page and change a translation, all from within the browser. Something like this:

    Admin enters the admin.aspx page.
    The admin.aspx page reads every field from the resource.resx page and displays them in "edit mode".
    Admin finds a label e.g "Your age:" and enters "Enter age:" in a textbox next to the label.
    Saves the change.
    The resource file is updated and the change is visible to users.

    Really, some kind of edit interface to the resource file...

    Thanks in advance!

    /zalkin

    Monday, November 1, 2010 11:25 AM

Answers

  • User-2135385890 posted

    1. I have a page where I need two different setups for two different cities, with the same language, let's say Boston and Chicago. Is it possible to name two resource files like default.aspx.en-Bo.resx and default.aspx.en-Ch.resx for Boston respectively Chicago? Also, can I set which culture file to use depending on which URL the user is on. Like chicago.myurl.com reads the resource en-Bo file and boston.myurl.com reads the en-Ch file?

    You can set the culture and uiculture by overriding the InitializeCulture method. Have a look at this:

    http://www.yaldex.com/asp_net_tutorial/html/76091f86-f967-4687-a40f-de87bd8cc9a0.htm


    2. Is it possible to have one resource file for the entire solution? Is this globalization? As I understand it in globalization, every ListView will have the same resource text if I use globalization. Which means that two different pages can't have two different texts. But maybe I've got this wrong? (I don't really know what I'm talking about here, as you can see =)

    Globalization is basically supporting different languages and culture specific formatting - if you have 1 resource file, you can only be supporting 1 language.


    3. Is it possible to setup some kind of solution where the admin to my site can log in and get a list of all texts from the resource.resx that he's using? I'd like the admin to be able to reach the resource.resx page and change a translation, all from within the browser. Something like this:

    I did that before - you can use 2 classes from System.Resources called ResxReader and ResxWriter to read and write to resource files. Just search on these.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 2, 2010 4:03 AM

All replies

  • User-2135385890 posted

    1. I have a page where I need two different setups for two different cities, with the same language, let's say Boston and Chicago. Is it possible to name two resource files like default.aspx.en-Bo.resx and default.aspx.en-Ch.resx for Boston respectively Chicago? Also, can I set which culture file to use depending on which URL the user is on. Like chicago.myurl.com reads the resource en-Bo file and boston.myurl.com reads the en-Ch file?

    You can set the culture and uiculture by overriding the InitializeCulture method. Have a look at this:

    http://www.yaldex.com/asp_net_tutorial/html/76091f86-f967-4687-a40f-de87bd8cc9a0.htm


    2. Is it possible to have one resource file for the entire solution? Is this globalization? As I understand it in globalization, every ListView will have the same resource text if I use globalization. Which means that two different pages can't have two different texts. But maybe I've got this wrong? (I don't really know what I'm talking about here, as you can see =)

    Globalization is basically supporting different languages and culture specific formatting - if you have 1 resource file, you can only be supporting 1 language.


    3. Is it possible to setup some kind of solution where the admin to my site can log in and get a list of all texts from the resource.resx that he's using? I'd like the admin to be able to reach the resource.resx page and change a translation, all from within the browser. Something like this:

    I did that before - you can use 2 classes from System.Resources called ResxReader and ResxWriter to read and write to resource files. Just search on these.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 2, 2010 4:03 AM
  • User-587364632 posted

    Sweet!

    On question 2: Do I need a new resource file for every aspx page or can I gather them all in one large file?


    Thanks!

    /zalk

    Tuesday, November 2, 2010 4:10 AM
  • User-2135385890 posted

    If you use a single global resource file, you'll have to explicitly specify a resource file expression for each item that you have text for. With implicit resourcing, you can just generate files for each page by using the VS IDE. Have a look at this page:

    http://quickstarts.asp.net/QuickStartv20/aspnet/doc/localization/localization.aspx

    Tuesday, November 2, 2010 4:24 AM