On Thu, 12 Jul 2007 19:29:00 +0200
"A.J. Venter" <[EMAIL PROTECTED]> wrote:

> Hi all,
> I am trying to make OutKafe gettext translateable, using whatever code
> I can find for samples this is what my code now looks like:
> 
> -------
> uses
>   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
> ExtCtrls,Util,
>    StdCtrls, Buttons , gtkproc, TrayIcon, popupnotifier,
> Menus,liboutkafe,popupunit,
>    fileUtil,baseunix,unix, IpHtml, Ipfilebroker,gettext;
> 
> resourcestring
>      rsLoginDetails = 'Enter your login details to continue';
>      rsLoginName = 'Login Name';
>      rsPassword = 'Password';
>      rsLogin = 'Login';
> <snip>
> procedure OklinMainForm.Create;
> <snip>
> //LangPath is a const, it is set to /usr/share/outkafe/lang
> 
>     TranslateUnitResourceStrings('oklinmainunit',
> LANGPATH+PathDelim+'oklin.%s.po');
>       Label1.Caption := Utf8ToAnsi(rsLoginDetails);
>       Label2.Caption := Utf8ToAnsi(rsLoginName);
>       Label3.Caption := Utf8ToAnsi(rsPassword);
>       LoginBtn.Caption :=  Utf8ToAnsi(rsLogin)
> -------
> 
> So I compile it, which generates an oklinmainunit.rst file, I run
> rstconv -i oklinmainunit.rst -o oklin.po
> cp oklin.po oklin.af.po
> 
> I edit oklin.af.po and copy it to /usr/share/outkafe/lang
> I ALSO run msgfmt oklin.af.po -o oklin.af.mo
> And put that in there as WELL,
> 
> Then I run:
> LANG="af" ./oklin

You forgot the && or ;

LANG="af" ; ./oklin

And there are two TranslateUnitResourceStrings functions. The one with 4
parameters expects the file mask, the other a specific .po file.
If the file does not exist it returns false.

Try this:
  GetLanguageIDs(Lang,FallbackLang);
  TranslateUnitResourceStrings('oklinmainunit',
    LANGPATH+PathDelim+'oklin.%s.po',Lang,FallbackLang);

 
> But the program remains obstinately in English (no output in the
> console gives me any
> indication of why).
> 
> Can anybody give me an idea what I am doing wrong ?
> Why does the TranslateUnitResourceStrings function appear to have FOUR
> parameters in some calls (but not in the gettext unit) - is that
> alternative a better choice ? Where do I get it?


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to