summaryrefslogtreecommitdiff
path: root/libre/icedove-l10n/PKGBUILD
blob: c7aa45bb4fae06a9fd5966b47c5127a037fc18a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# Maintainer: Andreas Grapentin <andreas@grapentin.org>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>

_pkgbase=icedove
pkgbase=${_pkgbase}-l10n
epoch=1
pkgver=68.2.2
pkgrel=1
# https://developer.mozilla.org/en-US/docs/Mozilla/Calendar/Calendar_Versions
_calbase=iceowl
_calver=$pkgver
pkgdesc="Language pack for ${_pkgbase^} and ${_calbase}."
arch=(any)
url="https://wiki.parabola.nu/$_pkgbase"
license=(MPL GPL)
depends=("$_pkgbase=$pkgver")
makedepends=('unzip' 'zip')

# note that there is currently no localization for Iceowl:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1469678
# might be temporarily fixable through this:
# https://gist.github.com/progandy/ce857358c4f3b8eb09887a085e4bea30
_languages=(
  'ar     "Arabic"'
  'ast    "Asturian"'
  'be     "Belarusian"'
  'bg     "Bulgarian"'
  'br     "Breton"'
  'ca     "Catalan"'
  'cak    "Kaqchikel"'
  'cs     "Czech"'
  'cy     "Welsh"'
  'da     "Danish"'
  'de     "German"'
  'dsb    "Lower Sorbian"'
  'el     "Greek"'
  'en-GB  "English (British)"'
  'en-US  "English (US)"'
  'es-AR  "Spanish (Argentina)"'
  'es-ES  "Spanish (Spain)"'
  'et     "Estonian"'
  'eu     "Basque"'
  'fi     "Finnish"'
  'fr     "French"'
  'fy-NL  "Frisian"'
  'ga-IE  "Irish"'
  'gd     "Gaelic (Scotland)"'
  'gl     "Galician"'
  'he     "Hebrew"'
  'hr     "Croatian"'
  'hsb    "Upper Sorbian"'
  'hu     "Hungarian"'
  'hy-AM  "Armenian"'
  'id     "Indonesian"'
  'is     "Icelandic"'
  'it     "Italian"'
  'ja     "Japanese"'
  'ka     "Georgian"'
  'kab    "Kabyle"'
  'kk     "Kazakh"'
  'ko     "Korean"'
  'lt     "Lithuanian"'
  'ms     "Malay"'
  'nb-NO  "Norwegian (Bokmål)"'
  'nl     "Dutch"'
  'nn-NO  "Norwegian (Nynorsk)"'
  'pl     "Polish"'
  'pt-BR  "Portuguese (Brazilian)"'
  'pt-PT  "Portuguese (Portugal)"'
  'rm     "Romansh"'
  'ro     "Romanian"'
  'ru     "Russian"'
  'si     "Sinhala"'
  'sk     "Slovak"'
  'sl     "Slovenian"'
  'sq     "Albanian"'
  'sr     "Serbian"'
  'sv-SE  "Swedish"'
  'tr     "Turkish"'
  'uk     "Ukrainian"'
  'uz     "Uzbek"'
  'vi     "Vietnamese"'
  'zh-CN  "Chinese (Simplified)"'
  'zh-TW  "Chinese (Traditional)"'
)

pkgname=()
source=('brand.dtd' 'brand.properties' 'region.properties')
_url=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/linux-x86_64/xpi
_calurl=https://ftp.mozilla.org/pub/calendar/lightning/candidates/$_calver-candidates/build1/linux-x86_64
for _lang in "${_languages[@]}"; do
  _locale=${_lang%% *}
  _pkgname=$pkgbase-${_locale,,}

  pkgname+=($_pkgname)
  source+=("$pkgbase-$pkgver-$_locale.xpi::$_url/$_locale.xpi")
           #"$_calbase-l10n-$_calver-$_locale.xpi::$_calurl/lightning-$_calver.$_locale.linux-i686.xpi")
  eval "package_$_pkgname() {
    _package $_lang
  }"
done

# Don't extract anything
noextract=(${source[@]%%::*})

