21 | | The application will detect the added languages on startup. If you wish to submit your translation, I will include it in the next release. |
| 22 | To translate files for Maestro, you need to perform a Subversion checkout. [[BR]] |
| 23 | With TortoiseSVN, simply right click on any folder, then choose "TortoiseSVN checkout...".[[BR]] |
| 24 | The repository URL is: |
| 25 | {{{ |
| 26 | http://svn.osgeo.org/mapguide/trunk/Tools/Maestro |
| 27 | }}} |
| 28 | You can choose any destination folder you like.[[BR]] |
| 29 | When you click OK, the Maestro source code is downloaded, which may take a few minutes. |
| 30 | |
| 31 | If you have a commandline subversion client, the following command should get the source: |
| 32 | {{{ |
| 33 | svn checkout http://svn.osgeo.org/mapguide/trunk/Tools/Maestro Maestro |
| 34 | }}} |
| 35 | |
| 36 | Whenever there is a change in Maestro, you can update your copy with this command: |
| 37 | {{{ |
| 38 | svn update Maestro |
| 39 | }}} |
| 40 | |
| 41 | With TortoiseSVN, simply right click the folder, and select "TortoiseSVN update". |
| 42 | |
| 43 | == Update the configuration file == |
| 44 | Inside the folder you just created by downloading the source, there should exist a folder called "Localization". In this folder, you must edit the file "configuration.xml". Near the bottom of the document you will find: |
| 45 | {{{ |
| 46 | <versionassembly>..\Maestro\bin\debug\Maestro.exe</versionassembly> |
| 47 | <sourcefolder>..</sourcefolder> |
| 48 | <outputfolder>compiled</outputfolder> |
| 49 | <productname>Maestro</productname> |
| 50 | }}} |
| 51 | |
| 52 | Everything should be fine, except the `<versionassembly>` path. Since you have not compiled Maestro, this |
| 53 | file does not exist. You must update this path to point to the Maestro.exe file that you whish to translate. |
| 54 | With a standard Maestro install on an english machine, you can enter: |
| 55 | {{{ |
| 56 | C:\Program Files\OSGeo\MapGuideMaestro\Maestro.exe |
| 57 | }}} |
| 58 | |
| 59 | Remember that localization only works with Maestro 1.0.9 r4387 or newer. |
| 60 | |
| 61 | You can also install Visual Studio 2009 (Express is fine), and build the solution, which will create the file. |
| 62 | |
| 63 | == Upgrading from a previous version == |
| 64 | If you have previously created a set of translation files, they need to be converted. |
| 65 | If you have no such set, skip this section. |
| 66 | |
| 67 | Prior to r4387 all files for a language was placed in a folder, and loaded at runtime. |
| 68 | Before you attempt this, make sure that the folder you wish to upgrade only contains a single language, |
| 69 | also make sure you have a backup of the files. |
| 70 | |
| 71 | Open a command prompt and run the tool ConvertResX.exe with a single argument, the name of the folder containing the files to use: |
| 72 | {{{ |
| 73 | C:\Documents\Maestro\Localization\ConvertResX.exe C:\Documents\MyTranslationFiles |
| 74 | }}} |
| 75 | |
| 76 | (Note that the ConvertResX tool requires .Net 3.5 or newer). |
| 77 | |
| 78 | If the folder you are converting contains .en-US.resx files, there will now be a folder called "en-US" under the Localization folder, and a file called missing.en-US.txt. The folder contains the converted set of resx files, and the missing.en-US.txt file contains a report of strings that failed to translate automatically. |
| 79 | |
| 80 | You can now skip the next section, as the lanuage folder is already created. |
| 81 | |
| 82 | == Creating a language == |
| 83 | |
| 84 | To create a new language, you need to be in a command prompt. |
| 85 | To get there, click "Start", then "Run". |
| 86 | In the window, type "cmd" and press enter. |
| 87 | |
| 88 | You now need to go to the folder where you checked out Maestro, eg: C:\Documents\Maestro. |
| 89 | {{{ |
| 90 | cd "\Documents\Maestro\Localization" |
| 91 | }}} |
| 92 | |
| 93 | Run the LocalizationTool.exe to create the language, eg en-US: |
| 94 | {{{ |
| 95 | LocalizationTool.exe create en-US |
| 96 | }}} |
| 97 | |
| 98 | Wait a little, and there should now be a folder called "en-US". |
| 99 | Inside this folder, you can now translate the .resx files and .txt files. |
| 100 | |
| 101 | == Word of warning == |
| 102 | |
| 103 | It can be a tedious task to translate large amounts of text. |
| 104 | |
| 105 | I recommend that you do not attempt to translate everything in one stretch. |
| 106 | |
| 107 | Try to allocate an hour or two each other day, and stop after that time, and |
| 108 | rest until the next turn. |
| 109 | |
| 110 | |
| 111 | === Localizing windows (forms) === |
| 112 | |
| 113 | Many resx files will exist twice: |
| 114 | {{{ |
| 115 | ApplicationSetup.resx |
| 116 | ApplicationSetup.en-US.resx |
| 117 | }}} |
| 118 | |
| 119 | You can open the localized version with the "winres.exe" tool avalible in the .Net SDK, which you have installed. |
| 120 | |
| 121 | If you open the file {{{ApplicationSetup.en-US.resx}}} with "Windows Resource Localization Editor" (the shortcut for winres.exe), you can visually see the window, and modify it interactively. You can move things around to correctly display text, but please try to keep the layout as close to the original as possible. |
| 122 | |
| 123 | Once done, save the file. |
| 124 | |
| 125 | === Localizing strings === |
| 126 | Maestro contains a number of messages that are not directly displayed in a window, primarily as error messages. |
| 127 | |
| 128 | Unfortunately the "winres.exe" does not support editing these files, so you have to use a text editor, such as the free [http://notepad-plus.sourceforge.net/uk/download.php Notepad++]. |
| 129 | |
| 130 | All the files that are missing a "neutral" resx file (those with only a `*`.en-US.resx file) must be edited with a text editor. They all start with a lot of boilerplate system code, and then multiple entries of the form: |
| 131 | {{{ |
| 132 | <data name="TimeParseError" xml:space="preserve"> |
| 133 | <value>Unable to parse "{0}" into a time offset: {1}</value> |
| 134 | </data> |
| 135 | }}} |
| 136 | |
| 137 | The "name" attribute is a system key, and may not be changed. |
| 138 | The text between the {{{<value>}}} and {{{</value>}}} is the one that needs translating. |
| 139 | The special items {0} and {1} are placeholders for some text that Maestro will insert. It should be fairly obvious what the fields will be substituted with, but if in doubt, ask on the [http://mapguide.osgeo.org/user.html MapGuide-Users mail list]. |
| 140 | |
| 141 | == Building and testing the dll's == |
| 142 | |
| 143 | When you are ready to test your work, run the following command: |
| 144 | {{{ |
| 145 | LocalizationTool.exe build en-US |
| 146 | }}} |
| 147 | |
| 148 | This will build the resource assemblies, and place them in the folder called "compiled". |
| 149 | Inside the "compiled" folder you will now see a folder called "en-US". |
| 150 | Copy this folder to your Maestro installation, so you get a folder structure like: |
| 151 | {{{ |
| 152 | C:\Program Files\Maestro\Maestro.exe |
| 153 | C:\Program Files\Maestro\en-US\Maestro.resources.dll |
| 154 | }}} |
| 155 | |
| 156 | In the logon dialog, you can now select the new language. After selecting the new language, you must restart Maestro. |
| 157 | |
| 158 | == Contributing a translation == |
| 159 | Once you translate all the files, you can contribute them to the Maestro project, |
| 160 | so others may benefit from your hard work. |
| 161 | |
| 162 | Before you can submit the translation files, you must sign and submit a [http://mapguide.osgeo.org/developer.html Contributor License Agreement]. Once the CLA is signed and recieved, either submit the files as a ticket on Trac, or announce it on the mapguide-users or mapguide-internals list. |
| 163 | |
| 164 | == Getting credit == |
| 165 | All credits are placed in the "About" box in !MapGuide Maestro. |
| 166 | In the ticket please specify what text you would like placed in the credits section. |
| 167 | |
| 168 | Happy translating! |