Forum > Translations

Problem with translation

(1/1)

TErxleben:
Hi folks,

i'm working with i18n first Time.
With Support of the Wiki, i did following steps:

1. Activate i18n in Projectsettings.
2. Create Dir languages at Exe-Level.
3. Add DefaultTranslator to uses in Mainform.
3. Copy relevant .po-Files in languages (expecially sdb_consts from component dbexport)

So my Project translates my own Projectfiles fine. But Strings from package dbexport are still in default-english.

What i'm doing wrong? Any Ideas?

I'm using Laz 1.7/build 52666M, FPC 3.0.0

wp:
Copy these files to your languages directory. The language files of dbexport are in (lazarus)/componens/dbexport/languages. You'll probably also need the lclstrconsts in (lazarus)/lcl/languages.

TErxleben:
Thx for reply,

1. All required .po-Files allready copied into local project languages-dir.
2. I am working in Linux-Env, but testing against Win (in VM) shows the same problem.

wp:
Ah! And you must manually translate the dbexport strings because the DefaultTranslator only takes care of the project's po file and the lclstrconsts.po:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses  translations;var  langdir: String;  // the "languages" directory containing your po files  lang: String;     // the abbreviation of the language to be translated to, e.g. "de"begin  ...  TranslateUnitResourceStrings('sdb_consts', langdir + 'sdb_consts.' + lang + '.po'); 

TErxleben:
Thank you wp.
That does the trick.

Navigation

[0] Message Index

Go to full version