_package() {
  pkgdesc="$2 language pack for Icedove and Iceowl."
  replaces=(thunderbird-i18n-${1,,})
  provides=(thunderbird-i18n-${1,,})

  mkdir $1

  unzip $_pkgbase-l10n-$pkgver-$1.xpi -d $1/$_pkgbase
  rm -v $_pkgbase-l10n-$pkgver-$1.xpi

  #unzip $_calbase-l10n-$_calver-$1.xpi -d $1/$_calbase
  #rm -v $_calbase-l10n-$_calver-$1.xpi

  local localizedRe
  localizedRe="$(cat $1/$_pkgbase/chrome/$1/locale/$1/messenger-region/region.properties | grep '^[^#]*localizedRe')"
  if [ -z "$localizedRe" ]; then
    localizedRe="mailnews.localizedRe="
  fi

  install -vDm644 $srcdir/brand.dtd $1/$_pkgbase/chrome/$1/locale/$1/branding
  install -vDm644 $srcdir/brand.properties $1/$_pkgbase/chrome/$1/locale/$1/branding
  install -vDm644 $srcdir/region.properties $1/$_pkgbase/chrome/$1/locale/$1/messenger-region
  echo "$localizedRe" >> $1/$_pkgbase/chrome/$1/locale/$1/messenger-region/region.properties

  #cp -R $1/$_calbase/chrome/calendar-$1 $1/$_pkgbase/chrome/
  #cp -R $1/$_calbase/chrome/lightning-$1 $1/$_pkgbase/chrome/

#  cat >> $1/$_pkgbase/chrome/de.manifest << EOF
#locale calendar de calendar-de/locale/de/calendar/
#locale lightning de lightning-de/locale/de/lightning/
#EOF

  sed -i -e 's/thunderbird/icedove/' $1/$_pkgbase/manifest.json
  sed -i -e 's/Thunderbird/Icedove/' $1/$_pkgbase/manifest.json
  rm -rv $1/$_pkgbase/chrome/$1/locale/$1/global-platform/{mac,win}
  # searchplugins have gone from the translation?
  #rm -rv $1/$_pkgbase/chrome/$1/locale/$1/messenger/searchplugins
  #cp -av /usr/lib/mozilla/searchplugins $1/$_pkgbase/chrome/$1/locale/$1/messenger

  cd $1/$_pkgbase
  zip -r langpack-$1@$_pkgbase.mozilla.org.xpi .
  mv -v langpack-$1@$_pkgbase.mozilla.org.xpi $srcdir
  cd ../..
  rm -rv $1

  install -vDm644 langpack-$1@$_pkgbase.mozilla.org.xpi \
    "$pkgdir/usr/lib/$_pkgbase/extensions/langpack-$1@$_pkgbase.mozilla.org.xpi"
}

