-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Dutch translations 2021-12-22 #1455
Update Dutch translations 2021-12-22 #1455
Conversation
Did you already consider to update these references too? |
I used a script to get the Classics strings for the new custom messages in Languages.iss. If you improve these strings in Languages.iss, then the referenced Classic strings can receive the improvements as well. AutoIt3 script for getting Classic strings for Languages.issGlobal $aTargets[5][2] = [ _
['3690', 'AddSandboxedBrowser'], _ ; Add desktop shortcut for starting Web browser under Sandboxie
['8021', 'SandboxieStartMenu1'], _ ; Run any program sandboxed
['8025', 'SandboxieStartMenu2'], _ ; Run Web browser sandboxed
['8023', 'SandboxieStartMenu3'], _ ; Sandboxie Start Menu
['3698', 'SandboxedBrowser']] ; Sandboxed Web Browser
; Change working directory.
If Not FileChangeDir('Sandboxie\Sandboxie\msgs') Then
ConsoleWrite('Failed to change directory' & @CRLF)
Exit 1
EndIf
; English file to process first.
$sEnglishFile = 'Sbie-English-1033.txt'
; Get the search handle of the language files.
$hFind = FileFindFirstFile('Text-*-*.txt')
While 1
; Get language name and language code from the filename.
If $sEnglishFile Then
$sFound = $sEnglishFile
$sEnglishFile = ''
If Not FileExists($sFound) Then
ContinueLoop
EndIf
$sLangName = 'English'
$sLangCode = '1033'
Else
$sFound = FileFindNextFile($hFind)
If @error Then ExitLoop
$aID = StringRegExp($sFound, '(?i)Text-(\w+)-(\d+)\.txt', 3)
If @error Then ContinueLoop
$sLangName = $aID[0]
$sLangCode = $aID[1]
EndIf
; Modify language names.
Switch $sLangName
Case 'tradchinese'
$sLangName = 'ChineseTraditional'
Case 'simpchinese'
$sLangName = 'ChineseSimplified'
Case 'Portuguese'
$sLangName = 'PortugueseMain'
Case 'PortugueseBr'
$sLangName = 'Portuguese'
EndSwitch
; Read language file.
$sContent = FileRead($sFound)
; Open languages.txt for write.
$hFile = FileOpen(@ScriptDir & '\languages.txt', 0x1 + FileGetEncoding($sFound))
If $hFile = -1 Then
ContinueLoop
EndIf
; Write language name as a comment line.
FileWriteLine($hFile, '; ' & $sLangName)
; Get the strings and write to file.
For $i1 = 0 To UBound($aTargets) - 1
$sPattern = '(?m)^' & $aTargets[$i1][0] & ';\w+;\d+\R(.*?)\R\.\R'
$aStrings = StringRegExp($sContent, $sPattern, 3)
If @error Then
ConsoleWrite($sLangName & ' Target: "' & $i1 & '" Error:' & @error & @CRLF)
ContinueLoop
EndIf
$sString = StringStripWS($aStrings[0], 3)
$sString = StringRegExpReplace($sString, '\.lnk$', '')
$sOutput = StringFormat('%s.%s=%s', StringLower($sLangName), $aTargets[$i1][1], $sString)
FileWriteLine($hFile, $sOutput & @CRLF)
Next
; Write an empty line as a separator and then close the file.
FileWriteLine($hFile, @CRLF)
FileClose($hFile)
WEnd
; Close the search handle.
FileClose($hFind) This script gets all of the strings specified at the top of the script from the Classic language files. It writes them so the languages of interest can basically be copied into Languages.iss as is. |
@isaak654 @mpheath @mpheath does this mean that I don't need to update the Languages.iss file any more? That would be good news, because right now I'm keeping the Sandboxie Plus and Classic language files up to date with Transifex. However, the Languages.iss isn't compatible with Transifex... 😅 |
Update Dutch translations according to English source file updates