From e593a2536856c4aaf59e996a5378109c062bc2e3 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 7 Jul 2024 16:05:16 +0200 Subject: [PATCH] distroquery: human file size printing and translations --- distroquery.php | 19 ++++--- languages/it_IT.mo | Bin 3747 -> 4027 bytes languages/it_IT.po | 114 +++++++++++++++++++++++----------------- languages/responsive.po | 114 +++++++++++++++++++++++----------------- 4 files changed, 147 insertions(+), 100 deletions(-) diff --git a/distroquery.php b/distroquery.php index 2690e3a..d769ffe 100644 --- a/distroquery.php +++ b/distroquery.php @@ -17,6 +17,13 @@ if ( !defined( 'ABSPATH' ) ) { exit; } +function human_filesize($bytes, $dec = 2): string { + $size = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); + $factor = floor((strlen($bytes) - 1) / 3); + if ($factor == 0) $dec = 0; + return sprintf("%.{$dec}f %s", $bytes / (1024 ** $factor), $size[$factor]); +} + $url_prefix = home_url() . "/rpms/"; ?> @@ -173,7 +180,7 @@ $url_prefix = home_url() . "/rpms/"; : : : -: +: :" target=_blank> : @@ -266,7 +273,7 @@ $url_prefix = home_url() . "/rpms/"; echo $j["source"]["version"]."-".$j["source"]["release"] ?> : : -: +: :" target=_blank> :"; foreach ($j["provides"] as $provide) { echo $provide["name"]; - if ($provide["flags"] != "") echo " " . $provide["flags"] . $provide["version"]; + if ($provide["flags"] != "") echo " " . $provide["flags"] . " " . $provide["version"]; echo "
"; } echo ""; foreach ($j["obsoletes"] as $obsolete) { echo $obsolete["name"]; - if ($obsolete["flags"] != "") echo " " . $obsolete["flags"] . $obsolete["version"]; + if ($obsolete["flags"] != "") echo " " . $obsolete["flags"] . " " . $obsolete["version"]; echo "
"; } echo ""; foreach ($j["requires"] as $require) { echo $require["name"]; - if ($require["flags"] != "") echo " " . $require["flags"] . $require["version"]; + if ($require["flags"] != "") echo " " . $require["flags"] . " " . $require["version"]; $cnt = 0; foreach ($require["providers"] as $provider) { @@ -307,7 +314,7 @@ $url_prefix = home_url() . "/rpms/"; $provider_url = $url_prefix . $provider["repository"] . "/" . $provider["name"] . "/" . $arch; echo " [" . $cnt . "]"; } - if ($cnt == 0) echo " (" . _r("unresolved") . ")"; + if ($cnt == 0) echo " (" . _r("unresolved") . ")"; echo "
"; } diff --git a/languages/it_IT.mo b/languages/it_IT.mo index 96ef9bc58d352e0803a1f0e710bed09837ce42c1..7fd740ba99ecc31b604e59ed1519328082500a75 100644 GIT binary patch delta 1769 zcmYk6TWk$M7{{m89`u5`tClTwEn1hOsJpt0R73=Q=+U!kX?OMXlxoC@h)8&l*fjA# zA})!DhH4)qcp-6%1R)`jNF?+D!HYK$zyC4BWdHM4{pMMZHU#_*UDs?l(=wX5Mk?DbGncfdSY2M53=I2;~=4h&&G*aHW{yD-O? zlzINAVcx>N4D`Z$_!Y|WPnZic7?gv2m<@+RjThPe5{N@H)s9D@0#!l1zY!|I?Qjrm zfDz)GHaj5&dCW;FO$gx#cnK=t9Y`+b9#o*mumHY-N~9O|ho7Mm{Q))q7gPe-bgI9A zO79iQCcc?QgE=M&mEj`Gb((;^l}e85Z2ul8hXitJhiM)Uc z&};3l(82D*wxo9eDxoqce-$Yj3cSz`Y=GL*O;C>Opd5M-U#8jiABIZcIMm9|+5Rim z?t)76j_rQ{<>wic|JQar)k{MOe1}@OM&+;ow!tE(z#Wh&<^t4z;0DwRp4#y@a0~WF z$YZK-ss*frI^xYx2{l07p=QV(N|{y~`cB)RK8ur<=b!>yhuop`_9+1st)v3!hqVT2 zC-kXSqUA^l%jaCAq6N)PxBgT*f<eDZ7+tC&^$B>EkP@ggLG8dUfpsP z9mzs8Mg~PctZ8T}nv6=3E^-O_zf92WLOkAQQ);C1Lg#~oci4{pIPCh$kj;tg+%xIz8^Aj zTK$CE5;X32v(c6L%XMU8gCCd%HZ|3eV&|{2QP)Z*^v#ANWqfBSbPVzX4iht;hfX delta 1511 zcmYk6ZD@^Q7{{-(mvgqAjlFmqdpVnzjhStX+1N0I8dg%)NXj^x6kmw+kP!Q{JqWFQ z;FM3ZS+cC8G|5B?g{X~Bwv_mw_JQAj?#12nzkk<#U+1~5>wbAofBwx}?^9;NWuvV{ zIjAzutO+(G(9yaR&4RE8&Vqez{2ESX`~jxI5jY9{g41A#my%!}%!EZS1=cvOhaof1 z8Zpvv?10L-4~AhYRDh$9n0Ctf&$;EMl#=|klHL%}MXBvl7g=9b-RROFDn3X~8z<#Qj0}nxseWIX$oFH}ISd?Vzs&2(B}6I8-IkXkJYmFO_k*`Id) z4#;EI=oB{wr@}j7_Fpd!FrfloKn4En#v?GoSj$kN0;ocYAucP0N?7gYH$m;#7N|J8 zAdj`sDbEq8#3!H@+U_|=r<;gDRoLz3A3z0q3>A3L`QJk&{sOhqpHKl4IiF)N9WrGX zppNVcoj%`NP=!B&@_WxQwqv}5N>E0pO6#D`a0669%}{rv1?p}bfcmZvLfv-Hu^n8#*ZD-vobd^-*J)SN|=wdy8qi;1}dNq>B!Xd`L01T&|;*f;wM@G zMhU7!^+*fUZYlrxzus)jWoQA?wrZ>NU%+Cl7_m9F9BIqcRw1okpOr4C+UoKCUsr@# zi?lnrNcU$Rszy4}Y?P;\n" "Language-Team: Italian, Italy\n" @@ -26,147 +26,171 @@ msgstr "Leggi di piĆ¹ ›" msgid "Pages:" msgstr "Pagine:" -#: ../distroquery.php:40 ../distroquery.php:135 ../distroquery.php:193 +#: ../distroquery.php:47 ../distroquery.php:149 ../distroquery.php:244 msgid "Repositories" msgstr "Repository" -#: ../distroquery.php:42 +#: ../distroquery.php:49 msgid "Available repositories" msgstr "Repository disponibili" -#: ../distroquery.php:71 +#: ../distroquery.php:78 msgid "List of packages" msgstr "Elenco dei pacchetti" -#: ../distroquery.php:74 +#: ../distroquery.php:81 msgid "Search packages" msgstr "Cerca pacchetti" -#: ../distroquery.php:75 +#: ../distroquery.php:82 msgid "Search here" msgstr "Cerca qui" -#: ../distroquery.php:76 +#: ../distroquery.php:83 msgid "Results for:" msgstr "Risultati per:" -#: ../distroquery.php:92 ../distroquery.php:114 +#: ../distroquery.php:99 ../distroquery.php:121 msgid "result(s) found" msgstr "risultati trovati" -#: ../distroquery.php:93 +#: ../distroquery.php:100 msgid "Showing page" msgstr "Mostro la pagina" -#: ../distroquery.php:93 +#: ../distroquery.php:100 msgid "of" msgstr "di" -#: ../distroquery.php:117 ../distroquery.php:160 ../distroquery.php:217 +#: ../distroquery.php:125 +msgid "Arch" +msgstr "Architettura" + +#: ../distroquery.php:126 ../distroquery.php:176 ../distroquery.php:270 msgid "Name" msgstr "Nome" -#: ../distroquery.php:117 +#: ../distroquery.php:127 msgid "Version" msgstr "Versione" -#: ../distroquery.php:118 -msgid "Last update" -msgstr "Ultimo aggiornamento" - -#: ../distroquery.php:118 +#: ../distroquery.php:128 msgid "Summary" msgstr "Descrizione" -#: ../distroquery.php:141 ../distroquery.php:198 +#: ../distroquery.php:129 +msgid "Last update" +msgstr "Ultimo aggiornamento" + +#: ../distroquery.php:155 ../distroquery.php:249 msgid "ERROR" msgstr "ERRORE" -#: ../distroquery.php:148 ../distroquery.php:205 +#: ../distroquery.php:162 ../distroquery.php:256 msgid "Resources" msgstr "Risorse" -#: ../distroquery.php:149 ../distroquery.php:206 +#: ../distroquery.php:163 ../distroquery.php:257 msgid "Source files" msgstr "File sorgenti" -#: ../distroquery.php:150 ../distroquery.php:207 +#: ../distroquery.php:164 ../distroquery.php:258 msgid "Changes" msgstr "Modifiche" -#: ../distroquery.php:151 ../distroquery.php:208 +#: ../distroquery.php:165 ../distroquery.php:259 msgid "Issues" msgstr "Problemi" -#: ../distroquery.php:152 ../distroquery.php:209 +#: ../distroquery.php:166 ../distroquery.php:260 msgid "Add a new issue" msgstr "Segnala un problema" -#: ../distroquery.php:153 ../distroquery.php:210 +#: ../distroquery.php:167 ../distroquery.php:261 msgid "Download" msgstr "Scarica" -#: ../distroquery.php:161 ../distroquery.php:218 +#: ../distroquery.php:177 ../distroquery.php:227 ../distroquery.php:271 msgid "Release" msgstr "Versione" -#: ../distroquery.php:164 ../distroquery.php:222 +#: ../distroquery.php:180 ../distroquery.php:275 msgid "Group" msgstr "Gruppo" -#: ../distroquery.php:165 +#: ../distroquery.php:181 msgid "Maintainer" msgstr "Manutentore" -#: ../distroquery.php:166 ../distroquery.php:223 -msgid "Description" -msgstr "Descrizione" - -#: ../distroquery.php:167 +#: ../distroquery.php:182 msgid "License" msgstr "Licenza" -#: ../distroquery.php:168 ../distroquery.php:224 +#: ../distroquery.php:183 ../distroquery.php:276 msgid "Size" msgstr "Dimensione" -#: ../distroquery.php:169 ../distroquery.php:225 +#: ../distroquery.php:184 ../distroquery.php:277 msgid "Upstream URL" msgstr "URL di origine" -#: ../distroquery.php:170 +#: ../distroquery.php:185 msgid "Build time" msgstr "Data di compilazione" -#: ../distroquery.php:171 +#: ../distroquery.php:190 +msgid "Binary packages and requirements" +msgstr "Pacchetti binari e dipendenze" + +#: ../distroquery.php:196 msgid "Built RPMS" msgstr "RPM creati" -#: ../distroquery.php:177 +#: ../distroquery.php:205 msgid "Build requirements" msgstr "Dipendenze di compilazione" -#: ../distroquery.php:221 +#: ../distroquery.php:217 ../distroquery.php:317 +msgid "unresolved" +msgstr "non risolto" + +#: ../distroquery.php:225 +msgid "History of changes" +msgstr "Cronologia delle modifiche" + +#: ../distroquery.php:226 ../functions.php:129 +msgid "Date" +msgstr "Data" + +#: ../distroquery.php:227 +msgid "Packager" +msgstr "Packager" + +#: ../distroquery.php:228 +msgid "Description" +msgstr "Descrizione" + +#: ../distroquery.php:274 msgid "Architecture" msgstr "Architettura" -#: ../distroquery.php:226 +#: ../distroquery.php:278 msgid "Source RPM" msgstr "RPM sorgente" -#: ../distroquery.php:229 +#: ../distroquery.php:287 msgid "Brothers" msgstr "Collegati" -#: ../distroquery.php:235 +#: ../distroquery.php:287 msgid "Provides" msgstr "Fornisce" -#: ../distroquery.php:242 +#: ../distroquery.php:288 msgid "Obsoletes" msgstr "Rende obsoleti" -#: ../distroquery.php:249 +#: ../distroquery.php:288 msgid "Requires" msgstr "Richiede" @@ -182,10 +206,6 @@ msgstr "per" msgid "File size:" msgstr "Dimensione file:" -#: ../functions.php:129 -msgid "Date" -msgstr "Data" - #: ../functions.php:139 msgid "" "Sorry, download is temporary unavailable. If the problem persists please " diff --git a/languages/responsive.po b/languages/responsive.po index 2aca3a7..298158c 100644 --- a/languages/responsive.po +++ b/languages/responsive.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: openmamba 1.0\n" "Report-Msgid-Bugs-To: bugs@openmamba.org\n" -"POT-Creation-Date: 2024-07-06 19:15+0200\n" +"POT-Creation-Date: 2024-07-07 14:59+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,147 +27,171 @@ msgstr "" msgid "Pages:" msgstr "" -#: ../distroquery.php:40 ../distroquery.php:135 ../distroquery.php:193 +#: ../distroquery.php:47 ../distroquery.php:149 ../distroquery.php:244 msgid "Repositories" msgstr "" -#: ../distroquery.php:42 +#: ../distroquery.php:49 msgid "Available repositories" msgstr "" -#: ../distroquery.php:71 +#: ../distroquery.php:78 msgid "List of packages" msgstr "" -#: ../distroquery.php:74 +#: ../distroquery.php:81 msgid "Search packages" msgstr "" -#: ../distroquery.php:75 +#: ../distroquery.php:82 msgid "Search here" msgstr "" -#: ../distroquery.php:76 +#: ../distroquery.php:83 msgid "Results for:" msgstr "" -#: ../distroquery.php:92 ../distroquery.php:114 +#: ../distroquery.php:99 ../distroquery.php:121 msgid "result(s) found" msgstr "" -#: ../distroquery.php:93 +#: ../distroquery.php:100 msgid "Showing page" msgstr "" -#: ../distroquery.php:93 +#: ../distroquery.php:100 msgid "of" msgstr "" -#: ../distroquery.php:117 ../distroquery.php:160 ../distroquery.php:217 +#: ../distroquery.php:125 +msgid "Arch" +msgstr "" + +#: ../distroquery.php:126 ../distroquery.php:176 ../distroquery.php:270 msgid "Name" msgstr "" -#: ../distroquery.php:117 +#: ../distroquery.php:127 msgid "Version" msgstr "" -#: ../distroquery.php:118 -msgid "Last update" -msgstr "" - -#: ../distroquery.php:118 +#: ../distroquery.php:128 msgid "Summary" msgstr "" -#: ../distroquery.php:141 ../distroquery.php:198 +#: ../distroquery.php:129 +msgid "Last update" +msgstr "" + +#: ../distroquery.php:155 ../distroquery.php:249 msgid "ERROR" msgstr "" -#: ../distroquery.php:148 ../distroquery.php:205 +#: ../distroquery.php:162 ../distroquery.php:256 msgid "Resources" msgstr "" -#: ../distroquery.php:149 ../distroquery.php:206 +#: ../distroquery.php:163 ../distroquery.php:257 msgid "Source files" msgstr "" -#: ../distroquery.php:150 ../distroquery.php:207 +#: ../distroquery.php:164 ../distroquery.php:258 msgid "Changes" msgstr "" -#: ../distroquery.php:151 ../distroquery.php:208 +#: ../distroquery.php:165 ../distroquery.php:259 msgid "Issues" msgstr "" -#: ../distroquery.php:152 ../distroquery.php:209 +#: ../distroquery.php:166 ../distroquery.php:260 msgid "Add a new issue" msgstr "" -#: ../distroquery.php:153 ../distroquery.php:210 +#: ../distroquery.php:167 ../distroquery.php:261 msgid "Download" msgstr "" -#: ../distroquery.php:161 ../distroquery.php:218 +#: ../distroquery.php:177 ../distroquery.php:227 ../distroquery.php:271 msgid "Release" msgstr "" -#: ../distroquery.php:164 ../distroquery.php:222 +#: ../distroquery.php:180 ../distroquery.php:275 msgid "Group" msgstr "" -#: ../distroquery.php:165 +#: ../distroquery.php:181 msgid "Maintainer" msgstr "" -#: ../distroquery.php:166 ../distroquery.php:223 -msgid "Description" -msgstr "" - -#: ../distroquery.php:167 +#: ../distroquery.php:182 msgid "License" msgstr "" -#: ../distroquery.php:168 ../distroquery.php:224 +#: ../distroquery.php:183 ../distroquery.php:276 msgid "Size" msgstr "" -#: ../distroquery.php:169 ../distroquery.php:225 +#: ../distroquery.php:184 ../distroquery.php:277 msgid "Upstream URL" msgstr "" -#: ../distroquery.php:170 +#: ../distroquery.php:185 msgid "Build time" msgstr "" -#: ../distroquery.php:171 +#: ../distroquery.php:190 +msgid "Binary packages and requirements" +msgstr "" + +#: ../distroquery.php:196 msgid "Built RPMS" msgstr "" -#: ../distroquery.php:177 +#: ../distroquery.php:205 msgid "Build requirements" msgstr "" -#: ../distroquery.php:221 +#: ../distroquery.php:217 ../distroquery.php:317 +msgid "unresolved" +msgstr "" + +#: ../distroquery.php:225 +msgid "History of changes" +msgstr "" + +#: ../distroquery.php:226 ../functions.php:129 +msgid "Date" +msgstr "" + +#: ../distroquery.php:227 +msgid "Packager" +msgstr "" + +#: ../distroquery.php:228 +msgid "Description" +msgstr "" + +#: ../distroquery.php:274 msgid "Architecture" msgstr "" -#: ../distroquery.php:226 +#: ../distroquery.php:278 msgid "Source RPM" msgstr "" -#: ../distroquery.php:229 +#: ../distroquery.php:287 msgid "Brothers" msgstr "" -#: ../distroquery.php:235 +#: ../distroquery.php:287 msgid "Provides" msgstr "" -#: ../distroquery.php:242 +#: ../distroquery.php:288 msgid "Obsoletes" msgstr "" -#: ../distroquery.php:249 +#: ../distroquery.php:288 msgid "Requires" msgstr "" @@ -183,10 +207,6 @@ msgstr "" msgid "File size:" msgstr "" -#: ../functions.php:129 -msgid "Date" -msgstr "" - #: ../functions.php:139 msgid "" "Sorry, download is temporary unavailable. If the problem persists please "