Changeset 154 for tags/1.4.0
- Timestamp:
- Jan 14, 2025, 12:35:35 PM (7 days ago)
- Location:
- tags/1.4.0
- Files:
-
- 2 deleted
- 9 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
tags/1.4.0
-
tags/1.4.0/Forms/UFormMain.lfm
r137 r154 15 15 OnKeyUp = FormKeyUp 16 16 OnShow = FormShow 17 LCLVersion = ' 2.2.6.0'17 LCLVersion = '3.6.0.0' 18 18 object PaintBox1: TPaintBox 19 19 Left = 0 -
tags/1.4.0/Forms/UFormMain.pas
r134 r154 63 63 64 64 procedure TFormMain.FormCreate(Sender: TObject); 65 {$IFDEF UNIX} 65 66 const 66 UnixLanguagesDir = '/usr/share/TransLines/languages'; 67 begin 67 UnixLanguagesDir = '../share/TransLines'; 68 var 69 NewDir: string; 70 {$ENDIF} 71 const 72 LanguagesDirName = 'Languages'; 73 var 74 BaseDir: string; 75 begin 76 BaseDir := ExcludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0))); 77 Core.Translator1.POFilesFolder := BaseDir + DirectorySeparator + LanguagesDirName; 78 68 79 {$IFDEF UNIX} 69 80 // If installed in UNIX system then use installation directory for po files 70 if not DirectoryExists(Core.Translator1.POFilesFolder) and DirectoryExists(UnixLanguagesDir) then 71 Core.Translator1.POFilesFolder := UnixLanguagesDir; 81 NewDir := BaseDir + DirectorySeparator + UnixLanguagesDir + DirectorySeparator + 82 LanguagesDirName; 83 if not DirectoryExists(Core.Translator1.POFilesFolder) and DirectoryExists(NewDir) then 84 Core.Translator1.POFilesFolder := NewDir; 72 85 {$ENDIF} 73 86 -
tags/1.4.0/Install/deb/TransLines.desktop
r125 r154 7 7 Terminal=false 8 8 Type=Application 9 Categories=G NOME;Application;Game;9 Categories=Game;Simulation 10 10 StartupNotify=true 11 Keywords=metro;subway;transport;map;transit;simulation;passengers -
tags/1.4.0/Install/deb/debian/rules
r125 r154 14 14 15 15 override_dh_auto_install: 16 install -d -m 755 $(ROOT)/usr/bin 17 install -s -m 755 TransLines $(ROOT)/usr/bin 18 install -d -m 755 $(ROOT)/usr/share/applications 19 install -m 755 Install/deb/TransLines.desktop $(ROOT)/usr/share/applications 20 install -d -m 755 $(ROOT)/usr/share/pixmaps 21 install -m 644 Images/64x64/TransLines.png $(ROOT)/usr/share/pixmaps 22 install -d -m 755 $(ROOT)/usr/share/TransLines/languages 23 install -m 755 Languages/*.pot $(ROOT)/usr/share/TransLines/languages 24 install -m 755 Languages/*.po $(ROOT)/usr/share/TransLines/languages 16 install -Dm755 TransLines -t $(ROOT)/usr/bin 17 install -Dm644 Install/deb/TransLines.desktop -t $(ROOT)/usr/share/applications 18 install -Dm644 Images/64x64/TransLines.png -t $(ROOT)/usr/share/pixmaps 19 install -Dm644 Languages/*.po -t $(ROOT)/usr/share/TransLines/Languages 20 install -Dm644 Packages/Common/Languages/*.po -t $(ROOT)/usr/share/TransLines/Languages 25 21 26 22 %: -
tags/1.4.0/Install/flatpak/build.sh
r146 r154 7 7 8 8 # Install dependencies 9 flatpak install --system flathub org.kde.Sdk//5.15-2 3.0810 flatpak install --system flathub org.kde.Platform//5.15-2 3.0811 flatpak install --system flathub org.freedesktop.Sdk.Extension.freepascal//2 3.089 flatpak install --system flathub org.kde.Sdk//5.15-24.08 10 flatpak install --system flathub org.kde.Platform//5.15-24.08 11 flatpak install --system flathub org.freedesktop.Sdk.Extension.freepascal//24.08 12 12 flatpak install --system flathub org.flatpak.Builder 13 13 -
tags/1.4.0/Install/flatpak/net.zdechov.app.TransLines.yml
r149 r154 1 1 app-id: net.zdechov.app.TransLines 2 2 runtime: org.kde.Platform 3 runtime-version: '5.15-2 3.08'3 runtime-version: '5.15-24.08' 4 4 sdk: org.kde.Sdk 5 5 sdk-extensions: 6 6 - org.freedesktop.Sdk.Extension.freepascal 7 7 command: TransLines 8 rename-icon: TransLines 9 rename-desktop-file: TransLines.desktop 8 10 finish-args: 9 11 - --share=ipc … … 26 28 - type: svn 27 29 url: https://svn.zdechov.net/translines/tags/1.4.0 28 revision: r1 4930 revision: r154 29 31 buildsystem: simple 30 32 build-commands: … … 32 34 . /usr/lib/sdk/freepascal/enable.sh 33 35 lazbuild --build-mode=Release --ws=qt5 TransLines.lpi 34 - install -Dm755 TransLines -t $FLATPAK_DEST/share/TransLines 35 - install -d $FLATPAK_DEST/bin 36 - ln -s $FLATPAK_DEST/share/TransLines/TransLines $FLATPAK_DEST/bin/TransLines 37 - install -Dm644 Install/flatpak/${FLATPAK_ID}.desktop -t $FLATPAK_DEST/share/applications 38 - install -Dm644 Images/256x256/TransLines.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png 36 - install -Dm755 TransLines -t $FLATPAK_DEST/bin 37 - install -Dm644 Install/deb/TransLines.desktop -t $FLATPAK_DEST/share/applications 38 - install -Dm644 Images/256x256/TransLines.png -t $FLATPAK_DEST/share/icons/hicolor/256x256/apps 39 39 - install -Dm644 Languages/*.po -t $FLATPAK_DEST/share/TransLines/Languages 40 - install -Dm644 Install/flatpak/${FLATPAK_ID}.appdata.xml $FLATPAK_DEST/share/metainfo/${FLATPAK_ID}.metainfo.xml 40 - install -Dm644 Packages/Common/Languages/*.po -t $FLATPAK_DEST/share/TransLines/Languages 41 - install -Dm644 Install/flatpak/${FLATPAK_ID}.metainfo.xml -t $FLATPAK_DEST/share/metainfo -
tags/1.4.0/Packages/Common/UTranslator.pas
r86 r154 48 48 procedure TranslateProperty(Component: TPersistent; PropInfo: PPropInfo); 49 49 function IsExcluded(Component: TPersistent; PropertyName: string): Boolean; 50 function GetLangFileDir : string;50 function GetLangFileDirs: TStrings; 51 51 public 52 52 ComponentExcludes: TComponentExcludesList; … … 71 71 end; 72 72 73 const 74 PoExt = '.po'; 75 73 76 procedure Register; 74 77 75 78 76 79 implementation 80 81 uses 82 Common; 77 83 78 84 procedure Register; … … 161 167 FileList: TStringList; 162 168 I: Integer; 169 J: Integer; 163 170 LocaleShort: string; 164 171 SearchMask: string; 172 LangDirs: TStrings; 165 173 begin 166 174 FPoFiles.Clear; 167 if Assigned(FLanguage) then 168 try 175 if Assigned(FLanguage) then begin 169 176 LocaleShort := GetLocaleShort; 170 //ShowMessage(ExtractFileDir(Application.ExeName) +171 // DirectorySeparator + 'Languages' + ' ' + '*.' + LocaleShort + '.po');172 177 SearchMask := '*'; 173 178 if LocaleShort <> '' then SearchMask := SearchMask + '.' + LocaleShort; 174 SearchMask := SearchMask + '.po'; 175 FileList := FindAllFiles(GetLangFileDir, SearchMask); 176 for I := 0 to FileList.Count - 1 do begin 177 FileName := FileList[I]; 178 //FileName := FindLocaleFileName('.po'); 179 if FileExists(FileName) and ( 180 ((LocaleShort = '') and (Pos('.', FileName) = Pos('.po', FileName))) or 181 (LocaleShort <> '')) then FPoFiles.Add(TPOFile.Create(FileName)); 182 end; 183 finally 184 FileList.Free; 179 SearchMask := SearchMask + PoExt; 180 LangDirs := GetLangFileDirs; 181 for J := 0 to LangDirs.Count - 1 do begin 182 FileList := FindAllFiles(LangDirs[J], SearchMask); 183 try 184 for I := 0 to FileList.Count - 1 do begin 185 FileName := FileList[I]; 186 //FileName := FindLocaleFileName('.po'); 187 if FileExists(FileName) and ( 188 ((LocaleShort = '') and (Pos('.', FileName) = Pos(PoExt, FileName))) or 189 (LocaleShort <> '')) then FPoFiles.Add(TPOFile.Create(FileName)); 190 end; 191 finally 192 FileList.Free; 193 end; 194 end; 195 LangDirs.Free; 185 196 end; 186 197 end; … … 299 310 end; 300 311 301 function TTranslator.GetLangFileDir: string; 302 begin 303 Result := FPoFilesFolder; 304 if Copy(Result, 1, 1) <> DirectorySeparator then 305 Result := ExtractFileDir(Application.ExeName) + 306 DirectorySeparator + Result; 312 function TTranslator.GetLangFileDirs: TStrings; 313 var 314 I: Integer; 315 begin 316 Result := TStringList.Create; 317 Result.Delimiter := ';'; 318 Result.StrictDelimiter := True; 319 Result.DelimitedText := FPoFilesFolder; 320 321 for I := 0 to Result.Count - 1 do begin 322 Result[I] := StringReplace(Result[I], '/', DirectorySeparator, [rfReplaceAll]); 323 Result[I] := StringReplace(Result[I], '\', DirectorySeparator, [rfReplaceAll]); 324 if (Copy(Result[I], 1, 1) <> DirectorySeparator) and (Copy(Result[I], 2, 2) <> ':\') then 325 Result[I] := ExtractFileDir(Application.ExeName) + 326 DirectorySeparator + Result[I]; 327 end; 307 328 end; 308 329 … … 371 392 var 372 393 I: Integer; 373 LangDir: string; 374 begin 375 LangDir := GetLangFileDir; 394 J: Integer; 395 LangDirs: TStrings; 396 begin 397 LangDirs := GetLangFileDirs; 376 398 Languages.SearchByCode('').Available := True; // Automatic 377 399 378 400 for I := 1 to Languages.Count - 1 do 379 401 with Languages[I] do begin 380 Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) + 381 '.' + Code + ExtensionSeparator + 'po') or (Code = 'en'); 382 end; 402 for J := 0 to LangDirs.Count - 1 do begin 403 if FileExists(LangDirs[J] + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) + 404 '.' + Code + PoExt) or (Code = 'en') then begin 405 Available := True; 406 Continue; 407 end; 408 end; 409 end; 410 LangDirs.Free; 383 411 end; 384 412 … … 569 597 end; 570 598 571 572 599 end. 573 -
tags/1.4.0/UMenu.pas
r130 r154 224 224 225 225 X := (CanvasSize.X - TotalWidth) div 2; 226 if X < 5 then X := 5; 226 227 Y := (CanvasSize.Y - TotalHeight) div 2; 228 if Y < 5 then Y := 5; 227 229 228 230 // Menu items
Note:
See TracChangeset
for help on using the changeset viewer.