Skip to content

Commit

Permalink
utranslation, small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
riderkick committed Jun 14, 2015
1 parent 7c1e41d commit bb9ed7f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions baseunits/utranslation.pas
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ interface
LResources, Forms;

type
TPoLanguage = record
TLanguageItem = record
id: String;
name: String;
end;

TPoLanguages = array of TPoLanguage;
TLanguageCollection = array of TLanguageItem;

const
Lang_english: array[0..184] of array[0..1] of string = (
Expand Down Expand Up @@ -915,17 +915,16 @@ function SetLang(lang: string; appname: string): Boolean;
else
appname := ExtractFileNameOnly(ParamStrUTF8(0));
end;

//po file
lfile := LangDir + PathDelim + appname + '.' + lang;
if FileExistsUTF8(lfile + '.po') then

if FileExistsUTF8(lfile + '.po') then //po file
begin
lfile := lfile + '.po';
TranslateResourceStrings(lfile);
Translations.TranslateResourceStrings(lfile);
ltrans := TPOTranslator.Create(lfile);
end
//mo file
else if FileExistsUTF8(lfile + '.mo') then
else
if FileExistsUTF8(lfile + '.mo') then //mo file
begin
lfile := lfile + '.mo';
gettext.TranslateResourceStrings(lfile);
Expand All @@ -941,9 +940,9 @@ function SetLang(lang: string; appname: string): Boolean;
LRSTranslator := ltrans;
for i := 0 to Screen.CustomFormCount-1 do
ltrans.UpdateTranslation(Screen.CustomForms[i]);
LastSelected := lang;
Result := True;
end;
LastSelected := lang;
Result := True;
end;
end;

Expand Down

0 comments on commit bb9ed7f

Please sign in to comment.