Recent

Author Topic: Problem with translation  (Read 6241 times)

TErxleben

  • Newbie
  • Posts: 3
Problem with translation
« on: July 31, 2016, 06:39:27 pm »
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
Laz: 1.7/build: 52666M, FPC: 3.0.0, Basesystem: Debian/QT

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Problem with translation
« Reply #1 on: July 31, 2016, 07:28:34 pm »
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

  • Newbie
  • Posts: 3
Re: Problem with translation
« Reply #2 on: July 31, 2016, 11:28:53 pm »
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.
Laz: 1.7/build: 52666M, FPC: 3.0.0, Basesystem: Debian/QT

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Problem with translation
« Reply #3 on: July 31, 2016, 11:41:25 pm »
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  [Select][+][-]
  1. uses
  2.   translations;
  3. var
  4.   langdir: String;  // the "languages" directory containing your po files
  5.   lang: String;     // the abbreviation of the language to be translated to, e.g. "de"
  6. begin
  7.   ...
  8.   TranslateUnitResourceStrings('sdb_consts', langdir + 'sdb_consts.' + lang + '.po');
  9.  

TErxleben

  • Newbie
  • Posts: 3
Re: Problem with translation
« Reply #4 on: August 01, 2016, 12:04:06 pm »
Thank you wp.
That does the trick.
Laz: 1.7/build: 52666M, FPC: 3.0.0, Basesystem: Debian/QT

 

TinyPortal © 2005-2018