Mitsoloth
Mitsoloth

Reputation: 155

Mobile Firemonkey Application localization

I am trying to build a multilanguage Firemonkey Mobile application for Android using Delphi XE5 update1.

I tried using the TLang component but it seems to be completely broken. Is there another way to code my way to store the multilang strings and bring them up when i have selected a language from my application menu?

Upvotes: 3

Views: 1936

Answers (3)

netcodecz
netcodecz

Reputation: 312

You can hook CustomTranslateProc: TCustomTranslateProc from FMX.Types to localise for example dialog buttons see http://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Types.CustomTranslateProc

Upvotes: 1

BitBumper
BitBumper

Reputation: 379

For simple projects TLang works fine, but you're right: The included "Language Designer" (doubleclick on the TLang component) is not much fun and seems to have many issues.
I wrote a tool to handle this issues and enable easy import of extern translated CSV files.
The progress then:

  1. Use TLang for parsing your sources and resources for strings.
  2. Export them to a text file.
  3. In a extern spreadsheet or translation tool you do your translations.
  4. Use the TLang converter tool to create a LNG file out of the CSV file.
  5. Import the LNG File into the TLang component.

See TLang converter for more informations.

For large projects you may also check out some commercial products for translating/localization of Delphi FMX projects like:
http://www.sisulizer.de
http://www.tsilang.com
http://www.regulace.org

Upvotes: 2

Steffen Binas
Steffen Binas

Reputation: 1468

You can use GnuGetText, it works fine with FireMonkey. You just have to call TranslateComponents in each form's constructor.

Here is a Delphi implementation for GnuGetText: http://dxgettext.po.dk/

Regarding string extraction: the xfm files are not recognized out of the box. You have to rename (or copy) them temporarly to dfm and then run the extraction tool.

Upvotes: 0

Related Questions