diff options
author | felics@felics-tablet | 2016-05-20 10:24:23 +0200 |
---|---|---|
committer | felics@felics-tablet | 2016-05-20 10:24:23 +0200 |
commit | 891e4cad1e0f38cf5ab40b87822bb33989420d76 (patch) | |
tree | 57133262a374b176e23b37c2b42fd816451cc947 | |
parent | 55a6345b709659e2274d62bed8587a9ab6d24752 (diff) | |
download | aur-891e4cad1e0f38cf5ab40b87822bb33989420d76.tar.gz |
Added information about locales, starting with Czech locale if installed, in order to display diacritical characters correctly.
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | idos-timetable-browser.install | 19 | ||||
-rwxr-xr-x | idos-timetable-browser.sh | 17 |
4 files changed, 44 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = idos-timetable-browser-latest pkgdesc = Offline railway and other public transport timetable search engine by CHAPS. (Czech language by default.) pkgver = 1.27_lib2.8.0.1 - pkgrel = 1 + pkgrel = 2 epoch = 0 url = http://chaps.cz/eng/download/idos/zip#kotvaprg arch = i686 @@ -22,11 +22,13 @@ pkgbase = idos-timetable-browser-latest source = IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf source = license-dummy.txt source = README.datafiles.txt + source = idos-timetable-browser.install sha256sums = SKIP - sha256sums = 5d6e710d03d5832fcdb67726b3ce91ee1a4fe993f258e8a15c49bd51f5224bb5 + sha256sums = 969d4418181c9fed180e240c4a73fbfa57e126f77c1c4c6e9217d515a1e6913f sha256sums = e904d167ccdcfb2743f4cfd596aaa9dce8b751fb5c8315b972b42b7cbb3189e6 sha256sums = c6bb216055d3670d3100b7a74e04ce0644030f365f4349a09e630ef60fbcb9a4 sha256sums = 45bf7c462d7154360d0007a6d7c00c6aa6b49339b6f178cf24e5b1a40ca702d7 + sha256sums = 670e6a40bade4562fb93c7cb29191c1869c286acbb7f616c8b78f09842a82cbd pkgname = idos-timetable-browser-latest @@ -4,7 +4,7 @@ _pkgname=idos-timetable-browser pkgname="${_pkgname}-latest" epoch=0 pkgver=1.27_lib2.8.0.1 -pkgrel=1 +pkgrel=2 pkgdesc="Offline railway and other public transport timetable search engine by CHAPS. (Czech language by default.)" arch=('i686' 'x86_64') url="http://chaps.cz/eng/download/idos/zip#kotvaprg" @@ -42,14 +42,16 @@ source=( "IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf" "license-dummy.txt" "README.datafiles.txt" + "idos-timetable-browser.install" ) sha256sums=( "SKIP" # "92a47f8947a15bdd3c0fcaac4e21db7d0ae6d9e70cfb9de94e5238081a91a817" - "5d6e710d03d5832fcdb67726b3ce91ee1a4fe993f258e8a15c49bd51f5224bb5" + "969d4418181c9fed180e240c4a73fbfa57e126f77c1c4c6e9217d515a1e6913f" "e904d167ccdcfb2743f4cfd596aaa9dce8b751fb5c8315b972b42b7cbb3189e6" "c6bb216055d3670d3100b7a74e04ce0644030f365f4349a09e630ef60fbcb9a4" "45bf7c462d7154360d0007a6d7c00c6aa6b49339b6f178cf24e5b1a40ca702d7" + "670e6a40bade4562fb93c7cb29191c1869c286acbb7f616c8b78f09842a82cbd" ) diff --git a/idos-timetable-browser.install b/idos-timetable-browser.install new file mode 100644 index 000000000000..0549175405bc --- /dev/null +++ b/idos-timetable-browser.install @@ -0,0 +1,19 @@ +post_install() { + if locale -a | grep -Eq '^cs_CZ'; then + echo "====> A Czech locale (cs_CZ*) seems to be present. Fine. please keep it in order" + echo "<==== to keep diacritical characters displaying correctly." + else + echo "====> It is recommended to generate the locale cs_CZ.ISO.UTF-8 or cs_CZ.ISO-8859-2" + echo " in order to display diacritical characters correctly." + echo " In order to do so, edit /etc/locale.gen, if present /etc/locale.nopurge, and" + echo "<==== then run locale-gen." + fi +} + +post_upgrade() { + post_install "$@" +} + +post_remove() { + true +} diff --git a/idos-timetable-browser.sh b/idos-timetable-browser.sh index 7ab17aa9e497..f68b0a1d7678 100755 --- a/idos-timetable-browser.sh +++ b/idos-timetable-browser.sh @@ -6,6 +6,9 @@ # command line argument reformatting so that filenames can be # specified both absolutely and relatively to the directory the user # starts this wrapper from. +# +# Also, it starts with a Czech locale, if available, in order to make +# diacritical characters display correctly. @@ -130,10 +133,24 @@ done +### Check for locale, and if present, set Czech locale: + +if locale -a | grep -qE '^cs_CZ'; then + if locale -a | grep -qE '^cs_CZ' | grep -qi utf8; then + LC_CTYPE="$(locale -a | grep -E '^cs_CZ' | grep -i utf8 | head -n 1)" + else + LC_CTYPE="$(locale -a | grep -E '^cs_CZ' | tail -n 1)" + fi + export LC_CTYPE +fi + + + ### Launch the software with the parsed and maybe reformatted arguments: cd "${_installdir}" +debug 'DEBUG: $LC_CTYPE is set to: '"'${LC_CTYPE}' (if it does not begin with 'cs_CZ', try to enable Czech locale on your system to display diacritical characters correctly)." debug "DEBUG: We are running from the directory: '$(pwd)'." debug "DEBUG: Executing the following command: 'wine ${_executable} ${argsnew[@]}'." |