Changeset 218 for trunk/Packages/Common/UTranslator.pas
- Timestamp:
- Jan 22, 2022, 4:21:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UTranslator.pas
r215 r218 75 75 procedure Register; 76 76 77 const 78 PoFileExt = '.po'; 79 77 80 78 81 implementation … … 170 173 try 171 174 LocaleShort := GetLocaleShort; 172 //ShowMessage(ExtractFileDir(Application.ExeName) +173 // DirectorySeparator + 'Languages' + ' ' + '*.' + LocaleShort + '.po');174 175 SearchMask := '*'; 175 176 if LocaleShort <> '' then SearchMask := SearchMask + '.' + LocaleShort; 176 SearchMask := SearchMask + '.po';177 SearchMask := SearchMask + PoFileExt; 177 178 FileList := FindAllFiles(GetLangFileDir, SearchMask); 178 179 for I := 0 to FileList.Count - 1 do begin 179 180 FileName := FileList[I]; 180 //FileName := FindLocaleFileName('.po');181 181 if FileExists(FileName) and ( 182 ((LocaleShort = '') and (Pos('.', FileName) = Pos( '.po', FileName))) or182 ((LocaleShort = '') and (Pos('.', FileName) = Pos(PoFileExt, FileName))) or 183 183 (LocaleShort <> '')) then FPoFiles.Add(TPOFile.Create(FileName)); 184 184 end; … … 245 245 I: Integer; 246 246 begin 247 248 247 // PropInfo^.Name; 249 248 // Using IsDefaultPropertyValue will tell us if we should write out … … 290 289 Item := Component.ClassType; 291 290 while Assigned(Item) do begin 292 //ShowMessage(Component.Name + ', ' + Component.ClassName + ', ' + Item.ClassName + ', ' + PropertyName);293 291 Excludes := ComponentExcludes.FindByClassType(Item.ClassType); 294 292 if Assigned(Excludes) then begin … … 305 303 begin 306 304 Result := FPoFilesFolder; 307 if Copy(Result, 1, 1) <> DirectorySeparator then 308 Result := ExtractFileDir(Application.ExeName) + 309 DirectorySeparator + Result; 305 if not FilenameIsAbsolute(Result) then 306 Result := ExtractFileDir(Application.ExeName) + DirectorySeparator + Result; 310 307 end; 311 308 … … 382 379 with Languages[I] do begin 383 380 Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) + 384 '.' + Code + ExtensionSeparator + 'po') or (Code = 'en');381 '.' + Code + PoFileExt) or (Code = 'en'); 385 382 end; 386 383 end; … … 471 468 472 469 begin 473 474 470 // ParamStrUTF8(0) is said not to work properly in linux, but I've tested it 475 471 Result := ExtractFilePath(ParamStrUTF8(0)) + LangID +
Note:
See TracChangeset
for help on using the changeset viewer.