Skip to content

Commit

Permalink
[eos-translations] added support for positional parameters: cal_info2…
Browse files Browse the repository at this point in the history
… changed
  • Loading branch information
EndeavourOS committed Aug 21, 2023
1 parent e108b26 commit 6651ce0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
10 changes: 5 additions & 5 deletions eos-translations/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pkgname=eos-translations
pkgdesc="EndeavourOS translation support"
pkgver=23
pkgrel=24
pkgrel=25
arch=('any')
license=('GPL')
depends=(bash)
Expand Down Expand Up @@ -43,13 +43,13 @@ source=(
$_url_dl/translation-zh_SG.bash
$_url_dl/translation-zh_TW.bash
)
sha512sums=('4bf1c5216c0ed969a41bf43b0fc28b8cb80b6deb4482cdb1e7312adcf3c4e8ac2f7db014c5cf166fd6994468e024633fca3469456cd8bb070770235559c921c9'
sha512sums=('fb3678baa4625d50d8ef78da91632a9a08b67c1e999e3c921dcee4e3027bb72170fe96e5a2d51dba21b903a14e25523dbf17c74bfd86a3ef7dd671a86fc1b99c'
'd4de1875194bfdffb42bdee1f6d040eeaa6df06ac6f2c58a5afd0b798446aece93ec07bf333d9f1d16b3a4f9377ae20a9d0ad8d1ad09481f8eed9c7e06db44be'
'90a5d7ecc70e53f4de3492ba08b295682c0bafdf5ae9bfa63effa6adcdb49698c1b5cf291d61bb6638e9532da8f214ba46aef37eb875d01825b0438b9bc348ce'
'ed9d32971ba71f70683d65db7987678272e6d9f3214a55a9e13b49a43d938d09b18f2a3345e8aeaf16ebb6aeec74737ef769e8a830417b799d13074f89eb05d6'
'5e42f3550ceefdd49e8f444d161f7268ad1cf236d19687b7a3b0f916b14e9cf6d535ead40b5aa4ca7516c9779b54c4ae50980eaa34384b5d1853aee38c3694da'
'a499e72013bd0f2778c1dadf9ab9df1cedcbba9c87b41567973c2889aee0ab4462509b90a0f8b787d44a32a7f7e46a29748815c44286afb0f8c2951295baf825'
'151cc75bdd0f78b4f6e08ed942cb3db140ec103b3ade4388f4e39b3a4034542795b2105e7fb3016966c14eb05fdc8f952ee53518c2afe563addf7c1ce1def73c'
'da76bb37ae79dc5aa30d32aee733984d75b775602d53f42695bf0714b51dc068da3c0ea12c884a2c3978066e80b930de0f24ae3ccb172d04fb872239d0851bfe'
'facbaae5a5d9c4ecb3ffb0051a70dff957f35d764b2ac48eb694b90c9dcd62ba2665e56b0627b038ebc27925baae84f4df49c9109d6730384b4e047ffa6a79d7'
'9f580b874cd085aaa2f1974b7bb259a10fe0071214ab2448903e03f59d7d7c3280d8438d92dc3678a97d999835a8aa6cc3879a6e9c82a588466c8781a8324cb4'
'a201a5257b1916e21b86936b75a8217d56a245b09ec80e62eee6bb8d3288a5023c2ba11ac86f03307e0ad01a1ad9216cfd2949fc72f15d931d0046bafc991eb8'
'3d54d139eaa5cef0b4960ab2a912ab76429bc59b727bf5fbf27fd9495c8b1631a33d85e7d3084044c07887d6353e8c3d0d3cc1ea1854b793669a4b9d14a956e3'
Expand All @@ -62,7 +62,7 @@ sha512sums=('4bf1c5216c0ed969a41bf43b0fc28b8cb80b6deb4482cdb1e7312adcf3c4e8ac2f7
'f847db78936307b8eaffa8466d11d49a70311ebe3a33c777473a0575b9746aa57ccfacce12c584ebbb6c15c8803070c06643890090c1af0c7c97c8465b40325a'
'83e5478efb87b5f68e9b13a2ebfc101a748b9c0beec4c53060026b9ad7f8682e1f94f49df77160afcee41a20e014750293726abaf0bfdcce3f0175c393101ec6'
'b38169bd5584ff54378e73e8b0ed3a18d4571ae489bb741335ba4104e7b0f2c0e16d2001e89b6faa3339aafa390339471bc3080714121db163e9ee24e3995ed3'
'd898dd45c32aff72a0cb809630d62195a8a75fbacd980c2ef9b07b8d3b4a287a82879ab0c037b6794ea2a0e03a6d4befca34448a16a392eaf7bcc8ecb08502dd'
'd8424dfd333df90c6299e57cd9873fadc2c2bcf02b044a414734b61ab31e4b7031662cbdb5c2b18b01ffed4ca1ae87c81067eee9f40d96f7ceace0b64be6cb22'
'c6fd801eec3940a73ba254e334e983ba2de1a1d31b75fe24c6b98d8e0b232e93fd3549288190cc212535b22041faea25892b8bc1ec044779bae5a3040a35177d'
'86b529b28a87bdd7b800cf80e9ceada76c0d78a59188beabc4148fbacf57807c3c0e110484fa593a0b54a5a9bf5549a4bfba148c5aa85849eae0ada998649e75'
'a75e20c6b918cc1b502a4473ff4edd3f8523eb7c54e2527b8871b1e88e66ec8fbf3a418049c3f223a35cb0be4fbd9f01e2e9d46e8aa1e5e1f73e24074819bc3c'
Expand Down
3 changes: 2 additions & 1 deletion eos-translations/Translation_changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Modifications in the English translation

*Last updated: 2021-Dec-21*
*Last updated: 2023-Aug-21*

Here you will find a list of *changes* to the original English version.<br>
The changes can be
Expand Down Expand Up @@ -34,3 +34,4 @@ Change date | Placeholder name | Reason for the change
2021-Dec-14 | after_install_r8168 | Changed the action performed by the button.
2021-Dec-14 | after_install_r8168_tip | Changed the action performed by the button.
2021-Dec-21 | settings_dis_contents | Text layout change.
2023-Aug-21 | cal_info2 | Support for printf-like positional parameters (added %%s).
4 changes: 2 additions & 2 deletions eos-translations/translation-en.bash
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ _tr_add2 issues_no "No important system issues were detected."
_tr_add2 cal_noavail "Not available: " # installer program
_tr_add2 cal_warn "Warning"
_tr_add2 cal_info1 "This is a community development release.\n\n" # specials needed!
_tr_add2 cal_info2 "<b>Offline</b> method gives you an Xfce desktop with EndeavourOS theming.\nInternet connection is not needed.\n\n"
_tr_add2 cal_info3 "<b>Online</b> method lets you choose your desktop, with vanilla theming.\nInternet connection is required.\n\n"
_tr_add2 cal_info2 "<b>Offline</b> method gives you the %%s desktop.\nInternet connection is not needed.\n\n"
_tr_add2 cal_info3 "<b>Online</b> method lets you choose your desktop.\nInternet connection is required.\n\n"
_tr_add2 cal_info4 "Please Note: This release is a work-in-progress, please help us making it stable by reporting bugs.\n"
_tr_add2 cal_choose "Choose installation method"
_tr_add2 cal_method "Method"
Expand Down
4 changes: 2 additions & 2 deletions eos-translations/translation-fi.bash
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ _tr_add2 issues_no "Korjattavaa ei löydetty."
_tr_add2 cal_noavail "Ei saatavilla: " # installer program
_tr_add2 cal_warn "Varoitus"
_tr_add2 cal_info1 "Tämä on Community Development -julkaisu.\n" # specials needed!
_tr_add2 cal_info2 "<b>Offline</b> asentaa Xfce-työpöydän ja EndeavourOS-teeman.\nNettiyhteyttä ei tarvita.\n\n"
_tr_add2 cal_info3 "<b>Online</b> antaa valita asennettavan työpöydän, johon tulee oletusteema.\nNettiyhteys tarvitaan.\n\n"
_tr_add2 cal_info2 "<b>Offline</b> asentaa %%s-työpöydän.\nNettiyhteyttä ei tarvita.\n\n"
_tr_add2 cal_info3 "<b>Online</b> antaa valita asennettavan työpöydän.\nNettiyhteys tarvitaan.\n\n"
_tr_add2 cal_info4 "\nHUOM: Tätä julkaisua kehitetään jatkuvasti. Ole hyvä ja auta tekemään siitä parempi raportoimalla mahdolliset virheet.\n"
_tr_add2 cal_choose "Valitse asennustapa"
_tr_add2 cal_method "Tapa"
Expand Down
2 changes: 1 addition & 1 deletion eos-translations/translation-se.bash
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ _tr_add2 issues_no "Inga viktiga systemfel upptäcktes."
_tr_add2 cal_noavail "Icke tillgängligt: " # installer program
_tr_add2 cal_warn "Varning"
_tr_add2 cal_info1 "Det här är ett gemenskapsutvecklat släpp.\n\n" # specials needed!
_tr_add2 cal_info2 "<b>Offline</b> metoden ger dig en Xfce-desktop med EndeavourOS-tema.\nInternetuppkoppling är inte nödvändig.\n\n"
_tr_add2 cal_info2 "<b>Offline</b> metoden ger dig %%s skrivbordet.\nInternet-uppkoppling behövs inte.\n\n"
_tr_add2 cal_info3 "<b>Online</b> metoden låter dig välja skrivbordsbakgrund, med vaniljtema.\nInternetuppkoppling krävs.\n\n"
_tr_add2 cal_info4 "OBS: Detta släpp är ett pågående arbete, vänligen hjälp oss att göra det stabilt genom att rapportera buggar\n"
_tr_add2 cal_choose "Välj installationsmetod"
Expand Down
8 changes: 7 additions & 1 deletion eos-translations/translations.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ _tr_add() {
local ix="$2"
local str="$3"

shift 3

printf -v str "$str" "$@" # add possible parameters into the given string

tr_strings["Lang_${lang}__$ix"]="$str"

tr_indexes+=("$ix")
Expand All @@ -35,7 +39,9 @@ _tr_add2() {
ltr() { # puts string to stdout
local ix="$1"
local str="${tr_strings["Lang_${SELECTED_EOS_LANGUAGE}__$ix"]}"
test -n "$2" && str+="$2" # remove this line some day...
shift
test -n "$2" && { str+="$2"; shift; } # remove this line some day...
printf -v str "$str" "$@"
echo "$str"
}
ltr2() { # puts string to stderr
Expand Down

0 comments on commit 6651ce0

Please sign in to comment.