From 4ec072ed3a2470f9182ab2cb7c312bd90e907bcd Mon Sep 17 00:00:00 2001 From: Bruno Date: Tue, 19 Nov 2024 10:57:38 -0300 Subject: [PATCH 1/2] build/windows: Integrate Official langs download with 'iso_639_custom.xml' --- build/windows/installer/3_dist-gimp-inno.ps1 | 42 +++++++++++--------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/build/windows/installer/3_dist-gimp-inno.ps1 b/build/windows/installer/3_dist-gimp-inno.ps1 index 2b70fb0e989..b81075df8dc 100644 --- a/build/windows/installer/3_dist-gimp-inno.ps1 +++ b/build/windows/installer/3_dist-gimp-inno.ps1 @@ -102,29 +102,34 @@ if (-not (Test-Path "$BUILD_DIR\build\windows\installer")) exit 1 } -## Download Official translations not present in a Inno release yet -#Write-Output "(INFO): downloading Official Inno lang files (not present in a release yet)" -#function download_lang_official ([string]$langfile) -#{ -# Invoke-WebRequest https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/$langfile -OutFile "$INNO_PATH\Languages\$langfile" -#} - -## Download unofficial translations (of unknown quality and maintenance) +## Complete Inno source with not released translations ## Cf. https://jrsoftware.org/files/istrans/ -Write-Output "(INFO): temporarily installing unofficial Inno lang files" -New-Item "$INNO_PATH\Languages\Unofficial\" -ItemType Directory -Force | Out-Null +Write-Output "(INFO): temporarily installing additional Inno lang files" $xmlObject = New-Object XML $xmlObject.Load("$PWD\build\windows\installer\lang\iso_639_custom.xml") -$langsArray = $xmlObject.iso_639_entries.iso_639_entry | - Select-Object -ExpandProperty inno_code | Where-Object { $_ -like "*Unofficial*" } -foreach ($langfile in $langsArray) - { - $langfileUnix = $langfile.Replace('\\', '/') - Invoke-WebRequest https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/$langfileUnix -OutFile "$INNO_PATH\$langfile" - } +function download_langs ([array]$langsArray) +{ + foreach ($langfile in $langsArray) + { + if ($langfile -ne '' -and -not (Test-Path "$INNO_PATH\$langfile" -Type Leaf)) + { + $langfileUnix = $langfile.Replace('\\', '/') + Invoke-WebRequest https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/$langfileUnix -OutFile "$INNO_PATH\$langfile" + } + } +} +### Official translations not present in a Inno release yet +$langsArray_Official = $xmlObject.iso_639_entries.iso_639_entry | Select-Object -ExpandProperty inno_code | + Where-Object { $_ -like "*Languages*" } | Where-Object { $_ -notlike "*Unofficial*" } +download_langs $langsArray_Official +### unofficial translations (of unknown quality and maintenance) +New-Item "$INNO_PATH\Languages\Unofficial" -ItemType Directory -Force | Out-Null +$langsArray_unofficial = $xmlObject.iso_639_entries.iso_639_entry | Select-Object -ExpandProperty inno_code | + Where-Object { $_ -like "*Unofficial*" } +download_langs $langsArray_unofficial ## Patch 'AppVer*' against Inno pervasive behavior: https://groups.google.com/g/innosetup/c/w0sebw5YAeg -Write-Output "(INFO): temporarily patching Official and unofficial Inno lang files with $CUSTOM_GIMP_VERSION" +Write-Output "(INFO): temporarily patching all Inno lang files with $CUSTOM_GIMP_VERSION" function fix_msg ([string]$langsdir, [string]$AppVer) { $langsArray_local = Get-ChildItem $langsdir -Filter *.isl -Name @@ -207,6 +212,7 @@ foreach ($bundle in $supported_archs) fix_msg "$INNO_PATH" revert fix_msg "$INNO_PATH\Languages" revert fix_msg "$INNO_PATH\Languages\Unofficial" revert +### We delete only unofficial langs because the downloaded official ones will be kept by Inno updates Remove-Item "$INNO_PATH\Languages\Unofficial" -Recurse -Force -- GitLab From 0a9ba4491e9963c8eb192f1d13b78e90fce062e7 Mon Sep 17 00:00:00 2001 From: Bruno Date: Tue, 19 Nov 2024 20:13:51 -0300 Subject: [PATCH 2/2] build/windows: Distribute installer localized with not released Tamil lang https://github.com/jrsoftware/issrc/commit/fa2b2b710f37cb26f50e9fa5ca725ff5d0de5dc7 --- build/windows/installer/lang/iso_639_custom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/windows/installer/lang/iso_639_custom.xml b/build/windows/installer/lang/iso_639_custom.xml index 7372c3712e0..84f4cbce903 100644 --- a/build/windows/installer/lang/iso_639_custom.xml +++ b/build/windows/installer/lang/iso_639_custom.xml @@ -316,7 +316,7 @@ To fill data for a new entry: name="Svenska" />