IDE: Offering a link to an online page

Everything else that doesn't fall into one of the other PB categories.
AZJIO
Addict
Addict
Posts: 2155
Joined: Sun May 14, 2017 1:48 am

IDE: Offering a link to an online page

Post 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)
AZJIO
Addict
Addict
Posts: 2155
Joined: Sun May 14, 2017 1:48 am

Re: IDE: Offering a link to an online page

Post 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)
Post Reply