Page 1 of 1
IDE: Offering a link to an online page
Posted: Sat Oct 05, 2024 8:47 pm
by AZJIO
Suggestion: on each page make a link to the original online page. Then, firstly, the user will notice the difference with the latest original help, regardless of the version of PureBasic and the translation language. Secondly, it can compare the quality of the translation if the text seems incomprehensible in the native language.
// Moved from "Bugs - IDE" to "General Discussion" (Kiffi)
Re: IDE: Offering a link to an online page
Posted: Sun Oct 06, 2024 5:25 pm
by AZJIO
You can see what it looks like:
Download (Ru):
upload.ee,
yandex
Download (En):
upload.ee
I replaced <body> with
Code: Select all
<body>
<a target="_blank" href="https://www.purebasic.com/documentation/reference/prototypes.html"><img title="online" src="../link.png" border="0" align="left"></a>
I used AutoIt3 script (I had ready-made scripts, so it was easier to edit the finished ones)
Code: Select all
#include <FileOperations.au3>
$sPath = @ScriptDir
$iCount = 0
$aFileList = _FO_FileSearch($sPath, '*.html', True, 1, 0)
For $i = 1 To $aFileList[0]
$sText = FileRead($sPath & '\' & $aFileList[$i])
; $sText = StringReplace($sText, '<body>', '<body>' & @CRLF & '<a target="_blank" href="https://www.purebasic.com/documentation/' & StringReplace(StringLower($aFileList[$i]), '\', '/') & '"><img title="online" src="../link.png" border="0" align="left"></a>', 1) ; replace by adding a link
$sText = StringRegExpReplace($sText, '<body.+?>', '\0' & @CRLF & '<a target="_blank" href="https://www.purebasic.com/documentation/' & StringReplace(StringLower($aFileList[$i]), '\', '/') & '"><img title="online" src="../link.png" border="0" align="left"></a>', 1) ; replace by adding a link
If @extended Then
$iCount += 1
$hFile = FileOpen($sPath & '\' & $aFileList[$i], 2)
FileWrite($hFile, $sText)
FileClose($hFile)
EndIf
Next
MsgBox(0, 'Done', 'Replacements: ' & $iCount, 5)