什么技术可以最省力地实现现有 Delphi 应用程序的国际化(至少是多语言)?

发布于 2024-07-08 08:52:16 字数 91 浏览 15 评论 0原文

我已经开发了大约 300 个应用程序,我希望为它们提供独立于操作系统的多语言功能。 我编写了一个即时翻译器,但在具有许多组件的应用程序中速度太慢。 你建议我做什么?

I have developed about 300 Applications which I would like to provide with multi-language capabilities independent from the Operating System. I have written a just-in-time translator, but that is too slow in applications with many components. What would you suggest I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

被翻牌 2024-07-15 08:52:16

我们正在使用 TsiLang 并且对此非常满意。

最好的一点是,您可以使用字典(您从现有翻译中填充)来预翻译项目。

We are using TsiLang and are very happy with it.

One of the best points is that you can pretranslate the project with a dictionary (which you filled from existing translations).

〃安静 2024-07-15 08:52:16

我听说 TsiLang 组件 很好,但您正在寻找一个就地解决方案。 ..

我使用了 GNU gettext for Delphi ,它完全符合你想要的功能,它加载翻译文本文件并替换组件中的文本。 它甚至有一个 pas/dfm 扫描仪来自动生成英文翻译文件。

还可以自动更改您的 pascal 源代码以注入 gettext 过程来代替静态字符串。 如果我没有记错的话,它只是添加一个下划线作为函数,如下所示。

ShowMessage('Hello'); // before
ShowMessage(_('Hello')); // after

我必须说,距离我上次使用这种方法已经有两年了。

有一件事仍然存在问题,Delphi 组件未启用 unicode(D2009 修复了此问题),因此当您不更改组件时,您对其他语言的支持仍然有限。

I've heard that the TsiLang components are nice, but your looking at an inplace solution...

I've used GNU gettext for Delphi which does exactly the thing you want, it loads the translations from a text file and replaces the text in your components. It even has a pas/dfm scanner to automatically generate the English translation file.

It's also possible to automatically change your pascal source code to inject the gettext procedure inplace of your static strings. If I'm not mistaken it just adds a underscore as function to it, as below.

ShowMessage('Hello'); // before
ShowMessage(_('Hello')); // after

I must say it has been 2 years since I last used this method.

One thing will remain problematic, the Delphi components are not unicode enabled (D2009 fixes this), so when you don't change the components you'll still have limited support for other languages.

话少心凉 2024-07-15 08:52:16

一个好的免费解决方案是 GNU gettext for Delphi。 它具有 TsiLang 中不存在的一些功能 - 例如,您可以将如何计算事物的知识(一、二、四、百二、许多...的不同结尾)放入翻译文件中,这样您就不会'不必教每个程序来了解这些东西。

Delphi 部分的许可证非常宽松,但我不确定包含的 GNU 内容会对您的应用程序产生多大影响。

A good free solution would be GNU gettext for Delphi. It has some capabilities not present in TsiLang - for example, you can put the knowledge on how to count things (different endings for one, two, four, hundred and two, many ...) into the translation file so that you don't have to teach each program to know this stuff.

License for the Delphi part is very permissive but I'm not sure how much the included GNU stuff will affect your application.

南冥有猫 2024-07-15 08:52:16

获取Multilizer。 它是用 Delphi 制作的,可以像其他程序一样处理 Delphi 程序,并特别支持 VCL。 您甚至可以为每种语言轻松重做屏幕。 通过 Multilizer,您可以使用不同的技术来翻译和运行您的程序。

Get Multilizer. It is made in Delphi and it can handle Delphi programs like no other with special support for VCL. You can even redo your screens easy for every language. With Multilizer you can use different techniques to translate and run your program.

抚笙 2024-07-15 08:52:16

Delphi 2009 添加了集成翻译环境/外部翻译管理器
ITE 和 ETM 现在可用于 Delphi 和 C++Builder。

在 Codegear 的文章:What's New in Delphi and C++Builder 2009 中,他们指出:

集成翻译环境
(ITE) 是 IDE 的一部分
简化项目的本地化。
ITE 可以创建新的本地化项目
来自现有项目。 ITE 没有
自动翻译文本,但是
提供一个列出所有文本的对话框
需要本地化的字段
其中输入相应的
翻译后的文本。 一旦您进入
翻译后的文本并构建了
本地化项目,您可以设置另一个
语言处于活动状态并显示表格
本地化文本; 你不必
切换区域设置并重新启动系统。
这允许您执行
本地化,无需
本地化系统。

外部翻译管理器 (ETM)
是一个可以运行的独立应用程序
与 DFM 文件和文本字符串
源代码。 虽然ETM没有
允许您创建新的本地化
项目,它确实提供了一个对话框
列出本地化文本和
翻译文本,类似于 ITE。

当我想要将我的产品国际化时,这就是我计划首先尝试的方法。

然而,对我来说最简单的部分是翻译程序。 困难的部分是翻译帮助文件。

Delphi 2009 has added an Integrated Translation Environment/External Translation Manager
ITE and ETM are now available for both Delphi and C++Builder.

In Codegear's article: What's New in Delphi and C++Builder 2009, they state:

The Integrated Translation Environment
(ITE) is a part of the IDE that
simplifies localizing your projects.
ITE can create a new localized project
from an existing project. ITE does not
automatically translate text, but
provides a dialog listing all text
that needs to be localized and fields
in which to enter the corresponding
translated text. Once you have entered
the translated text and built the
localized project, you can set another
language active and display a form in
the localized text; you don't have to
switch locales and reboot your system.
This allows you to perform
localization without requiring a
localized system.

The External Translation Manager (ETM)
is a standalone application that works
with DFM files and text strings in the
source code. Although ETM does not
allow you to create a new localized
project, it does provide a dialog
listing localized text and the
translated text, similarly to ITE.

This is what I plan to try first once I am at the point that I want to Internationalize my product.

However, to me the easy part is to translate the program. The hard part is to translate the help file.

つ可否回来 2024-07-15 08:52:16

我会说GNU gettext for DelphiTMS Unicode 组件包(以前在 TntWare 下免费)以获得组件中的 unicode 支持。

要使用或让翻译人员使用 gettext 文件,我建议查看免费的跨平台 Poedit可以编辑 .po 文件。

I would say GNU gettext for Delphi in combination with TMS Unicode Component Pack (previously free under TntWare) to get unicode support in the components.

To work with, or have translators work with, the gettext files I recommend looking at the free cross-platform Poedit that may edit the .po files.

羁客 2024-07-15 08:52:16

如果您拥有 DexExpress 组件,只需提及 cxLocalizer

Just to mention cxLocalizer if you own DexExpress components.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文