Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 20th, 2004, 09:58 AM
Authorized User
 
Join Date: Jul 2004
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aravwind Send a message via Yahoo to aravwind
Default Multi-lingual support

I developed a ASP.NET forum appln
if i want the forum to be made
enriched with multilingual
support especially in "german"
how sall i do it.
is there any provision to convert
english code of my file to german
in .NET

__________________
Aravindan.N
Faster and consistent will surely beat the slow and steady
 
Old July 20th, 2004, 12:02 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You should look into resource files. You can store all the displayed text strings in your application in resource files. One for each language you want to support. Every place in your application that has text, you'll need to set the text property of the control from the resource file. The resource utilities will automatically return you the appropriate text based on the current language setting. I haven't actually done this yet, but I have read about it and will soon be embarking on this very task myself.
 
Old July 20th, 2004, 11:21 PM
Authorized User
 
Join Date: Jul 2004
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aravwind Send a message via Yahoo to aravwind
Default

Thank you planoie

i try this way

 
Old July 21st, 2004, 12:04 AM
CTS CTS is offline
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to CTS
Default

The Steps are

1. Create a Resource File like below :LocString.resx in ur project
2. Imports the following namespaces

Imports System.Resources
Imports System.Globalization
Imports System.Threading

3. put a button on a form & in the click event type the following code :

Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US") ' chng this line based on ur needs like 'ja-JA' for japanese

       Dim Myrsrcset As ResXResourceSet = New ResXResourceSet(Application.StartupPath + "/LocStrings.resx") ' change this line based on path of LocStrings.resx file...

        Dim ci As CultureInfo = New CultureInfo("en-US") ' chng this line based on ur needs like 'ja-JA' for japanese

        MsgBox(rmData1.GetString("HelloCaption"))

4. Any questions pls mail to Sugaz007@hotmail.com Good Luck.

----------------LocString.resx----Code-----------------------

<?xml version="1.0" encoding="utf-8" ?>
<root>
    <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xsd:element name="root" msdata:IsDataSet="true">
            <xsd:complexType>
                <xsd:choice maxOccurs="unbounded">
                    <xsd:element name="data">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
                            </xsd:sequence>
                            <xsd:attribute name="name" type="xsd:string" />
                            <xsd:attribute name="type" type="xsd:string" />
                            <xsd:attribute name="mimetype" type="xsd:string" />
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="resheader">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                            </xsd:sequence>
                            <xsd:attribute name="name" type="xsd:string" use="required" />
                        </xsd:complexType>
                    </xsd:element>
                </xsd:choice>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>
    <resheader name="ResMimeType">
        <value>text/microsoft-resx</value>
    </resheader>
    <resheader name="Version">
        <value>1.0.0.0</value>
    </resheader>
    <resheader name="Reader">
        <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    </resheader>
    <resheader name="Writer">
        <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    </resheader>
    <data name="HelloCaption">
        <value>Hello World!</value>
    </data>
    <data name="HelloTest">
        <value>Hello World Test!</value>
    </data>
</root>

 
Old July 21st, 2004, 08:18 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

That's a great example, but where is the other language? How does this work when you change the culture? I recall something about having a resource file for each language you want to support, and the resource set class handles getting that based on the culture. I don't see in your example the linkup between multiple resource files and the "active culture".

What is "rmData1", is that supposed to be "Myrsrcset"?





Similar Threads
Thread Thread Starter Forum Replies Last Post
multi lingual website with php - how can I? js_pandey PHP How-To 3 March 30th, 2011 07:06 AM
Error-Object does not support doesn't support this bootsy Classic ASP Basics 1 May 25th, 2008 07:14 PM
ASP multi language support fhameed Classic ASP Components 0 May 19th, 2006 05:22 AM
multi-multi-multiple Insert with subquery??? jmjyiannis SQL Server 2000 1 May 5th, 2006 02:20 PM
Bi-Lingual database Design franceg68 SQL Server 2000 1 January 18th, 2005 06:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.