locked
Localize with db or with .resx RRS feed

  • Question

  • User-1246604461 posted
    Im totally confused...
    I have a tblMember table. In this table I have a field: Religion.

    Okay, here follow a few assumptions, please tell me if im right or wrong

    1.   Since I want my site to be in more than one language I should not store the text name of the religion in the Religion field (e.g. dont store "Christian" there), but rather store the PK of the following table:

    2.   Because of the above I have created a seperate table tblReligion. In this table I have a PK and a few columns..ONE for EACH language. So the column "EN" for English (containing "Christian"), "NL" for Dutch (containing "Christen") etc.

    So once someone requests a member, I look at the key in the Religion field in tblMember and find the corresponding key in tblReligion, and there I look in the appropiate column (and I know the right column since I stored the language chosen by the user in a cookie) and retreive the value from for example the EN column.

    Alright, this is my proposed technique, but Im really curious whether this can work faster and better with the Resource files (e.g. .resx). If so, please explain why and how.....some MS tutorials didnt help me much further in determining the optimal technique...


    MANY THANKS!!!




    Wednesday, January 18, 2006 2:08 PM

All replies

  • User453193580 posted

    Your technique sounds interesting. I'm currently working on a sideproject of our application as well. We also need translation (for only a determined few - interfaced - usercontrols).

    I made a table with 3 PK's. Forgive me:

    -UserControlId : the usercontrolid that will be found on the invoking page (further down already)

    -WebControlId : the webcontrol's unique ID withine the previous UC ID field

    -Text, the text to be placed in the control that confirms with the WebControlId

    Not exactly the most performing solution, but here's the glory: Put 1 control on the page and it would scan the page and iterate all usercontrols. Should the userontrol be IMyFancyTranslationUserControl, it would:

    -iterate the database results for all possible controls within this UC (that is WebControlId)
    -if WebControlID is found, continue to:
    -WebControl check, hardcoded. Here we check the type of the WebControlId's "control". Label, DDL, whatever, we check, and translate, all in 1 class.

    Hope this gave some more color to the question, and I know it's not the best solution (iterate every singly control) I'd gladly discuss anything else for this very same problem.

    Wednesday, January 18, 2006 11:41 PM