Am I doing correct???????? RRS feed

  • Question

  • User154812822 posted


    after gone through some articles about multi language in asp.net i am planning to do like this.

    Friends just say, am i doing in a correct way.

    i am trying to put my website(Eng) in arabic. i am using sql server database. so for arabic, i set collation as arabic_c1_as. now my database accepting arabic values. so i have to feed equivalent arabic values here liek this

    1 دبي
    2 صناعة الطائرات
    3 الطيران الغربية
    4 وسائط الاعلام سلطان 
    5 بها الخطوط الجوية
    5 بها الخطوط الجوية

    then in coding page(.NET) i am inserting arabic values directly like this for titles etc.mostly i am fetching from database only.


    <font color=black>الفضاء والطيران:<br />


    not referencing resource file.

    just suggest me ........


    thank inadvance to everyone's interest to reply.

    Sunday, March 1, 2009 1:05 AM

All replies

  • User845932231 posted

     Your approach is Ok but it will be good to use resource files for static text rather than DB 

    Also  use dir='rtl' when showing arabic content

    Sunday, March 1, 2009 2:09 AM
  • User154812822 posted

    thanks for the reply.

    i have more than 30 web page . for each page i have to create resource file?

    where to mention dir='rtl'  code?

    pls explaing with some code.

     thanks again.

    Sunday, March 1, 2009 2:20 AM
  • User239733016 posted


    Here are the tips for you.

    1. Since the data is coming from sql server make sure the arabic field should be "nvarchar" instead of "varchar" and similarly "ntext".

    2. Another suggestion try to use two Style sheets "css" one for arabic or another one for english. in this way you don't need to specify any parameter on page level it will automatically take from the associated css file see the example below:

     font:bold 16px "Traditional Arabic";

    3. Try to create two Master Pages for Arabic and English this will help you to adjust the page layouts header/footer etc.

    Please let me know if you need further assistance.

    Sunday, March 1, 2009 2:28 AM
  • User1121160588 posted

     Hehe, the "a" in my name instead of "e" didn't came from nothing [;)]

    Regarding the rtl part, you can specifiy it in the most tags like the font dir="rtl" or body dir="rtl"


    If you have any further question I will be glad 2 help u !




    Sunday, March 1, 2009 3:56 AM
  • User-319574463 posted

    For information on Globalisation, look at http://www.guysmithferrier.com/ and in particular at Guy Smith's book ISBN 0321341384. The book is available online at Safari books at http://safari.oreilly.com/0321341384

    Also his presentation http://www.guysmithferrier.com/downloads/teni18n.pdf

    Tuesday, March 3, 2009 1:02 PM
  • User154812822 posted


    Thanks for everyone's interest for suggestion.

    Now i have 2 questions. can u please clarify it.

    1)i have nearly 30 web page should i have create resource file for each page?

    2) for testing i have created resource file for default only like this

     <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    Button2Resource1.Text<o:p></o:p> إلغاء<o:p></o:p> <o:p> </o:p>
     <o:p></o:p> Button2Resource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> CheckBox1Resource1.Text<o:p></o:p> تذكّرتني<o:p></o:p> <o:p> </o:p>
     <o:p></o:p> CheckBox1Resource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> Label1Resource1.Text<o:p></o:p> مستعملة اسم<o:p></o:p> <o:p> </o:p>
     <o:p></o:p> Label1Resource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> Label2Resource1.Text<o:p></o:p> كلمة سرّ<o:p></o:p> <o:p> </o:p>
     <o:p></o:p> Label2Resource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> Label3Resource1.Text<o:p></o:p> شركات الشرق الأوسط<o:p></o:p> <o:p> </o:p>
     <o:p></o:p> Label3Resource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> Label4Resource1.Text<o:p></o:p> إرسال لمحة عن الشركة<o:p></o:p> <o:p> </o:p>
     <o:p></o:p> Label4Resource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> lbl_ResultResource1.Text<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> lbl_ResultResource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> PageResource1.Title<o:p></o:p> [أونتيتلد] صفحة<o:p></o:p> <o:p> </o:p>
     <o:p></o:p> Panel1Resource1.GroupingText<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> Panel1Resource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> txt_PwdResource1.Text<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> txt_PwdResource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> txt_SubmitResource1.Text<o:p></o:p> قدّمت<o:p></o:p> <o:p> </o:p>
     <o:p></o:p> txt_SubmitResource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> txt_UsernameResource1.Text<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> txt_UsernameResource1.ToolTip<o:p></o:p> <o:p> </o:p> <o:p> </o:p>
     <o:p></o:p> <o:p> </o:p> <o:p> </o:p> <o:p> </o:p>

    then after created resource file with arabic values, in my default.aspx page

    the controls look like this (just 2 control pasted here)

    <asp:Label ID="Label1" runat="server" Text=" User Name" Font-Names="Tahoma" Font-Size="X-Small" Width="65px" ForeColor="White" meta:resourcekey="Label1Resource1"></asp:Label>

    <asp:TextBox ID="txt_Username" runat="server" Width="113px" Height="14px" Font-Names="Tahoma" Font-Size="Small" meta:resourcekey="txt_UsernameResource1"></asp:TextBox><br />

    but still nothing is displaying in web page acc to the value i given in resource file.

    pls tell me how to implement this.what is the prob.

    thank you.



    Wednesday, March 4, 2009 5:39 AM
  • User-319574463 posted

     If you have much common text add a Global Resource Directory otherwise a local resource directory.

    Wednesday, March 4, 2009 5:49 AM
  • User154812822 posted

    Thanks for your reply.

    Can u please elaborate your answer.

    pls answer to my 2 question if u dont mind.

    thanks again.

    Wednesday, March 4, 2009 6:12 AM
  • User-319574463 posted

     Have a look at the video "Create a Multi-Lingual Site with Localization?" at http://www.asp.net/learn/videos/video-40.aspx

    This shows you how to set up localisation.

    Wednesday, March 4, 2009 7:46 AM