ABBREVIATIONS USED:
BTW, nobody is fluent in all languages, so, we will need a way to make i18n easy to maintain and redistribute for people that can help with our translations, such as friends and contributors in other countries. This is one of the great things about open-source; you can get help from contributors to test and translate your open-source project. And, it can also help a translation vendor who might work on your commercial project too. In any case, we will need an infrastructure to make this workflow easy for developers and translators.
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="org.yourorghere.simplei18nmodule" default="netbeans" basedir=".">
<description>Builds, tests, and runs the project org.yourorghere.simplei18nmodule.</description>
<!--import file="nbproject/build-impl.xml"/-->
<import file="build-i18n.xml"/>
</project>
The structure of your project is now something like this:
Now, the infrastructure for your project is done. You can develop your module as you wish and, when it is time for translation, the new targets from build-i18n.xml will be required.
The two highlighted folders are designed for i18n operations. omegat folder is designed to maintain the original OmegaT projects. For example, you will need a project for each language you will translate your module into. So, the suggestion is to create a default module, with the English to English language (or <native> to <native> language, assuming that module is created in <native> by default) to make the bases for the specific-language translation modules.
The translatedfiles folder will contain the translated files from the OmegaT project; in other words, all javahelp and src translated files (target files). The omegat and translatedfiles folder can be renamed to any other name, so you just need to update i18n.basedir and translatedfiles.basedir properties in the i18n.properties file. It is not necessary create these folders manually. There is a helper target on build-i18n.xml named i18n-setup-project, which creates all necessary folders, based on your i18n.properties file.
After creating your folder structure, create a new OnegaT project on the omegat folder, that will be the translation base project for all languages. Follow the How to translate NetBeans IDE using OmegaT tutorial to learn about creating your project.
Source Filename Pattern: *toc.xml
Source File Encoding: <auto>
Target File Encoding: UTF-8
Target Filename Pattern: ${nameOnly}_${targetLocale}.${extension}
When you finish the translation, just have OmegaT generate your target files and NetBeans rebuild your project. Then run your project to see the results.
run.args.extra=--locale cs:CZIn case of a standalone module, this file is part of the module; and in the case of a module suite module, this file belongs to the suite.
| build-i18n.xml | ![]() |
2332 bytes |
| i18n.properties | ![]() |
267 bytes |
| i18n.zip | ![]() |
1522 bytes |
| project-struct-i18n.gif | ![]() |
4263 bytes |
| project-struct.gif | ![]() |
3367 bytes |