Exporting to a Useable format

From Lime 49 Wiki
Jump to: navigation, search

Once an application has been translated, selected languages or bundles can be exported to a usable format by clicking Generate in the main menu.

The form lets you select which bundles and languages to generate. The completion threshhold enables languages which are partially complete to be omitted from the generated zip file, and the Include Summary checkbox includes a summary of the generated resource files detailing the completion of each language with the zip file.


Contents

Available Formats

Firefox XUL/JavaScript

Each language for the application is contained within a different directory in the zip file. Only two bundles are used, JavaScript and XUL. In the directory for each language there is a JavaScript bundle called project-display-name.properties, a project-display-name.dtd document type definition for use within .xul files and a contents.rdf.

The ProjectDisplayName.properties file uses the same format as Java.

File Format of ProjectDisplayName.dtd

<!ENTITY ElementName "Translation for element">

<!ENTITY DifferentElementName "Translation for different element">

For more information see Firefox format.

GNU Portable Object (PO)

Each bundle is contained within a different directory in the generated zip file. The language of each bundle is used to generated the filenames. The element comment field is used to hold meta data including references, flags, the message context and any comments extracted from the source code.

Filename: /BundleName/language-code.po

File Format

# translator comments

#. source code comments

#: ../../source/someapplication/locales/../src/interface/statuslinectrl.cpp:34

#: ../../source/someapplication/locales/../src/interface/statuslinectrl.cpp:97

msgctx "context info"

msgid "Untranslated String"

msgstr "Translated String"

For more information see GNU PO Format.


Java

Exporting to Java creates .properties files. The bundle name and locale are used to determine the filename.

Filename: BundleName_language-code.properties

File Format

ElementName=Translation for element

AnotherElement=Translation for the second element

For example: A bundle called strings in Czech would create a file called strings_cs.properties.

If Escape unicode characters is checked, characters with code points above 127 are converted to unicode escape sequences (\uXXXX). If this is unchecked and the bundle contains high ASCII characters, Java may throw an exception when the resource bundle is loaded.

For more information see Java format.

.NET

.NET applications use .resx files. In the example above, the generated file would be called strings.cs.resx.

Filename: BundleName.language-code.resx

File Format

<data name="ElementName">

<value>Translation</value>

</data>

For more information see .NET format.


.NET Compact Framework

Same as .NET, but with some compatibility changes with some language codes.


PHP Array

Elements are output to PHP files as key/value pairs in an array so they can be used with the print or echo functions. The generated PHP file must be include()d first.

Filename: BundleName_language-code.php

File Format

<?php

$BundleName = array(

"ElementName" => "Translation for element",

"AnotherElement" => "Translation for the second element",

);

?>


PHP Definitions

Elements are output to PHP files as constants so they can be used with the print or echo functions. The generated PHP file just needs to be include()d first.

Filename: BundleName_language-code.php

File Format

<?php

define("ElementName","Translation for element");

define("AnotherElement","Translation for the second element");

?>

Personal tools