locked
language problem with visual studio 2008 RRS feed

  • Question

  • Hello, may I ask you aquestion..
    in Microsoft visual studio 2008, I try to attach atext file to the code, and make it the content of a "Label" to display it, the code can't understand Arabic Language which in text file..!!
    How can I solve this problem..??
    thanks,
    Thursday, January 17, 2013 1:47 PM

Answers

  • The runtime display of text from a file will work provided the form is configured to use the correct culture and the Windows OS has the language installed.  The Language Pack I was referring to were for the framework.  If it weren't installed you'd see messages in English.  That isn't the case here.  If you switch your UI to use the Arabic language then the file contents should display properly.

    Michael Taylor - 1/17/2013
    http://msmvps.com/blogs/p3net

    Thursday, January 17, 2013 6:23 PM
  • If the UI is in English then you should probably translate the text to English.  There is no automated tool for this (if you ignore translation services like Google).  In general it requires reading and understanding what the text says because (as you likely know) a word has different meanings depending upon the context of its usage.  However .NET is written in Unicode so you can technically display text in any language on the same UI at the same time and it'll just work.  But before it can be displayed properly you generally have to install a language pack.  In your specific case the label control is expecting English (because the form is set to use that) so you're going to get garbage.  If you switched the form to the language in the text file then you'd get the correct display.

    Michael Taylor - 1/17/2013
    http://msmvps.com/blogs/p3net

    Thursday, January 17, 2013 3:26 PM

All replies

  • Does it understands any language other than english?

    One good question is equivalent to ten best answers.

    Thursday, January 17, 2013 2:07 PM
  • it understands languages which using English letters only..!

    Thursday, January 17, 2013 2:52 PM
  • I'm sure a label can display any language in the world. What is the text in the file, and what was it displayed in the label? When you say "attach a text file to the code", what do you mean by "attach"?
    Thursday, January 17, 2013 3:15 PM
  • If the UI is in English then you should probably translate the text to English.  There is no automated tool for this (if you ignore translation services like Google).  In general it requires reading and understanding what the text says because (as you likely know) a word has different meanings depending upon the context of its usage.  However .NET is written in Unicode so you can technically display text in any language on the same UI at the same time and it'll just work.  But before it can be displayed properly you generally have to install a language pack.  In your specific case the label control is expecting English (because the form is set to use that) so you're going to get garbage.  If you switched the form to the language in the text file then you'd get the correct display.

    Michael Taylor - 1/17/2013
    http://msmvps.com/blogs/p3net

    Thursday, January 17, 2013 3:26 PM
  • I'm sure a label can display any language in the world. What is the text in the file, and what was it displayed in the label? When you say "attach a text file to the code", what do you mean by "attach"?

    "attach" means :

    String testfilename = "D:\\test.text";

    the text file contains aquestion and its choices (a,b,c)
    and after attaching this text file the "Label" will display the question.. and the choices using "Radio button"..
    both of Label and Radio Buttons can't understand Arabic Language.. it displays the letters as Question Marks..!!
    Thursday, January 17, 2013 5:11 PM
  • If the UI is in English then you should probably translate the text to English.  There is no automated tool for this (if you ignore translation services like Google).  In general it requires reading and understanding what the text says because (as you likely know) a word has different meanings depending upon the context of its usage.  However .NET is written in Unicode so you can technically display text in any language on the same UI at the same time and it'll just work.  But before it can be displayed properly you generally have to install a language pack.  In your specific case the label control is expecting English (because the form is set to use that) so you're going to get garbage.  If you switched the form to the language in the text file then you'd get the correct display.

    Michael Taylor - 1/17/2013
    http://msmvps.com/blogs/p3net


    niiiiiice.. do you mean that my version of visual studio may doesn't support Arabic Language..??
    and How can I install the Language pack...??
    thanks for your response..
    Thursday, January 17, 2013 5:23 PM
  • The runtime display of text from a file will work provided the form is configured to use the correct culture and the Windows OS has the language installed.  The Language Pack I was referring to were for the framework.  If it weren't installed you'd see messages in English.  That isn't the case here.  If you switch your UI to use the Arabic language then the file contents should display properly.

    Michael Taylor - 1/17/2013
    http://msmvps.com/blogs/p3net

    Thursday, January 17, 2013 6:23 PM