Skip to content
Dmitry Kann edited this page Dec 13, 2013 · 6 revisions

Wiki Page Index

DKLang Localization Package is a set of classes intended to simplify localization of applications written in Delphi.

This project expands DKLang Localization Package (http://yktoo.com/software/dklang) to work on all current (XE5) platforms: VCL (win32 & win64) & FireMonkey (win32, win64, OSX, Android, & iOS).

Features

  • Ease of use. Put a TDKLanguageController on the form, save the project (this will automatically create a language source file) and add a couple of lines to program code: you get a functional multilanguage application! See the included examples to learn the details.
  • Full integration with Delphi VCL component library. A possibility of automated change tracking in structure or properties of forms, frames, data modules etc., and owned components.
  • Complete Unicode support.
  • Storing property values for string properties. Storing property values of class TStrings, TCollection item properties and property values of TPersistent descendants. Only the properties recognized by the Delphi streaming mechanism as stored are processed to avoid storing excessive data.
  • A possibility for defining a set of string constants for a project. A constant is referred to by its name (binary name search is implemented). See the Constants example.
  • Storing translations in plain-text files, which can be edited with any text editor. However, there's a much more convenient tool available for creating the translations, DKLang Translation Editor.
  • Synchronous language switching in all displayed forms by changing the current language of global TDKLanguageManager instance.
  • Events fired in a non-visual component just before and after the language change.
  • A possibility for ignoring any properties, as well as a list of forcibly stored properties recognized as not stored. Both lists are formed using name masks (eg, *.Font.Name).
  • Automated saving the localization data for the whole project into a so-called language source file (a file having .dklang extension).
  • A possibility of using the localization mechanism when no visual forms are instantiated (for localizing constants only). A possibility of building the project with DKLang runtime package.
  • A thread-safe design allowing for proper functioning in multithreaded environment. This allows non-blocking data read access with a number of threads at once.

New Features

  • Added FireMonkey framework compatibility (all XE5 platforms)
  • Added Win64 VCL compatibility
  • Native language name lookup
  • New component ([TDKLTranslationsStorage]) for on-form storage of translations

DKLang vs ITE

What are the benefits of DKLang compared to Delphi's ITE (Integrated Translation Environment)?

  • DKLang is completely free. Moreover, DKLang is open-source so you always can see 'how the wind blows'.
  • DKLang is very lightweight and runtime-optimized. You always get predictable results as the implemented technology is obvious and transparent.
  • DKLang allows transparent language switching at any time while ITE relies on a resource DLL with predefined extension when loading the program and you cannot change the language further.
  • Applications using DKLang can consist of only the executable which includes any number of languages in its resource; it allows you to decide yourself which language should be included 'statically' and which ones are linked when the program runs. In contrast, ITE always requires that a DLL with predefined extension for each language resides in the program directory: this means you should redistribute all the language DLLs with each copy of the program.
  • Being open-source, you are free to extend the capabilities of DKLang. Join the community.
  • Language files are plain-text files so one can edit them with any text editor supporting Unicode. ITE uses only compiled resource DLLs prepared with using special Translation Manager.

Requirements

  • Version 5: Delphi XE5 or higher to support Win64 and the new FireMonkey platforms.
  • Version 4: Delphi 2009 or higher to support Unicode VCL. See the "DKLang_v4" branch for this release.

Caveats

While this release (v5) retains much of the original code, there have been [numerous changes](Revision History) and this release should be considered beta. While all of the code and examples have been compiled for all of the targeted platforms, the Android targets have not been tested on actual hardware.

License

The contents of this package are subject to the Mozilla Public License Version 1.1 (the License); you may not use this package except in compliance with the License.

Alternatively, you may redistribute this library, use and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Software distributed under the License is distributed on an as is basis, without warranty of any kind, either express or implied. See the License for the specific language governing rights and limitations under the License.

Developers