Hi Lainz,
thanks for the help but can't seem to get it to work (or at least not sure how I test it if it is working as I'm just seeing the default english values);
I've got two PO files (default Eng with only a ".po" extension and a German one with a ".de.po" file suffix) in the subfolder "other/languages" - the PO file setup function below is just a generic way of passing the path and filename of the file to be loaded (I'd hope to use the same code frequently for other applications and I'd just have to copy function this without any further amendments).
..., Translations, LCLProc;
{$R *.res}
procedure TranslateLCL;
var
PODirectory, POFile, Lang, FallbackLang: String;
begin
PODirectory := 'other/languages/';
POFile := PODirectory+ChangeFileExt(ExtractFileName(Application.ExeName),'.')+'%s.po';
Lang:='de';
FallbackLang:='';
// LCLGetLanguageIDs(Lang,FallbackLang);
Translations.TranslateUnitResourceStrings('EngLangRes', POFile, Lang, FallbackLang);
end;
begin
TranslateLCL;
...
"EngLasRes.pas" is a unit with all the resource strings in it.
I assumed if I change the Lang variable to "de" as per the above this is how I could test it but I still get English resources displayed.
Conversely by changing the DefaultTranslator.pas to accept the other\languages sub-folder and setting the params in the runtime to "--lang de" (and therefore not requiring the above) it appears to work fine - so not sure why the above doesn't seem to work.
The Black Sheep