sha256sums=('83b8a12a36933df22c3e3143400e93f1bffee81cd3fb3d4e2b6a9cdefaf67c2d'
            '5f041a40b8f4ba552d8412d6934ea2bc872be90e684a6856e83bc1bdedc22d11'
            '817c1f6219f5b9a00820e4d67cda3d7c388e6af11e8498bd912dad0381b5e01b'
            '2acdff0cbaf14a5a3c9ffa81b685e83799534f9cec16f8f9bc4d8833c3fa5520'
            'd1996bd2d303e99797502598e27d06e30398f4a4dad71456e2397dd86d4ba468'
            'bbf537bfb6e311d2d51a76ed1f39b19b660e9ac489329ac811c5ae6fd4898fb4'
            '47b4801e9e429e6df548a8c71694e53b7cbadf9028a234e60d9ce911ad66cb89'
            '1816ed38297d4eac411e87d9b9f8d6f3f2ca5350350d78275e2d1e4a0d44405a'
            'a019e3d620853bb7ab2aa810076d2c59a899ab9db7003b4236d83c9ad557243a'
            '4e7242e597106ec3bc43b387aac8831679c63bc5c7d05126492853f51d61f4a2'
            '5cb5c731576e27c461da63be77438e08dd234304c3d40f5bc4d83a46b0233f4c'
            '2b4c276544328e7e65ab83bcdd682c5b045a7c9abd1c6f674992491ce4e78d72'
            'de467261a287708351e37a30066d1a822972984ba63f664e384c1b3d07837125'
            '9bf4d0a3a1168054741547d4bb6c3a5d9c4731967f9e2a5da715d12aff2a59a8'
            '5780e1b4d8e0aaf7a7747ee2e2d84971360c51cba28275c345aa327104299594'
            'c35993609894be6b9f476fd0a0306b3ead5c465533bb5700197bf05cbe1dc897'
            'b2b5f3fc1cbb6929b1ab39f32978ed225fd6980c77b454f1224bf6a29f7b5f3b'
            '1119a68ed2fcb4a1fc800147f0a19fc1ab9c9198487f56b553c521ad6368eeb2'
            '9c3402f9f3d3560510baecced305bf7daf7825f3647a41164ce4250acb550a39'
            '678eef4bc2c85929445f4f9e8abc5a911d14bfa3006c926483e88b490b10a99c'
            '4354263e2a1d5f020cb7b07026f6c1de298d82ede934453762772b314f3ccbbf'
            '40b262811c33e2089cffec486ad2467ce60010a6578393447e00403fac1922b6'
            '81100e9c6c9f255bd7370ad55d614aa5da02b5a8ebcb22893836e6e31155e583'
            '029ef0e9300a8e3ee03b7def66008834386f760eda957734a97c84b716f87763'
            '3b7d8c41d9c905ad4d6548e32f61a60e10a4276be76f75974338b7d0a4b30c5a'
            'd988db0ad5b830de542b53aca39240d9273c7fd194979a45f6909b6dc72e81d6'
            '81387349250110510e3bef754669508e55f0e8d97120f1824569cb4cef34dae9'
            'c84421de6b80244266435c13897cfe589b5033532496dd170c15d54e9786c176'
            '529bc6f119676f24f5c6f07ebc90cedf47f171bd5d3be283fe1f05619692dcf8'
            '7c6faeb4d6d31f8d63888743efc0e022a33aa4fe7b3723e2be9761ae93350143'
            '5c3656d28a02f0ab8fad7bf77f6e91f73e1b5ff974cc694f902e205c4f4c9e4e'
            'd93076d473740c8d026c6a4f257638ea6ad142f0006c18ebc9009da6e58d7cee'
            'f2771abceca082cfbef42892681c985e152ece1862f6a00d61f0ce5721f50c30'
            '93d1c3b1c46eae7da2fad7ab87835466576c7c570f3d791d61a132c3f2b26761'
            'ec7d6e3f80dd995a9b4579264a8158cd7d806e6f9507dffe1ba9fd51ef0721a5'
            '9185f37fc9937d5fcdef097927dbbace6a4381dadbade8d25775a1146f327d90'
            'ebf95de59e1b75d318142b79d9bb991de5965cc8381963806c545f8a50319396'
            'e4749479f0de6083260d559e197a6059fef0f30cdc8da475bde544fdc5151c08'
            '7baf2dccfaad93da0792678e602387718ab8e9c62b472a9af3adfa91bd2a0dde'
            '2011d557d29d5c566dde4174191a427833e1d2373ece99503fefa7995f3ea113'
            '13ca0c4ae33c6b648bd1be7873ab5a8dbd7d18798088130b2f28f27997c04165'
            'f893529c2829a41ea10f90466263b925e58095e0f1c12b249fdc37c21d7a7237'
            'ded7c67c5ace6364dd80d34303d7430cc956314746905d8ca11610460862697c'
            '980a0ad5b85fdbe1a71c2ff62d9aa15006aeaf5eb4740f6a86173a8c04cf2b3c'
            '007d7d8a464805809815bbc5b22127a907af5eb4249d243815540e6e6595c3fe'
            '358e6d7148875b20b3174a4370e206ddf9bc49fcadcbbfed95eb995235bfa36e'
            '483578617e505e35d281670cda5209d90c8ae57311c871eb5c7fbbd6669c28e9'
            'a3f0ba8dbcb6c8f3f93230ac4623f61b37a2dfab6849973075b6d679f4da2e1e'
            '5eab0eed85cd54820d5233c2424dde6c0c17051b3233dda2c3b6deb6c5ef4ac2'
            '0768bcd4aea17a3cee81c24c470bcdbc33aef2234dd0246abc34a9a1c302bfa2'
            'f1e5ff6a29c86be385a3cf7d43b0e81d558f649d37a8bf05a6ded86d017dbea3'
            '5828e2e8f6e698f720420dc80c25fe1a8fa8682dd1ec2b8e90b92976dd695b4a'
            '1be00b33917f48ffb42793c519387adb37344db92bc68b929883ce05f500e552'
            'a54774f51ba5d589a7e34f5a70363e853b72ad9d73d4789d9582949e77cda9b6'
            'edb3e82ca73329095c527bfa8242c7b7f8225d5ac13bb3236b5751e98dcdb8df'
            'ab1fc24e27076c94b5d1a12b952cf63f8be7da6ecafdb1d694d89502b49013ca'
            '8892fbf5a9927eb2f27180e0d393c862d4f8650544e6fd6f6d9199f3beb36c50'
            'f7e4458723e142011b3ac0a11548f284d99b4539ae4cc5e3d44b2d5dc8b9f5c0'
            'efb32887d7179f421a26ba00489edaa117c6d60a3e840f7cdcaf3937146aedaa'
            '5f0790bef02d6b89dedb3e3620104e3f8a83d0ec7faa6912b81f25f8cb2dc002'
            '85b4aa3c6f5d62c257b6a930c9ff85189e2bc29e5fea98ed23802947714081e5'
            'adf74002c09f9613e443926260e5a13b29a829c10400f99d7702401009bb67bd'
            'c3af34114bf24f246991181bfc60fa9c5a1d5c32fc9bcfd3eeff821ea389ba62'
            'bf718a9852ca69a8f77364cbda9967f638f7f0fbff15d450022c892e7b3d760b')