locked
Language Translation (xml files) RRS feed

  • Question

  • Hi Guys, I have developed a mock Printer Setup Wizard which simulates setting up your printer on ur pc, to install the drivers and etc. 

    In the first main page, there will be a drop down list to select languges from, either English or Japanese. I intend to use separate xml files, and to just load the xml file for different languages accordingly, question I have is, how do I go about doing it? Thanks a lot.

     

    Regards, 

    Christian

    Tuesday, March 29, 2011 6:52 AM

Answers

  • How to switch the language? And what is the globalization?

    We could provide the languages to user, and allow them to select one language. Then we could load the language into our application to replace the label, the text of the controls. Then we could say it is a globalization application. Ok, I think you have known how to code a XML file which contains the language information. In WPF, you just need to load these XML into application, and using binding to display them on the controls. Thanks Anton, he provided the solution for setup project, but in general, a support multi-language application in WPF, we could refer to this topic in MSDN, or by XML binding as my following sample: http://cid-51b2fdd068799d15.office.live.com/self.aspx/.Public/Samples%5E_2011/20110331%5E_WPFXMLBindingMultiLanguage.zip

    Sincerely,

     


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Jie Bao Tuesday, April 5, 2011 3:20 AM
    Thursday, March 31, 2011 5:18 AM

All replies

  • You can't use Setup Project, but you can use NSIS


    • Proposed as answer by Jie Bao Tuesday, April 5, 2011 3:20 AM
    Tuesday, March 29, 2011 7:20 AM
  • Hi Anton, thanks for the reply, but im still very new at all of this and I honestly have not gotten anywhere after taking a look at the links u gave..

    Could you please give me some detailed help? Or is there someone who can gimme detailed steps/instructions to go about doing this.  I already have the xml files ready, i just need to be able to load the xml files when users choose the different language in the combobox. Thanks a lot.

    Wednesday, March 30, 2011 6:31 AM
  • How to switch the language? And what is the globalization?

    We could provide the languages to user, and allow them to select one language. Then we could load the language into our application to replace the label, the text of the controls. Then we could say it is a globalization application. Ok, I think you have known how to code a XML file which contains the language information. In WPF, you just need to load these XML into application, and using binding to display them on the controls. Thanks Anton, he provided the solution for setup project, but in general, a support multi-language application in WPF, we could refer to this topic in MSDN, or by XML binding as my following sample: http://cid-51b2fdd068799d15.office.live.com/self.aspx/.Public/Samples%5E_2011/20110331%5E_WPFXMLBindingMultiLanguage.zip

    Sincerely,

     


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Jie Bao Tuesday, April 5, 2011 3:20 AM
    Thursday, March 31, 2011 5:18 AM
  • Hi Bob,

    Thanks a lot, especially for your sample project, however.. I have tried to edit some of the coding to bring it over to project and I can't seem to be able to get it to work correctly.. I'm not using a stack panel either. Could you please help me further? I'm sorry but i'm still really bad at WPF/C#.. haha. Could you please take a look at my project, "MainWindow.xaml" I want users to be able to make a selection in the langCombo, and the desired xml file will be loaded. I'm sorry if I have a lot of silly coding errors and stuff, I'm still very bad at all of this. Thanks again. 

    http://www.mediafire.com/?gvwqb43n20ra54a

    Monday, April 18, 2011 5:13 AM
  • Hi,

    Your project is a complex project, and I do not think you could use my solution. Please simply to test my modified project:

    http://cid-51b2fdd068799d15.office.live.com/self.aspx/.Public/WorthlessSampleCode/20110418%5E_DellTestProjectForCustomer.zip

     Please test the MainWindow and select between English and Japanese, I modify the MainWindow.xaml and the ComboBox SelectedValueChanged event handler. Then I redesign the xmlDataSetSimplified class in the SampleData folder.

    Sincerely,


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Proposed as answer by Jie Bao Tuesday, April 19, 2011 7:05 AM
    Monday, April 18, 2011 10:41 AM
  • Hi, 

    Thanks a lot Bob, will take a look and come back to you. Thanks again! :) 

    Tuesday, April 19, 2011 1:05 AM
  • Hi Bob, 

    Thanks a lot, it seems to work well. However, how do I go about creating a chinese file as well. And for the English and Japanese files that are already there, are all the xml data from the previous file already there? I'm not really familiar with Windows Markup File and XML Schema File, could you please tell me roughly how should i go about doing all of this? Perhaps a program I have to use or something like that? Thank you so much again :) 

    Tuesday, April 19, 2011 1:42 AM
  • Hi,

    You just need to create one Chinese.xaml file under the Chinese folder in the SampleData folder. Since I help you to merge the xmlDataSetSimplified classes into one, and in this one xmlDataSetSimplified class. we could read the language data by the language name. Please view the constructor of the xmlDataSetSimplified class.

    Sincerely,


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 19, 2011 7:07 AM
  • Hi, Thanks a lot, I'm pretty sure I understand what I have to do. However, my Chinese file is just an XML document that i created and did binding on excel. How do I get a Windows Markup File and XML Schema File like in the language folders that you've done. Almost..I tried to redo some of the data binding for my buttons and labels, as currently only the 'Welcome' and 'Guided Install' appears on expression blend, but it doesnt seem to work. How can I solve this? Sincerely, thank you so much. 
    Tuesday, April 19, 2011 7:37 AM
  • Unfortunately, my XML is designed by myself. Since you have the English and Japanese XAML file. You could create the same one for Chinese, and just replace the value in it. Please modify the code directly, I think changing code is easier than change the value by GUI tool.
    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 19, 2011 8:15 AM
  • Hi Bob, 

    I'm really having trouble binding the rest of the objects in my project, could you help me out please. I've tried to do it  with the correct collectionIDs and all, but it doesnt appear, only the lblHeader(collectionID0) and txtBlkSetup18(collectID1)  which you've done seems to be displaying. The others wont seem to be displayed after i try binding them. 


    Wednesday, April 20, 2011 3:35 AM
  • For the rest, you should bind them as:

    {Binding DataSetCollection[index].English} , please use the index of the label in the resource xaml. And for the different window, you should change the App.Recource by the same code in the SelectedChanged event in the MainWindow.

     


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 21, 2011 11:14 AM
  • Hi Bob,

    Thank you so much!! I've managed to add some of my own content, I only had a problem because it wouldn't display until after I've tried running it. Thanks again, will come back to you if I have any more problems. :) 

    Monday, April 25, 2011 2:31 AM
  • Hi Bob, 

    Just wanted to ask you what's the best way to convert my file from excel to xaml or xml to xaml? Any software or something u can recommend? 

    Because I want to allow users to modify/add content into the excel file, which will be easier for them to do than editing the xaml/xml file itself. 

    After making changes to the excel file, all they will have to do is to reimport the file as a xaml file. Is this possible? 

    Thank you.  

    Wednesday, April 27, 2011 1:27 AM
  • I like to export the data from the Excel to one Text file (or in CSV format), then we could use the replace fucntion of the text editor to add the XML elements based on the exported data. However, for the tool, I think we could design one, just read the data from the file by IO functions and combine it in to the XML string. Then using the IO function to write an XML file.

     

     


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 27, 2011 7:37 AM
  • I've tried using excel to save it as a text file under xaml format, however I am facing a lil problem, where for some reason, some of the columns ends up with extra double quotes. so instead of " asdasda " it comes out as "" qweqwe "". I don't see why that happens, been checking everything and it shouldn't be like that. Any idea on how to solve this Bob? As always, really appreciate your help. Thank you. 
    Thursday, April 28, 2011 7:40 AM