[gimp] build: complete Windows installer lang list in meson and fix iconv…



commit a6c44a7191877fb5d0f4da85f21c86bdfc513035
Author: Jehan <jehan girinstud io>
Date:   Fri Jun 18 20:22:04 2021 +0200

    build: complete Windows installer lang list in meson and fix iconv…
    
    … conversion when some characters are not convertible.
    
    Currently failed conversion ended up in incomplete .isl files (autotools
    build) or would break the build (meson build). Ideally we should use a
    target encoding which contains all source characters, but we use the
    encoding as set upstream in the LanguageCodePage for the given language
    file.
    I'm not sure if maybe we can mix the encoding by adding our own
    LanguageCodePage at the top of our generated <code>.setup.isl, then we
    could just use UTF-8 for any language. It will have to be tested.
    
    For now let's just discard non-convertible characters, assuming there
    shouldn't be too many of these. It's the lesser evil in this situation.

 build/windows/installer/lang/Makefile.am    |  2 +-
 build/windows/installer/lang/extractlang.sh |  7 ++++++-
 build/windows/installer/lang/meson.build    | 11 +++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/build/windows/installer/lang/Makefile.am b/build/windows/installer/lang/Makefile.am
index 8f466686a3..430be93d6f 100644
--- a/build/windows/installer/lang/Makefile.am
+++ b/build/windows/installer/lang/Makefile.am
@@ -54,7 +54,7 @@ stamp-isl: setup.isl Makefile.am
                isl="$(srcdir)/$$code.setup.isl";                                       \
                echo "  GEN      $$isl";                                                \
                sed '/^\w\+'"$$prefix"'=/{s/\(.\)'"$$prefix"'/\1/;n};/^\w.*=/d' $< |    \
-               iconv -f UTF-8 -t $$encoding > "$$isl";                                 \
+               iconv -c -f UTF-8 -t $$encoding > "$$isl";                              \
        done &&                                                                         \
        echo timestamp > stamp-isl
 
diff --git a/build/windows/installer/lang/extractlang.sh b/build/windows/installer/lang/extractlang.sh
index a1cad742da..f156ded5cd 100644
--- a/build/windows/installer/lang/extractlang.sh
+++ b/build/windows/installer/lang/extractlang.sh
@@ -8,4 +8,9 @@ prefix=$(echo "$prefix" | sed 's/[][]/\\\0/g')
 
 #echo to stdout
 sed '/^\w\+'"$prefix"'=/{s/\(.\)'"$prefix"'/\1/;n};/^\w.*=/d' "$infile" \
-| iconv -f UTF-8 -t "$encoding"
+| iconv -c -f UTF-8 -t "$encoding"
+
+# TODO: currently we silently discard non-convertible characters with -c
+# option on iconv. Eventually we would want to just use UTF-8 for all
+# language files (ideally), instead of folloding the LanguageCodePage of
+# the main .isl file as provided in the issrc repository.
diff --git a/build/windows/installer/lang/meson.build b/build/windows/installer/lang/meson.build
index 2b587b2470..f9205f553b 100644
--- a/build/windows/installer/lang/meson.build
+++ b/build/windows/installer/lang/meson.build
@@ -20,23 +20,34 @@ languages = [
   { 'code': 'de',    },
   { 'code': 'el',    'encoding': 'WINDOWS-1253', },
   { 'code': 'en',    'prefix': '', },
+  { 'code': 'en_GB', 'encoding': 'UTF-8',        },
   { 'code': 'eo',    'encoding': 'ISO-8859-3',   },
   { 'code': 'es',    },
   { 'code': 'eu',    },
+  { 'code': 'fi',    },
   { 'code': 'fr',    },
+  { 'code': 'he',    'encoding': 'WINDOWS-1255', },
   { 'code': 'hu',    'encoding': 'WINDOWS-1250', },
   { 'code': 'id',    'encoding': 'ISO-8859-1',   },
   { 'code': 'is',    },
   { 'code': 'it',    },
+  { 'code': 'ja',    'encoding': 'CP932',        },
+  { 'code': 'kab',   'encoding': 'UTF-8',        },
   { 'code': 'ko',    'encoding': 'EUC-KR',       },
   { 'code': 'lv',    'encoding': 'ISO-8859-13',  },
+  { 'code': 'mr',    'encoding': 'UTF-8',  },
+  { 'code': 'ms',    'encoding': 'UTF-8',  },
   { 'code': 'nl',    },
   { 'code': 'pl',    'encoding': 'WINDOWS-1250', },
   { 'code': 'pt_BR', },
+  { 'code': 'ro',    'encoding': 'WINDOWS-1250', },
   { 'code': 'ru',    'encoding': 'WINDOWS-1251', },
+  { 'code': 'sk',    'encoding': 'WINDOWS-1250', },
   { 'code': 'sl',    'encoding': 'WINDOWS-1250', },
   { 'code': 'sv',    },
   { 'code': 'tr',    'encoding': 'WINDOWS-1254', },
+  { 'code': 'uk',    'encoding': 'WINDOWS-1251', },
+  { 'code': 'vi',    'encoding': 'WINDOWS-1258', },
   { 'code': 'zh_CN', 'encoding': 'WINDOWS-936',  },
   { 'code': 'zh_TW', 'encoding': 'CP950',        },
 ]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]