Changeset 79 for trunk/Packages/CoolTranslator/UCoolTranslator.pas
- Timestamp:
- Aug 2, 2016, 10:06:50 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CoolTranslator/UCoolTranslator.pas
r43 r79 46 46 procedure TranslateProperty(Component: TPersistent; PropInfo: PPropInfo); 47 47 function IsExcluded(Component: TPersistent; PropertyName: string): Boolean; 48 function GetLangFileDir: string; 48 49 public 49 50 ComponentExcludes: TComponentExcludesList; … … 161 162 if LocaleShort <> '' then SearchMask := SearchMask + '.' + LocaleShort; 162 163 SearchMask := SearchMask + '.po'; 163 FileList := FindAllFiles(ExtractFileDir(UTF8Encode(Application.ExeName)) + 164 DirectorySeparator + FPOFilesFolder, SearchMask); 164 FileList := FindAllFiles(GetLangFileDir, SearchMask); 165 165 for I := 0 to FileList.Count - 1 do begin 166 166 FileName := FileList[I]; … … 180 180 FPoFilesFolder := AValue; 181 181 ReloadFiles; 182 CheckLanguageFiles; 182 183 end; 183 184 … … 290 291 end; 291 292 293 function TCoolTranslator.GetLangFileDir: string; 294 begin 295 Result := FPOFilesFolder; 296 if Copy(Result, 1, 1) <> DirectorySeparator then 297 Result := ExtractFileDir(UTF8Encode(Application.ExeName)) + 298 DirectorySeparator + Result; 299 end; 300 292 301 procedure TCoolTranslator.LanguageListToStrings(Strings: TStrings); 293 302 var … … 349 358 var 350 359 I: Integer; 351 begin 360 LangDir: string; 361 begin 362 LangDir := GetLangFileDir; 352 363 TLanguage(Languages[0]).Available := True; // Automatic 353 364 354 365 for I := 1 to Languages.Count - 1 do 355 366 with TLanguage(Languages[I]) do begin 356 Available := FileExists(ExtractFileDir(UTF8Encode(Application.ExeName)) + 357 DirectorySeparator + POFilesFolder + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) + 367 Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) + 358 368 '.' + Code + ExtensionSeparator + 'po') or (Code = 'en'); 359 369 end;
Note:
See TracChangeset
for help on using the changeset viewer.