Language Problem

kunal.kb

Member
Joined
Sep 8, 2005
Messages
21
Programming Experience
Beginner
Hi All,
I have an application in asp.net(c#),in that application i have to show text in Arabic language.
I am developing the application in visual studio 2003,
e.g.
A button....i am putting Button1 as the text of the button in the Text property.
while displaying it on the page i have to show it in Arabic.

can i write some code which will convert English to Arabic in "InitializeComponent()" part of the page......

Is it possible,
i need code.
 
I think you want resource files:

VB.NET:
Imports System.Resources
Module Resources_Example
' Note: Use the utility Resgen to make resource files
' Resgen /compile EnglishResourceStrings.txt English.resource
' File format is:
' name=value
' semicolon at the beginning of a line indicates a comment
    Public Sub Main ()
        ' To open a resource file "English.resource" in the current directory
        Dim rm As ResourceManager = ResourceManager.CreateFileBasedResourceManager( "English", ".", Nothing)
        ' Retrieve a string, CASE SENSATIVE: Refer to the name, the value
        ' is returned
        System.Console.WriteLine(rm.GetString("Testing language resource"))
    End Sub
End Module

The bat file to create the resource file:
VB.NET:
"C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\Resgen.exe" /compile English.txt

The English.txt file:
VB.NET:
Testing language resource=Testing language resource


So for arabic, you would make a file Arabic.txt, where the text on the right-hand-side is the arabic way of saying "Testing language resource". Then you compile into an output file Arabic.resource. Then you change your code to open the file "Arabic" instead of "English".
 
Back
Top