Difference between revisions of "OpenOffice NetBeans Integration/Localization"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Localization of the OpenOffice.org API plugin for NetBeans)
(Localization of the OpenOffice.org API plugin for NetBeans)
Line 7: Line 7:
* Check out the sources with Netbeans
* Check out the sources with NetBeans
This is required so you can create your own
This is required so you can create your own

Revision as of 14:02, 18 September 2007

Localization of the OpenOffice.org API plugin for NetBeans

The OpenOffice.org API plugin for NetBeans is localized for English, Japanese (ja) and Simplified Chinese (zh_CN).

If someone wants to contribute by translating the plugin in another language supported by NetBeans, this is what must be done.

  • Check out the sources with NetBeans

This is required so you can create your own templates and check your localization. To do this with NetBeans, click on CVS - Checkout... and enter :pserver:<username>@cvs.openoffice.org:/cvs as the connection string. Use your own user name instead of <username>. After clicking Next, the connection to the repository is established. Browse for a Module. The correct one is /cvs -> api -> oonetbeansintegration -> ooextensions. Check this out. Afterwards, open ooextensions as project. This is the OpenOffice.org API plugin for NetBeans. See http://tools.openoffice.org/source/browse/tools/ for details.

  • Create template files for the new language

In the project root of the new project, there is an Ant script for handling the localizations. It is called l10n.xml. Open the context menu on it and choose Run Target -> create-new-language-templates. A prompt appears where you have to enter the language and country code - e.g. zh_CN. In the build/l10n directory, a new set of files will be copied and created. The English original files are copied and all files that must be translated are newly created from the English original. When you open a file, the English text will be inside and must be translated. Be careful with calling the l10n.xml target several times. The first thing it does is cleaning the build/l10n directory. If there are already translated files inside, they will be lost.

  • Important for a valid Translation

In property files, there may be sections marked with NOI18N. These must not be translated.

The help files in org/openoffice/extensions/docs require special attention. In the base directory, only the file extensions-hs_<lang>.xml must be localized. In this file, only the entries marked with <title>...</title> and <label>...</label> are relevant. Everything else must stay as it is.

The pages to translate are all in the folder org/openoffice/extensions/docs/<lang>. The help files consist of html and xml files. In the xml files, only sections with text="..." must be localized.

  • Checking the translation

To copy your translation back, open the context menu on l10n.xml and select RunTarget -> copy-l10n-files-back. Be careful, since this is a dumb target - it will copy the English files back, too. If these were changed in the build/l10n directory, the originals will be replaced. Create your own NetBeans module (nbm file) by choosing Create NBM in the Projects view of NetBeans. Register it on the machine with your locale and your translated strings should appear. Search for nbm in the NetBeans help for more information on the modules. See especially the part Installing Modules Offline.

  • Contributing your translation

To add the translation to the OpenOffice.org API plugin, submit a zip file containing your translation as a patch. See http://contributing.openoffice.org/programming.html (last paragraphs down on the page) on how to do this.

Give us feedback on dev@api.openoffice.org in case of any questions.

Personal tools