Changeset 447 for trunk/Packages/Common/UTranslator.pas
- Timestamp:
- May 19, 2022, 10:39:34 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UTranslator.pas
r424 r447 420 420 421 421 if Lang = '' then begin 422 for i:= 1 to Paramcount - 1 do423 if (ParamStr( i) = '--LANG') or (ParamStr(i) = '-l') or424 (ParamStr( i) = '--lang') then425 Lang := ParamStr( i+ 1);422 for I := 1 to Paramcount - 1 do 423 if (ParamStr(I) = '--LANG') or (ParamStr(I) = '-l') or 424 (ParamStr(I) = '--lang') then 425 Lang := ParamStr(I + 1); 426 426 end; 427 427 if Lang = '' then begin … … 473 473 DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt); 474 474 if FileExistsUTF8(Result) then 475 exit;475 Exit; 476 476 477 477 Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator + LangID + 478 478 DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt); 479 479 if FileExistsUTF8(Result) then 480 exit;480 Exit; 481 481 482 482 Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator 483 483 + LangID + DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt); 484 484 if FileExistsUTF8(Result) then 485 exit;485 Exit; 486 486 487 487 Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator … … 489 489 ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt); 490 490 if FileExistsUTF8(Result) then 491 exit;491 Exit; 492 492 493 493 {$IFDEF UNIX} … … 496 496 ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt); 497 497 if FileExistsUTF8(Result) then 498 exit;498 Exit; 499 499 {$ENDIF} 500 500 // Let us search for reducted files 501 LangShortID := copy(LangID, 1, 2);501 LangShortID := Copy(LangID, 1, 2); 502 502 // At first, check all was checked 503 503 Result := ExtractFilePath(ParamStrUTF8(0)) + LangShortID + 504 504 DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt); 505 505 if FileExistsUTF8(Result) then 506 exit;506 Exit; 507 507 508 508 Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator + … … 510 510 ExtractFileName(ParamStrUTF8(0)), LCExt); 511 511 if FileExistsUTF8(Result) then 512 exit;512 Exit; 513 513 514 514 Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator … … 516 516 ExtractFileName(ParamStrUTF8(0)), LCExt); 517 517 if FileExistsUTF8(Result) then 518 exit;518 Exit; 519 519 520 520 Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator … … 522 522 ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt); 523 523 if FileExistsUTF8(Result) then 524 exit;524 Exit; 525 525 526 526 // Full language in file name - this will be default for the project … … 529 529 Result := ExtractFilePath(ParamStrUTF8(0)) + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt; 530 530 if FileExistsUTF8(Result) then 531 exit;531 Exit; 532 532 // Common location (like in Lazarus) 533 533 Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator + 534 534 ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt; 535 535 if FileExistsUTF8(Result) then 536 exit;536 Exit; 537 537 538 538 Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + 539 539 DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt; 540 540 if FileExistsUTF8(Result) then 541 exit;541 Exit; 542 542 except 543 543 Result := ''; // Or do something else (useless) … … 548 548 ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt); 549 549 if FileExistsUTF8(Result) then 550 exit;550 Exit; 551 551 {$ENDIF} 552 552 Result := ExtractFilePath(ParamStrUTF8(0)) + ChangeFileExt( 553 553 ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt; 554 554 if FileExistsUTF8(Result) then 555 exit;555 Exit; 556 556 557 557 Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator + 558 558 ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt; 559 559 if FileExistsUTF8(Result) then 560 exit;560 Exit; 561 561 562 562 Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator + 563 563 ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt; 564 564 if FileExistsUTF8(Result) then 565 exit;565 Exit; 566 566 end; 567 567
Note:
See TracChangeset
for help on using the changeset viewer.