Issue #811: Make each language a component for the Installer

In the process, make the Installer localization process less 'masochist'
(in other words: less manual). The custom '.xml' was the only way since
the iso-codes, Dammed Lies and Inno namings don't match.
This commit is contained in:
Bruno Lopes 2024-03-15 18:51:48 -03:00 committed by Bruno
parent 0be5db0b77
commit 21ffb58903
No known key found for this signature in database
6 changed files with 477 additions and 96 deletions

View File

@ -74,35 +74,21 @@ function download_lang_official ([string]$langfile)
#New-Item -ItemType Directory -Path "$INNOPATH/Languages/" -Force
# Download Unofficial translations (of unknown quality and maintenance)
# Cf. https://jrsoftware.org/files/istrans/
function download_lang ([string]$langfile)
{
if (Test-Path -Path "$langfile" -PathType Leaf)
{
Remove-Item -Path "$langfile" -Force
}
Invoke-WebRequest -URI "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/${langfile}" -OutFile "$INNOPATH/Languages/Unofficial/${langfile}"
}
New-Item -ItemType Directory -Path "$INNOPATH/Languages/Unofficial/" -Force
download_lang Basque.isl
download_lang Belarusian.isl
download_lang ChineseSimplified.isl
download_lang ChineseTraditional.isl
download_lang EnglishBritish.isl
download_lang Esperanto.isl
download_lang Galician.isl
download_lang Georgian.isl
download_lang Greek.isl
download_lang Indonesian.isl
download_lang Latvian.isl
download_lang Lithuanian.isl
download_lang Malaysian.isl
download_lang Marathi.islu
download_lang Romanian.isl
download_lang Swedish.isl
download_lang Vietnamese.isl
$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 -URI "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/$langfileUnix" -OutFile "$INNOPATH/$langfileUnix"
}
$gen_path = Resolve-Path -Path "_build-*\build\windows\installer" | Select-Object -ExpandProperty Path
@ -110,6 +96,7 @@ if (Test-Path -Path $gen_path)
{
# Copy generated language files into the source directory
Copy-Item $gen_path\lang\*isl build\windows\installer\lang\
Copy-Item $gen_path\*list build\windows\installer\
# Copy generated images into the source directory
Copy-Item $gen_path\*bmp build\windows\installer\

View File

@ -217,50 +217,7 @@ UninstallFilesDir={app}\uninst
[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl,lang\en.setup.isl"
Name: "be"; MessagesFile: "compiler:Languages\Unofficial\Belarusian.isl,lang\be.setup.isl"
Name: "bg"; MessagesFile: "compiler:Languages\Bulgarian.isl,lang\bg.setup.isl"
Name: "ca"; MessagesFile: "compiler:Languages\Catalan.isl,lang\ca.setup.isl"
Name: "cs"; MessagesFile: "compiler:Languages\Czech.isl,lang\cs.setup.isl"
Name: "da"; MessagesFile: "compiler:Languages\Danish.isl,lang\da.setup.isl"
Name: "de"; MessagesFile: "compiler:Languages\German.isl,lang\de.setup.isl"
Name: "el"; MessagesFile: "compiler:Languages\Unofficial\Greek.isl,lang\el.setup.isl"
Name: "en_GB"; MessagesFile: "compiler:Languages\Unofficial\EnglishBritish.isl,lang\en_GB.setup.isl"
Name: "eo"; MessagesFile: "compiler:Languages\Unofficial\Esperanto.isl,lang\eo.setup.isl"
Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl,lang\es.setup.isl"
Name: "eu"; MessagesFile: "compiler:Languages\Unofficial\Basque.isl,lang\eu.setup.isl"
Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl,lang\fi.setup.isl"
Name: "fr"; MessagesFile: "compiler:Languages\French.isl,lang\fr.setup.isl"
Name: "gl"; MessagesFile: "compiler:Languages\Unofficial\Galician.isl,lang\gl.setup.isl"
Name: "he"; MessagesFile: "compiler:Languages\Hebrew.isl,lang\he.setup.isl"
Name: "hu"; MessagesFile: "compiler:Languages\Hungarian.isl,lang\hu.setup.isl"
;Name: "hr"; MessagesFile: "compiler:Languages\Unofficial\Croatian.isl,lang\hr.setup.isl"
Name: "id"; MessagesFile: "compiler:Languages\Unofficial\Indonesian.isl,lang\id.setup.isl"
Name: "is"; MessagesFile: "compiler:Languages\Icelandic.isl,lang\is.setup.isl"
Name: "it"; MessagesFile: "compiler:Languages\Italian.isl,lang\it.setup.isl"
Name: "ja"; MessagesFile: "compiler:Languages\Japanese.isl,lang\ja.setup.isl"
Name: "ka"; MessagesFile: "compiler:Languages\Unofficial\Georgian.isl,lang\ka.setup.isl"
Name: "kab"; MessagesFile: "compiler:Default.isl,lang\kab.isl,lang\kab.setup.isl"
Name: "ko"; MessagesFile: "compiler:Languages\Korean.isl,lang\ko.setup.isl"
Name: "lt"; MessagesFile: "compiler:Languages\Unofficial\Lithuanian.isl,lang\lt.setup.isl"
Name: "lv"; MessagesFile: "compiler:Languages\Unofficial\Latvian.isl,lang\lv.setup.isl"
Name: "mr"; MessagesFile: "compiler:Languages\Unofficial\Marathi.islu,lang\mr.setup.isl"
Name: "ms"; MessagesFile: "compiler:Languages\Unofficial\Malaysian.isl,lang\ms.setup.isl"
Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl,lang\nl.setup.isl"
Name: "nn"; MessagesFile: "compiler:Languages\Norwegian.isl,lang\nn.setup.isl"
Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl,lang\pl.setup.isl"
Name: "pt"; MessagesFile: "compiler:Languages\Portuguese.isl,lang\pt.setup.isl"
Name: "pt_BR"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl,lang\pt_BR.setup.isl"
Name: "ro"; MessagesFile: "compiler:Languages\Unofficial\Romanian.isl,lang\ro.setup.isl"
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl,lang\ru.setup.isl"
Name: "sk"; MessagesFile: "compiler:Languages\Slovak.isl,lang\sk.setup.isl"
Name: "sl"; MessagesFile: "compiler:Languages\Slovenian.isl,lang\sl.setup.isl"
Name: "sv"; MessagesFile: "compiler:Languages\Unofficial\Swedish.isl,lang\sv.setup.isl"
Name: "tr"; MessagesFile: "compiler:Languages\Turkish.isl,lang\tr.setup.isl"
Name: "uk"; MessagesFile: "compiler:Languages\Ukrainian.isl,lang\uk.setup.isl"
Name: "vi"; MessagesFile: "compiler:Languages\Unofficial\Vietnamese.isl,lang\vi.setup.isl"
Name: "zh_CN"; MessagesFile: "compiler:Languages\Unofficial\ChineseSimplified.isl,lang\zh_CN.setup.isl"
Name: "zh_TW"; MessagesFile: "compiler:Languages\Unofficial\ChineseTraditional.isl,lang\zh_TW.setup.isl"
;Name: "ro"; MessagesFile: "Romanian.islu,ro.setup.islu"
#include "base_po-msg.list"
[Types]
;Name: normal; Description: "{cm:TypeTypical}"
@ -288,6 +245,7 @@ Name: gs; Description: "{cm:ComponentsGhostscript}"; Types: full custom
;Locales
Name: loc; Description: "{cm:ComponentsTranslations}"; Types: full custom
#include "base_po-cmp.list"
#ifdef LUA
Name: lua; Description: "{cm:ComponentsLua}"; Types: full custom
@ -336,8 +294,8 @@ Source: "{#DEPS_DIR32}\share\*"; DestDir: "{app}\share"; Excludes: "{#OMISSIONS}
;Optional neutral components (complete install)
Source: "{#DEPS_DIR32}\share\ghostscript\*"; DestDir: "{app}\share\ghostscript"; Components: gs and ({#GIMP_ARCHS}); Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion
Source: "{#GIMP_DIR32}\share\locale\*"; DestDir: "{app}\share\locale"; Components: loc; Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion
Source: "{#DEPS_DIR32}\share\locale\*"; DestDir: "{app}\share\locale"; Components: loc; Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion
Source: "{#GIMP_DIR32}\share\locale\*"; DestDir: "{app}\share\locale"; Components: loc; Flags: dontcopy recursesubdirs restartreplace uninsrestartdelete ignoreversion
#include "base_po-files.list"
#ifdef LUA
Source: "{#GIMP_DIR32}\lib\gimp\{#GIMP_API_VERSION}\interpreters\lua.interp"; DestDir: "{app}\lib\gimp\{#GIMP_API_VERSION}\interpreters"; Components: lua and ({#GIMP_ARCHS}); Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion
Source: "{#DEPS_DIR32}\share\lua\*"; DestDir: "{app}\share\lua"; Components: lua and ({#GIMP_ARCHS}); Flags: recursesubdirs restartreplace ignoreversion uninsrestartdelete

View File

@ -0,0 +1,351 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file gives a list of some languages in the ISO 639
standard, and is used to generate lists to our .iss script
-->
<!DOCTYPE iso_639_entries [
<!ELEMENT iso_639_entries (iso_639_entry+)>
<!ELEMENT iso_639_entry EMPTY>
<!ATTLIST iso_639_entry
dl_code CDATA #REQUIRED
inno_code CDATA #REQUIRED
name CDATA #REQUIRED
>
]>
<iso_639_entries>
<iso_639_entry
dl_code="am"
inno_code=""
name="አማርኛ" />
<iso_639_entry
dl_code="ar"
inno_code=""
name="اَلْعَرَبِيَّةُ" />
<iso_639_entry
dl_code="ast"
inno_code=""
name="Asturianu" />
<iso_639_entry
dl_code="az"
inno_code=""
name="Azərbaycan dili" />
<iso_639_entry
dl_code="be"
inno_code="Languages\\Unofficial\\Belarusian.isl"
name="беларуская мова" />
<iso_639_entry
dl_code="bg"
inno_code="Languages\\Bulgarian.isl"
name="български език" />
<iso_639_entry
dl_code="br"
inno_code=""
name="Brezhoneg" />
<iso_639_entry
dl_code="bs"
inno_code=""
name="Bosanski" />
<iso_639_entry
dl_code="ca"
inno_code="Languages\\Catalan.isl"
name="Català" />
<iso_639_entry
dl_code="ca@valencia"
inno_code=""
name="Valencià" />
<iso_639_entry
dl_code="ckb"
inno_code=""
name="کوردی" />
<iso_639_entry
dl_code="cs"
inno_code="Languages\\Czech.isl"
name="Čeština" />
<iso_639_entry
dl_code="csb"
inno_code=""
name="Kaszëbsczi" />
<iso_639_entry
dl_code="da"
inno_code="Languages\\Danish.isl"
name="Dansk" />
<iso_639_entry
dl_code="de"
inno_code="Languages\\German.isl"
name="Deutsch" />
<iso_639_entry
dl_code="dz"
inno_code=""
name="རྫོང་ཁ་" />
<iso_639_entry
dl_code="el"
inno_code="Languages\\Unofficial\\Greek.isl"
name="Ελληνικά" />
<iso_639_entry
dl_code="en_CA"
inno_code=""
name="English (Canada)" />
<iso_639_entry
dl_code="en_GB"
inno_code="Languages\\Unofficial\\EnglishBritish.isl"
name="English (United Kingdom)" />
<iso_639_entry
dl_code="eo"
inno_code="Languages\\Unofficial\\Esperanto.isl"
name="Esperanto" />
<iso_639_entry
dl_code="es"
inno_code="Languages\\Spanish.isl"
name="Español" />
<iso_639_entry
dl_code="et"
inno_code=""
name="Eesti keel" />
<iso_639_entry
dl_code="eu"
inno_code="Languages\\Unofficial\\Basque.isl"
name="Euskara" />
<iso_639_entry
dl_code="fa"
inno_code=""
name="فارسی" />
<iso_639_entry
dl_code="fi"
inno_code="Languages\\Finnish.isl"
name="Suomi" />
<iso_639_entry
dl_code="fr"
inno_code="Languages\\French.isl"
name="Français" />
<iso_639_entry
dl_code="ga"
inno_code=""
name="Gaeilge" />
<iso_639_entry
dl_code="gd"
inno_code=""
name="Gàidhlig" />
<iso_639_entry
dl_code="gl"
inno_code="Languages\\Unofficial\\Galician.isl"
name="Galego" />
<iso_639_entry
dl_code="gu"
inno_code=""
name="ગુજરાતી" />
<iso_639_entry
dl_code="he"
inno_code="Languages\\Hebrew.isl"
name="עִבְֿרִית" />
<iso_639_entry
dl_code="hi"
inno_code=""
name="हिन्दी" />
<iso_639_entry
dl_code="hr"
inno_code=""
name="Hrvatski" />
<iso_639_entry
dl_code="hu"
inno_code="Languages\\Hungarian.isl"
name="Magyar nyelv" />
<iso_639_entry
dl_code="id"
inno_code="Languages\\Unofficial\\Indonesian.isl"
name="Bahasa Indonesia" />
<iso_639_entry
dl_code="is"
inno_code="Languages\\Icelandic.isl"
name="Íslenska" />
<iso_639_entry
dl_code="it"
inno_code="Languages\\Italian.isl"
name="Italiano" />
<iso_639_entry
dl_code="ja"
inno_code="Languages\\Japanese.isl"
name="日本語" />
<iso_639_entry
dl_code="ka"
inno_code="Languages\\Unofficial\\Georgian.isl"
name="ქართული ენა" />
<iso_639_entry
dl_code="kab"
inno_code="Default.isl,lang\\kab.isl"
name="Taqbaylit" />
<iso_639_entry
dl_code="kk"
inno_code=""
name="Qazaq" />
<iso_639_entry
dl_code="km"
inno_code=""
name="ភាសាខ្មែរ" />
<iso_639_entry
dl_code="kn"
inno_code=""
name="ಕನ್ನಡ" />
<iso_639_entry
dl_code="ko"
inno_code="Languages\\Korean.isl"
name="한국어" />
<iso_639_entry
dl_code="ky"
inno_code=""
name="Кыргыз тили" />
<iso_639_entry
dl_code="lt"
inno_code="Languages\\Unofficial\\Lithuanian.isl"
name="Lietuvių kalba" />
<iso_639_entry
dl_code="lv"
inno_code="Languages\\Unofficial\\Latvian.isl"
name="Latviešu valoda" />
<iso_639_entry
dl_code="mk"
inno_code=""
name="македонски" />
<iso_639_entry
dl_code="ml"
inno_code=""
name="മലയാളം" />
<iso_639_entry
dl_code="mr"
inno_code="Languages\\Unofficial\\Marathi.islu"
name="मराठी" />
<iso_639_entry
dl_code="ms"
inno_code="Languages\\Unofficial\\Malaysian.isl"
name="Bahasa Melayu" />
<iso_639_entry
dl_code="my"
inno_code=""
name="မြန်မာဘာသာ" />
<iso_639_entry
dl_code="nb"
inno_code=""
name="Bokmål" />
<iso_639_entry
dl_code="nds"
inno_code=""
name="Plattdütsch" />
<iso_639_entry
dl_code="ne"
inno_code=""
name="नेपाली" />
<iso_639_entry
dl_code="nl"
inno_code="Languages\\Dutch.isl"
name="Nederlands" />
<iso_639_entry
dl_code="nn"
inno_code="Languages\\Norwegian.isl"
name="Nynorsk" />
<iso_639_entry
dl_code="oc"
inno_code=""
name="Occitan" />
<iso_639_entry
dl_code="pa"
inno_code=""
name="ਪੰਜਾਬੀ" />
<iso_639_entry
dl_code="pl"
inno_code="Languages\\Polish.isl"
name="Polski" />
<iso_639_entry
dl_code="pt"
inno_code="Languages\\Portuguese.isl"
name="Português (Portugal)" />
<iso_639_entry
dl_code="pt_BR"
inno_code="Languages\\BrazilianPortuguese.isl"
name="Português (Brasil)" />
<iso_639_entry
dl_code="ro"
inno_code="Languages\\Unofficial\\Romanian.isl"
name="Românește" />
<iso_639_entry
dl_code="ru"
inno_code="Languages\\Russian.isl"
name="Pусский язык" />
<iso_639_entry
dl_code="rw"
inno_code=""
name="Ikinyarwanda" />
<iso_639_entry
dl_code="sk"
inno_code="Languages\\Slovak.isl"
name="Slovenčina (sk)" />
<iso_639_entry
dl_code="si"
inno_code=""
name="සිංහල" />
<iso_639_entry
dl_code="sl"
inno_code="Languages\\Slovenian.isl"
name="Slovenščina (sl)" />
<iso_639_entry
dl_code="sr"
inno_code=""
name="Cрпски језик" />
<iso_639_entry
dl_code="sr@latin"
inno_code=""
name="Cрпски језик (latin)" />
<iso_639_entry
dl_code="sv"
inno_code="Languages\\Unofficial\\Swedish.isl"
name="Svenska" />
<iso_639_entry
dl_code="ta"
inno_code=""
name="தமிழ்" />
<iso_639_entry
dl_code="te"
inno_code=""
name="తెలుగు" />
<iso_639_entry
dl_code="th"
inno_code=""
name="ภาษาไทย" />
<iso_639_entry
dl_code="tr"
inno_code="Languages\\Turkish.isl"
name="Türkçe" />
<iso_639_entry
dl_code="tt"
inno_code=""
name="татар теле" />
<iso_639_entry
dl_code="uk"
inno_code="Languages\\Ukrainian.isl"
name="українська мова" />
<iso_639_entry
dl_code="vi"
inno_code="Languages\\Unofficial\\Vietnamese.isl"
name="Tiếng Việt" />
<iso_639_entry
dl_code="xh"
inno_code=""
name="IsiXhosa" />
<iso_639_entry
dl_code="yi"
inno_code=""
name="יידיש" />
<iso_639_entry
dl_code="zh_CN"
inno_code="Languages\\Unofficial\\ChineseSimplified.isl"
name="簡體中文" />
<iso_639_entry
dl_code="zh_HK"
inno_code=""
name="香港中文" />
<iso_639_entry
dl_code="zh_TW"
inno_code="Languages\\Unofficial\\ChineseTraditional.isl"
name="繁體中文" />
</iso_639_entries>

View File

@ -0,0 +1,74 @@
#!/bin/bash
if [ "$1" = 'cmp' ]; then
## Get list of GIMP supported languages
PO_ARRAY=($(echo $(ls ../po/*.po |
sed -e 's|../po/||g' -e 's|.po||g' | sort) |
tr '\n\r' ' '))
## Create list of lang [Components]
for PO in "${PO_ARRAY[@]}"; do
CMP_LINE='Name: loc\PO_CLEAN; Description: "DESC"; Types: full custom'
# Change po
PO_CLEAN=$(echo $PO | sed "s/@/_/g")
CMP_LINE=$(sed "s/PO_CLEAN/$PO_CLEAN/g" <<< $CMP_LINE)
# Change desc
DESC=$(echo "cat //iso_639_entries/iso_639_entry[@dl_code=\"$PO\"]/@name" |
xmllint --shell ../build/windows/installer/lang/iso_639_custom.xml |
awk -F'[="]' '!/>/{print $(NF-1)}')
CMP_LINE=$(sed "s/DESC/$DESC/g" <<< $CMP_LINE)
# Create line
NL=$'\n'
CMP_LIST+="${CMP_LINE}${NL}"
done
echo "$CMP_LIST" > build/windows/installer/base_po-cmp.list
fi
if [ "$1" = 'files' ]; then
## Get list of GIMP supported languages
PO_ARRAY=($(echo $(ls ../po/*.po |
sed -e 's|../po/||g' -e 's|.po||g' | sort) |
tr '\n\r' ' '))
## Create list of lang [Files]
for PO in "${PO_ARRAY[@]}"; do
FILES_LINE='Source: "{#GIMP_DIR32}\share\locale\PO\*"; DestDir: "{app}\share\locale\PO"; Components: loc\PO_CLEAN; Flags: recursesubdirs restartreplace uninsrestartdelete ignoreversion'
# Change po
PO_CLEAN=$(echo $PO | sed "s/@/_/g")
FILES_LINE=$(sed "s/PO_CLEAN/$PO_CLEAN/g" <<< $FILES_LINE)
FILES_LINE=$(sed "s/PO/$PO/g" <<< $FILES_LINE)
# Create line
NL=$'\n'
FILES_LIST+="${FILES_LINE}${NL}"
done
echo "$FILES_LIST" > build/windows/installer/base_po-files.list
fi
if [ "$1" = 'msg' ]; then
## Get list of Inno supported languages
PO_INNO_ARRAY=($(echo $(ls ../po-windows-installer/*.po |
sed -e 's|../po-windows-installer/||g' -e 's|.po||g' | sort) |
tr '\n\r' ' '))
## Create list of lang [Languages]
if [ "$1" = 'msg' ]; then
for PO in "${PO_INNO_ARRAY[@]}"; do
MSG_LINE='Name: "PO"; MessagesFile: "compiler:INNO_CODE,lang\PO.setup.isl"'
# Change po
MSG_LINE=$(sed "s/PO/$PO/g" <<< $MSG_LINE)
# Change isl
INNO_CODE=$(echo "cat //iso_639_entries/iso_639_entry[@dl_code=\"$PO\"]/@inno_code" |
xmllint --shell ../build/windows/installer/lang/iso_639_custom.xml |
awk -F'[="]' '!/>/{print $(NF-1)}')
MSG_LINE=$(sed "s/INNO_CODE/$INNO_CODE/g" <<< $MSG_LINE)
# Create line
if [ "$INNO_CODE" != '' ]; then
NL=$'\n'
MSG_LIST+="${MSG_LINE}${NL}"
fi
done
echo "$MSG_LIST" > build/windows/installer/base_po-msg.list
fi
fi

View File

@ -99,6 +99,36 @@ foreach language : languages
endif
endforeach
# Generate lang lists for Inno
gen_list = find_program('list-installer-langs.sh')
custom_target('base_po-cmp',
input : [ 'iso_639_custom.xml' ],
output: [ 'base_po-cmp.list', ],
command: [
gen_list, 'cmp',
],
build_by_default: true,
)
custom_target('base_po-files',
input : [ 'iso_639_custom.xml' ],
output: [ 'base_po-files.list', ],
command: [
gen_list, 'files',
],
build_by_default: true,
)
custom_target('base_po-msg',
input : [ 'iso_639_custom.xml' ],
output: [ 'base_po-msg.list', ],
command: [
gen_list, 'msg',
],
build_by_default: true,
)
test('windows-installer-langs',
find_program('test-installer-langs.sh'),
env: [

View File

@ -4,7 +4,7 @@
# translations present. This check step is necessary to not forget new
# installer translations because we have a manual step.
INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile' ${GIMP_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/base_gimp3264.iss | \
INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile' build/windows/installer/base_po-msg.list | \
sed 's/^Name: *"\([a-zA-Z_]*\)".*$/\1/' | sort`
# 'en' doesn't have a gettext file because it is the default.
INSTALLER_LANGS=`echo "$INSTALLER_LANGS" | tr '\n\r' ' ' | sed 's/\<en\> //'`
@ -14,16 +14,15 @@ PO_LANGS=`ls ${GIMP_TESTING_ABS_TOP_SRCDIR}/po-windows-installer/*.po | \
PO_LANGS=`echo "$PO_LANGS" | tr '\n\r' ' '`
if [ "$PO_LANGS" != "$INSTALLER_LANGS" ]; then
echo "Error: languages listed in the Windows installer script do not match the .po files in po-windows-installer/."
echo "Error: languages listed in generated 'base_po-msg.list' do not match the .po files in po-windows-installer/."
echo "- PO languages: $PO_LANGS"
echo "- Installer languages: $INSTALLER_LANGS"
echo "Please verify: build/windows/installer/base_gimp3264.iss"
echo "Base language files can be found in: https://github.com/jrsoftware/issrc/tree/main/Files/Languages"
echo "If a new language is in Unofficial/, also edit/download it from:"
echo "build/windows/gitlab-ci/4_dist-gimp-inno.ps1"
echo "Please verify: build/windows/installer/lang/iso_639_custom.xml"
echo "You probably will need to add an 'inno_path' to the faulting lang"
exit 1
fi
MESON_LANGS=`grep "'code':" ${GIMP_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/lang/meson.build | \
sed "s/^.*'code': *'\([^']*\)'.*$/\1/" |sort`
MESON_LANGS=`echo "$MESON_LANGS" | tr '\n\r' ' ' | sed 's/\<en\> //'`
@ -35,21 +34,3 @@ if [ "$PO_LANGS" != "$MESON_LANGS" ]; then
echo "Please verify: build/windows/installer/lang/meson.build"
exit 1
fi
INSTALLER_LANGS=`grep -rI '^Name:.*MessagesFile.*Unofficial' ${GIMP_TESTING_ABS_TOP_SRCDIR}/build/windows/installer/base_gimp3264.iss | \
sed 's/^.*Unofficial\\\\\([a-zA-Z_.]*\),.*$/\1/' | sort`
INSTALLER_LANGS=`echo "$INSTALLER_LANGS" | tr '\n\r' ' '`
PULLED_UNOFFICIAL=`grep '^download_lang [^(]' ${GIMP_TESTING_ABS_TOP_SRCDIR}/build/windows/gitlab-ci/4_dist-gimp-inno.ps1 | \
sed 's$^download_lang \([^.]*.isl.\?\)$\1$' | sort`
PULLED_UNOFFICIAL=`echo "$PULLED_UNOFFICIAL" | tr '\n\r' ' '`
if [ "$INSTALLER_LANGS" = "$PULLED_UNOFFICIAL" ]; then
exit 0
else
echo "Error: unofficial languages listed in the Windows installer script do not match the pulled InnoSetup files."
echo "- Pulled files: $PULLED_UNOFFICIAL"
echo "- Installer languages: $INSTALLER_LANGS"
echo "Please verify: build/windows/gitlab-ci/4_dist-gimp-inno.ps1"
exit 1
fi