I need to translate an application on delphi. Now all strings in interface on Russian. What are the tools for fast find, parcing all pas'es for string constants?
我需要在delphi上翻译一个应用程序。现在俄语界面中的所有字符串。快速查找的工具有哪些,为字符串常量分配所有的句子?
How people translate large applications?
人们如何翻译大型应用?
4 个解决方案
#1
GetText should be able to do, search for "extract" at http://dxgettext.po.dk/documentation/how-to
GetText应该能够做到,在http://dxgettext.po.dk/documentation/how-to搜索“extract”
If all you need is to translate GUI and maybe resourcestring in sources, and the inline string constants in Pascal sources are not needed for translation, then you can try Delphi built-in method. However forums say that ITE is buggy. But at least that is official Delphi way.
如果您只需要在源代码中翻译GUI和可能的resourcestring,并且不需要Pascal源代码中的内联字符串常量进行翻译,那么您可以尝试使用Delphi内置方法。然而论坛说ITE是错误的。但至少那是德尔福官方的方式。
- http://edn.embarcadero.com/article/32974
- http://docwiki.embarcadero.com/RADStudio/en/Creating_Resource_DLLs
To translate sources with ITM manual preparation is needed as shown in source sheets at http://www.gunsmoker.ru/2010/06/delphi-ite-integrated-translation.html
要使用ITM手动准备翻译来源,如http://www.gunsmoker.ru/2010/06/delphi-ite-integrated-translation.html上的源表所示。
I remember i tranlsated Polaris texts for JediVCL team - so they did some extraction. But i think they just extracted all characters > #127 into a text file - there was no structure, there were constants and comments, all together.Still, there is some component, though i doubt it can be used the way you need: http://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvTranslator
我记得我为JediVCL团队传输了Polaris文本 - 所以他们做了一些提取。但我认为他们只是将所有字符>#127提取到文本文件中 - 没有结构,有常量和注释,都在一起。但是,有一些组件,但我怀疑它可以按照你需要的方式使用:http ://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvTranslator
There are also commercial tools. But i don't know if their features would help you on your initial extraction and translation tasks. They probably would be of much help when you need to mantain your large application translated to many languages, but not when you need to do one-time conversion. But maybe i am wrong, check their trial versions if you wish. By reviews those suites are considered among best of commercial ones:
还有商业工具。但我不知道他们的功能是否可以帮助您完成初始提取和翻译任务。当你需要保存翻译成多种语言的大型应用程序时,它们可能会有很大的帮助,但是当你需要进行一次性转换时则不然。但也许我错了,如果你愿意,请查看他们的试用版。通过评论,这些套房被认为是最好的商业套房:
- TsiLang Suite http://www.tsilang.com/?siteid2=7
- Korzh Localizer http://devtools.korzh.com/localization-delphi/
TsiLang Suite http://www.tsilang.com/?siteid2=7
Korzh Localizer http://devtools.korzh.com/localization-delphi/
#2
Firstly I'd recommend to move all localizable string constants into the resource string sections within their unit files. I.e.
首先,我建议将所有可本地化的字符串常量移动到其单元文件中的资源字符串部分。即
raise Exception.Create('Error: что-то пошло не так (in Russian language)');
will be converted to
将被转换为
resourcestring rsSomeErrorMessage = 'Error: что-то пошло не так (in Russian language)';...raise Exception.Create(rsSomeErrorMessage);
有关Resource Strings的更多信息。
This process can be accelerated by using the corespondent Delphi IDE refactoring command, or with third-party utilities like as ModelMaker Tools.
使用相应的Delphi IDE重构命令或第三方实用程序(如ModelMaker Tools)可以加速此过程。
Then you can use any available localizer to translate or even internationalize your program. I'd recommend my Delphi localizer - it's free.
然后,您可以使用任何可用的本地化程序来翻译甚至国际化您的程序。我推荐我的Delphi定位器 - 它是免费的。
#3
Basically, you have two ways
基本上,你有两种方法
- Resource-based localization tools (Delphi ITE, Multilizer, ecc.)
- Database-based localization tools (GetText, TsiLang, ecc.)
基于资源的本地化工具(Delphi ITE,Multilizer,ecc。)
基于数据库的本地化工具(GetText,TsiLang,ecc。)
The former takes advantage of the Windows resource support, resource loading can be redirected to a different one stored into a DLL when the application is started. The advantages are that whole forms can be localized, including images, colors, control sizes, etc. and not only strings. Moreover, no code change is required. The disadvantages are that end-user localization is not usually possible, and changing language without restarting the application may be trickier. Microsoft applications, including Windows itself, use this technique. It will work with any Delphi libraries that stores strings into resources and dfms properly.
前者利用Windows资源支持,可以在启动应用程序时将资源加载重定向到存储在DLL中的另一个。优点是整个表格可以是本地化的,包括图像,颜色,控制尺寸等,而不仅仅是字符串。而且,不需要更改代码。缺点是最终用户本地化通常是不可能的,并且在不重新启动应用程序的情况下更改语言可能会更棘手。 Microsoft应用程序(包括Windows本身)使用此技术。它适用于任何Delphi库,它们可以正确地将字符串存储到资源和dfms中。
The latter stores strings in an external "database" (it could even be a text file...). The advantage is usually that users can add/modify translations, and switching language on the fly easier. The disadvantages are this technique is more intrusive (it has to hook string loading/display) and may require code changes, tools are usually limited to string localization and don't offer broader control (images, sizes, etc.), and may not work with unknown controls/libraries they could not hook correctly. Usually cross-platform application use this technique because Windows-like resource support is not available on all operating systems.
后者将字符串存储在外部“数据库”中(它甚至可以是文本文件......)。优点通常是用户可以添加/修改翻译,并且可以更轻松地切换语言。缺点是这种技术更具侵入性(它必须挂钩字符串加载/显示)并且可能需要更改代码,工具通常仅限于字符串本地化并且不提供更广泛的控制(图像,大小等),并且可能不会使用未知的控件/库,他们无法正确挂钩。通常,跨平台应用程序使用此技术,因为并非所有操作系统都支持类似Windows的资源支持。
You should choose the technique that suits you and your application best. Moreover some tools ease the collaboration with an external translator, while others don't. I prefer the resource-based approach because it doesn't require code changes and don't tie me to a given library.
您应该选择最适合您和您的应用的技术。此外,一些工具可以简化与外部翻译人员的协作,而其他工具则不然。我更喜欢基于资源的方法,因为它不需要更改代码,也不会将我绑定到给定的库。
#4
We are using dxgettext (GNUGettext for Delphi and C++ Builder) and Gorm (from the same author). Mind you, most tools require you to use English as the primary language and translate from that only. dxgettext allows other languages but there are bound to be unknown problems with that. Be prepared that internationalizing a large applicatin will be more work than you currently think.
我们使用dxgettext(用于Delphi和C ++ Builder的GNUGettext)和Gorm(来自同一作者)。请注意,大多数工具都要求您使用英语作为主要语言并仅从中进行翻译。 dxgettext允许使用其他语言,但必然存在未知问题。做好准备,将大型应用程序国际化将比您目前想象的更多。
#1
GetText should be able to do, search for "extract" at http://dxgettext.po.dk/documentation/how-to
GetText应该能够做到,在http://dxgettext.po.dk/documentation/how-to搜索“extract”
If all you need is to translate GUI and maybe resourcestring in sources, and the inline string constants in Pascal sources are not needed for translation, then you can try Delphi built-in method. However forums say that ITE is buggy. But at least that is official Delphi way.
如果您只需要在源代码中翻译GUI和可能的resourcestring,并且不需要Pascal源代码中的内联字符串常量进行翻译,那么您可以尝试使用Delphi内置方法。然而论坛说ITE是错误的。但至少那是德尔福官方的方式。
- http://edn.embarcadero.com/article/32974
- http://docwiki.embarcadero.com/RADStudio/en/Creating_Resource_DLLs
To translate sources with ITM manual preparation is needed as shown in source sheets at http://www.gunsmoker.ru/2010/06/delphi-ite-integrated-translation.html
要使用ITM手动准备翻译来源,如http://www.gunsmoker.ru/2010/06/delphi-ite-integrated-translation.html上的源表所示。
I remember i tranlsated Polaris texts for JediVCL team - so they did some extraction. But i think they just extracted all characters > #127 into a text file - there was no structure, there were constants and comments, all together.Still, there is some component, though i doubt it can be used the way you need: http://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvTranslator
我记得我为JediVCL团队传输了Polaris文本 - 所以他们做了一些提取。但我认为他们只是将所有字符>#127提取到文本文件中 - 没有结构,有常量和注释,都在一起。但是,有一些组件,但我怀疑它可以按照你需要的方式使用:http ://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvTranslator
There are also commercial tools. But i don't know if their features would help you on your initial extraction and translation tasks. They probably would be of much help when you need to mantain your large application translated to many languages, but not when you need to do one-time conversion. But maybe i am wrong, check their trial versions if you wish. By reviews those suites are considered among best of commercial ones:
还有商业工具。但我不知道他们的功能是否可以帮助您完成初始提取和翻译任务。当你需要保存翻译成多种语言的大型应用程序时,它们可能会有很大的帮助,但是当你需要进行一次性转换时则不然。但也许我错了,如果你愿意,请查看他们的试用版。通过评论,这些套房被认为是最好的商业套房:
- TsiLang Suite http://www.tsilang.com/?siteid2=7
- Korzh Localizer http://devtools.korzh.com/localization-delphi/
TsiLang Suite http://www.tsilang.com/?siteid2=7
Korzh Localizer http://devtools.korzh.com/localization-delphi/
#2
Firstly I'd recommend to move all localizable string constants into the resource string sections within their unit files. I.e.
首先,我建议将所有可本地化的字符串常量移动到其单元文件中的资源字符串部分。即
raise Exception.Create('Error: что-то пошло не так (in Russian language)');
will be converted to
将被转换为
resourcestring rsSomeErrorMessage = 'Error: что-то пошло не так (in Russian language)';...raise Exception.Create(rsSomeErrorMessage);
有关Resource Strings的更多信息。
This process can be accelerated by using the corespondent Delphi IDE refactoring command, or with third-party utilities like as ModelMaker Tools.
使用相应的Delphi IDE重构命令或第三方实用程序(如ModelMaker Tools)可以加速此过程。
Then you can use any available localizer to translate or even internationalize your program. I'd recommend my Delphi localizer - it's free.
然后,您可以使用任何可用的本地化程序来翻译甚至国际化您的程序。我推荐我的Delphi定位器 - 它是免费的。
#3
Basically, you have two ways
基本上,你有两种方法
- Resource-based localization tools (Delphi ITE, Multilizer, ecc.)
- Database-based localization tools (GetText, TsiLang, ecc.)
基于资源的本地化工具(Delphi ITE,Multilizer,ecc。)
基于数据库的本地化工具(GetText,TsiLang,ecc。)
The former takes advantage of the Windows resource support, resource loading can be redirected to a different one stored into a DLL when the application is started. The advantages are that whole forms can be localized, including images, colors, control sizes, etc. and not only strings. Moreover, no code change is required. The disadvantages are that end-user localization is not usually possible, and changing language without restarting the application may be trickier. Microsoft applications, including Windows itself, use this technique. It will work with any Delphi libraries that stores strings into resources and dfms properly.
前者利用Windows资源支持,可以在启动应用程序时将资源加载重定向到存储在DLL中的另一个。优点是整个表格可以是本地化的,包括图像,颜色,控制尺寸等,而不仅仅是字符串。而且,不需要更改代码。缺点是最终用户本地化通常是不可能的,并且在不重新启动应用程序的情况下更改语言可能会更棘手。 Microsoft应用程序(包括Windows本身)使用此技术。它适用于任何Delphi库,它们可以正确地将字符串存储到资源和dfms中。
The latter stores strings in an external "database" (it could even be a text file...). The advantage is usually that users can add/modify translations, and switching language on the fly easier. The disadvantages are this technique is more intrusive (it has to hook string loading/display) and may require code changes, tools are usually limited to string localization and don't offer broader control (images, sizes, etc.), and may not work with unknown controls/libraries they could not hook correctly. Usually cross-platform application use this technique because Windows-like resource support is not available on all operating systems.
后者将字符串存储在外部“数据库”中(它甚至可以是文本文件......)。优点通常是用户可以添加/修改翻译,并且可以更轻松地切换语言。缺点是这种技术更具侵入性(它必须挂钩字符串加载/显示)并且可能需要更改代码,工具通常仅限于字符串本地化并且不提供更广泛的控制(图像,大小等),并且可能不会使用未知的控件/库,他们无法正确挂钩。通常,跨平台应用程序使用此技术,因为并非所有操作系统都支持类似Windows的资源支持。
You should choose the technique that suits you and your application best. Moreover some tools ease the collaboration with an external translator, while others don't. I prefer the resource-based approach because it doesn't require code changes and don't tie me to a given library.
您应该选择最适合您和您的应用的技术。此外,一些工具可以简化与外部翻译人员的协作,而其他工具则不然。我更喜欢基于资源的方法,因为它不需要更改代码,也不会将我绑定到给定的库。
#4
We are using dxgettext (GNUGettext for Delphi and C++ Builder) and Gorm (from the same author). Mind you, most tools require you to use English as the primary language and translate from that only. dxgettext allows other languages but there are bound to be unknown problems with that. Be prepared that internationalizing a large applicatin will be more work than you currently think.
我们使用dxgettext(用于Delphi和C ++ Builder的GNUGettext)和Gorm(来自同一作者)。请注意,大多数工具都要求您使用英语作为主要语言并仅从中进行翻译。 dxgettext允许使用其他语言,但必然存在未知问题。做好准备,将大型应用程序国际化将比您目前想象的更多。