Recent

Author Topic: Can't get to work gnugettext  (Read 5172 times)

mamcx

  • New Member
  • *
  • Posts: 12
Can't get to work gnugettext
« on: April 06, 2010, 10:56:55 pm »
Related to http://stackoverflow.com/questions/2527259/cross-platform-tool-for-translating-and-internationalizing-delphi-freepascal-pr I'm triying to use gnugettext implementation on both Delphi & FPC.

The Delphi side work as spected, but I can't get to compile the unit in FCP 2.4/Lazarus last trunk/OSX Snow leopard.

I get several errors, (I download from http://wiki.lazarus.freepascal.org/DxGetText, both from SourceForge and the main site):

1. This conditional is bad (not compile under osx or other unixs):

{$ifndef MSWINDOWS}
{$ifndef LINUX}
  'This version of gnugettext.pas is only meant to be compiled with Kylix 3,'
  'Delphi 6, Delphi 7 and later versions. If you use other versions, please'
  'get the gnugettext.pas version from the Delphi 5 directory.'
{$endif}
{$endif}

Easy fix, not problem.

2. Then I get this:

Code: [Select]
procedure TranslateAllResourceStrings;
var I,J : Longint;
    S   : WideString;
begin
  {$ifdef DXGETTEXTDEBUG}
===>  DefaultInstance.DebugWriteln('TranslateAllResourceStrings (ResourceStringTableCount='+IntToStr(ResourceStringTableCount)+')');

Quote
gnugettext.pas(929,122) Error: Identifier not found "ResourceStringTableCount"
gnugettext.pas(937,29) Error: Identifier not found "SetResourceStringValue"
gnugettext.pas(1527,24) Error: Incompatible types: got "TStringList" expected "TCSStringList"

And

Code: [Select]
    for J:=0 to ResourceStringCount(i)-1 do
    begin
===>>      S:=DefaultInstance.gettext(GetResourceStringDefaultValue(I,J));

Quote
gnugettext.pas(936,63) Error: Identifier not found "GetResourceStringDefaultValue"

What I can do?

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 818
Re: Can't get to work gnugettext
« Reply #1 on: April 06, 2010, 11:06:38 pm »
All of the compilation errors you got, apart from ' Incompatible types: got "TStringList" expected "TCSStringList"', can be solved by compiling the file in Delphi or ObjFPC mode.

Furthermore, FPC itself also includes a gettext unit: http://www.freepascal.org/docs-html/fcl/gettext/index.html

A compiled version of this unit is included with every FPC installation.

 

TinyPortal © 2005-2018