简体   繁体   English

移动 Firemonkey 应用程序本地化

[英]Mobile Firemonkey Application localization

I am trying to build a multilanguage Firemonkey Mobile application for Android using Delphi XE5 update1.我正在尝试使用 Delphi XE5 update1 为 Android 构建多语言 Firemonkey 移动应用程序。

I tried using the TLang component but it seems to be completely broken.我尝试使用 TLang 组件,但它似乎完全损坏了。 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?是否有另一种方法来编码我的方式来存储多语言字符串并在我从应用程序菜单中选择一种语言时将它们调出?

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.对于简单的项目,TLang 工作正常,但您是对的:包含的“语言设计器”(双击 TLang 组件)不是很有趣,而且似乎有很多问题。
I wrote a tool to handle this issues and enable easy import of extern translated CSV files.我编写了一个工具来处理这个问题,并可以轻松导入 extern 翻译的 CSV 文件。
The progress then:之后的进展:

  1. Use TLang for parsing your sources and resources for strings.使用 TLang 来解析字符串的源代码和资源。
  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.使用 TLang 转换器工具从 CSV 文件中创建一个 LNG 文件。
  5. Import the LNG File into the TLang component.将 LNG 文件导入到 TLang 组件中。

See TLang converter for more informations.有关更多信息,请参阅TLang 转换器

For large projects you may also check out some commercial products for translating/localization of Delphi FMX projects like:对于大型项目,您还可以查看一些用于翻译/本地化 Delphi FMX 项目的商业产品,例如:
http://www.sisulizer.de http://www.sisulizer.de
http://www.tsilang.com http://www.tsilang.com
http://www.regulace.org http://www.regulace.org

您可以从 FMX.Types 挂钩CustomTranslateProc: TCustomTranslateProc以本地化例如对话框按钮,请参阅http://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Types.CustomTranslateProc

You can use GnuGetText, it works fine with FireMonkey.您可以使用 GnuGetText,它适用于 FireMonkey。 You just have to call TranslateComponents in each form's constructor.您只需要在每个表单的构造函数中调用 TranslateComponents。

Here is a Delphi implementation for GnuGetText: http://dxgettext.po.dk/这是 GnuGetText 的 Delphi 实现: http ://dxgettext.po.dk/

Regarding string extraction: the xfm files are not recognized out of the box.关于字符串提取:无法立即识别 xfm 文件。 You have to rename (or copy) them temporarly to dfm and then run the extraction tool.您必须暂时将它们重命名(或复制)为 dfm,然后运行提取工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 FireMonkey移动应用程序(Android)中的字符串网格的属性 - Properties of a String Grid in FireMonkey Mobile Application (Android) 在Delphi Firemonkey移动应用程序中读写inifile? - Read and writing a inifile in a Delphi Firemonkey Mobile Application? xamarin(或其他)移动应用程序教程屏幕本地化 - xamarin (or other) mobile application tutorial screens localization FireMonkey Mobile Android应用程序上的表单仅纵向对齐 - Only portrait orientation to a form on a FireMonkey Mobile Android application 关闭delphi firemonkey移动应用程序(Android)中的模式对话框 - Closing modal dialog in delphi firemonkey mobile application (Android) 如何在FireMonkey移动应用程序中更改工具栏的颜色 - How can I change the colour of the toolbar in a FireMonkey mobile application 在 firemonkey 应用程序中清除 VertScrollBox - Clear VertScrollBox in firemonkey application 如何根据FireMonkey移动应用程序中的设备动态更改背景图像文件? - How can I change background image file dynamically depending on device in a FireMonkey Mobile Application? 如何在Firemonkey移动应用程序中获取手机的联系人列表? - How can I get a phone's contact list in a Firemonkey mobile application? 移动应用本地化 - Localization of mobile apps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM