Re: [aur-dev] python-whoosh should be renamed to python2-whoosh
On 09/01/2012 02:44 PM, rns wrote: According to https://wiki.archlinux.org/index.php/Python_Package_Guidelines, python-whoosh (https://aur.archlinux.org/packages.php?ID=27425) should be renamed to python2-whoosh. What I have done is like this: I downloaded the PKGBUILD of python-whoosh, and uploaded it under the name of python2-whoosh. And I realize maybe I've messed something up, because the discussion and votes python-whoosh got won't migrate to python2-whoosh in this way. Sorry for this. As my notetaking app mikidown (http://aur.archlinux.org/packages.php?ID=57432) now depends on python3-whoosh! Can someone help me rename the current python-whoosh to python2-whoosh? Thxs. This belongs to aur-general. -- freenode/pyropeter ETAOIN SHRDLU signature.asc Description: OpenPGP digital signature
Re: [aur-dev] Adding the HE language.
On 02/12/2011 01:34 PM, Lukas Fleischer wrote: 0003. df02d42 pkg_search_results: replace blind-table with floating div's Basically sounds like a good idea. I'll look into that! I finished updating this. I will now look into the next patch, actually adding rtl-support. Regards, PyroPeter -- freenode/pyropeter ETAOIN SHRDLU From 65d170d638cc46f8552ba2aa6876efabeeec6397 Mon Sep 17 00:00:00 2001 From: PyroPeter abi1...@googlemail.com Date: Tue, 15 Feb 2011 20:04:23 +0100 Subject: [PATCH 2/2] pkg_search_results: replace blind-table with floating divs * I tried to remove errors in the sgml-structure e.g.: div ?php if (foo) { ? /div ?php } ? * I did not remove or add code (except the table and div stuff, of cause). I only changed the order of the html/php-tags. * The bottom and top of the script are now properly indented. I did not indent the middle part (table of search results) because that would render the diff completely useless. Signed-off-by: PyroPeter abi1...@googlemail.com --- web/html/css/arch.css | 15 + web/html/css/containers.css |2 +- web/template/pkg_search_results.php | 116 +-- 3 files changed, 72 insertions(+), 61 deletions(-) diff --git a/web/html/css/arch.css b/web/html/css/arch.css index 203d9da..eec08bb 100644 --- a/web/html/css/arch.css +++ b/web/html/css/arch.css @@ -284,6 +284,21 @@ blockquote.code { color: #333; font-size: .95em; } +.pkgSearchResultsFooter { + overflow: auto; +} +.pkgSearchResultsFooter .legendAndActions { + float: left; +} +.pkgSearchResultsFooter .legend { + margin-bottom: 3px; +} +.pkgSearchResultsFooter .pageLinks { + float: right; + margin: 0 0; + padding: 0 0; +} + /* AUR Styles */ .pgbox { diff --git a/web/html/css/containers.css b/web/html/css/containers.css index 12362f6..67fd8c7 100644 --- a/web/html/css/containers.css +++ b/web/html/css/containers.css @@ -153,7 +153,7 @@ td.data2 { padding-left: .3em; text-align: left; } -#legend span { +.legend span { padding: 1px; margin-left: .3em; border: solid 1px #888; diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php index 57d574c..de41424 100644 --- a/web/template/pkg_search_results.php +++ b/web/template/pkg_search_results.php @@ -1,13 +1,16 @@ -form action='packages.php??php echo htmlentities($_SERVER['QUERY_STRING']) ?' method='post' -div class=pgbox ?php if (!$result) { ? -div class='pgboxbody'?php print __(Error retrieving package list.) ?/div + div class='pgboxbody'?php print __(Error retrieving package list.) ?/div ?php } elseif ($total == 0) { ? -div class='pgboxbody'?php print __(No packages matched your search criteria.) ?/div + div class='pgboxbody'?php print __(No packages matched your search criteria.) ?/div ?php } else { ? - div class=pgboxtitle - span class='f3'?php print __(Package Listing) ?/span - /div + form action='packages.php??php echo htmlentities($_SERVER['QUERY_STRING']) ?' method='post' + div class=pgbox + div class=pgboxtitle + span class='f3'?php print __(Package Listing) ?/span + /div + + + table width='100%' cellspacing='0' cellpadding='2' tr @@ -79,59 +82,52 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { ?php } ? /table -/div +/div !-- .pgbox ??! -- -div class=pgbox - table width='100%' - tr - td align='left' - div id=legend - span class='f3'?php echo __('Legend') ?/span - span class=outofdate?php print __('Out of Date') ?/span - /div - ?php if ($SID): ? - div - select name='action' - option?php print __(Actions) ?/option - option value='do_Flag'?php print __(Flag Out-of-date) ?/option - option value='do_UnFlag'?php print __(Unflag Out-of-date) ?/option - option value='do_Adopt'?php print __(Adopt Packages) ?/option - option value='do_Disown'?php print __(Disown Packages) ?/option - ?php if ($atype == Trusted User || $atype == Developer): ? - option value='do_Delete'?php print __(Delete Packages) ?/option - ?php endif; ? - option value='do_Notify'?php print __(Notify) ?/option - option value='do_UnNotify'?php print __(UnNotify) ?/option - /select - ?php if ($atype == Trusted User || $atype == Developer): ? - input type='checkbox' name='confirm_Delete' value='1' / ?php print __(Confirm) ? - ?php endif; ? - input type='submit' class='button' style='width: 80px' value='?php print __(Go
Re: [aur-dev] Adding the HE language.
On 02/12/2011 01:34 PM, Lukas Fleischer wrote: 0004. 76a874a Right-to-left written languages now supported Basically looks ok, except that you revert some previous bug fixes. Also, where's that css/languages.css that you link to in the new header template? I now updated this, too. What bugfixes did I revert? I hope I did not revert them this time. I merged the content of the former languages.css into arch.css. Regards, PyroPeter -- freenode/pyropeter ETAOIN SHRDLU
Re: [aur-dev] Adding the HE language.
On 02/12/2011 01:34 PM, Lukas Fleischer wrote: Wow, I finally found some time to rebase and review all those patches... 0001. 00e497a pkg_search_results: rewrite of page navigation I have to admit that I don't really like that way of pagination. It just feels odd and counter-intuitive imho. Right now, we have First, Prev, Next and Last buttons as well as pages adjacent to the current one. If you want to find a package that you remember to start with the letter r and to contain the string and somewhere in the package description, typing that into the search criteria and browsing all results is not the right way to do it. The proper way to allow users to search for such packages is to provide more powerful search criteria, which is something we're already working on. Also, if we'd want to implement something like that, I'd prefer some kind of binary search. That might, in fact, be interesting :) Moving parts of the paging stuff to pkgfuncts.inc makes sense tho. I'll probably extract this from the patch. I rewrote the pagination a second time, this time without changing the behavoir. Probably the world isn't ready yet for a commit that turns searching into something awesome (tm). (Children would have known what logarithmic scaling means even before doing their first polynomial division!) On the search criteria: it would be great to have regexps! Mysql even has support for that: SELECT * FROM foo WHERE foo REGEXP '^java'; 0002. b65a5a3 pkg_search_results: increase size of links in page-navigation I'm not sure about this. I've never heard any gripes about that links being too small. Is there any feature request concerning this? No. But this only grews one-digit-links to be of the size of two-digit- links, so imo the usability gain outweights the space consumption. I merged this change into the patch mentioned above. 0003. df02d42 pkg_search_results: replace blind-table with floating div's Basically sounds like a good idea. I'll look into that! 0004. 76a874a Right-to-left written languages now supported Basically looks ok, except that you revert some previous bug fixes. Also, where's that css/languages.css that you link to in the new header template? The last two patches probably need a lot of updating, I will do that next. I attached languages.css (forgot to git-add it) Thanks for your contributions! Thanks for reviewing them :-P -- freenode/pyropeter ETAOIN SHRDLU From 541c18f86d970051d837e9dd75e1122292d1fd4f Mon Sep 17 00:00:00 2001 From: PyroPeter abi1...@googlemail.com Date: Mon, 14 Feb 2011 20:58:42 +0100 Subject: [PATCH] pkg_search_results: rewrite of pagination * Most of the PHP-code was moved to pkgfuncs.php to keep the template simple. Signed-off-by: PyroPeter abi1...@googlemail.com --- web/html/css/arch.css | 17 +--- web/lib/pkgfuncs.inc| 28 + web/template/pkg_search_results.php | 77 ++ 3 files changed, 53 insertions(+), 69 deletions(-) diff --git a/web/html/css/arch.css b/web/html/css/arch.css index c3ed3aa..203d9da 100644 --- a/web/html/css/arch.css +++ b/web/html/css/arch.css @@ -328,19 +328,24 @@ blockquote.code { text-decoration: none; } -#pages { margin: 5px; } -#pages .page_num { +.pageNav { + margin:5px 0; +} +.pageNav .page_num { border: 1px solid #ddd; padding: 2px; color: #0771a6; } - -#pages .page_num:hover { +.pageNav * { + display:inline-block; + text-align:center; + min-width:3ex; +} +.pageNav .page_num:hover { border: 1px solid #8faecd; color: #333; } - -#pages #page_sel { +.pageNav .page_sel { border: 1px solid #8faecd; padding: 2px; color: #333; diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 2f69321..0420054 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -559,6 +559,34 @@ function pkg_search_page($SID=) { if ($total 1 || $total == 0) { + # calculation of pagination links + $per_page = ($_GET['PP'] 0) ? $_GET['PP'] : 25; + $current = ceil($first / $per_page); + $pages = ceil($total / $per_page); + $templ_pages = array(); + + if ($current - 1 1) + $templ_pages[__('First')] = 0; + + if ($current 1) + $templ_pages[__('Previous')] = ($current - 2) * $per_page; + + if ($current - 5 1) + $templ_pages[] = ellipsis; + + for ($i = max($current - 5, 1) ; $i = min($pages, $current + 5) ; $i++) { + $templ_pages[$i] = ($i - 1) * $per_page; + } + + if ($current + 5 $pages) + $templ_pages[] = ellipsis; + + if ($current $pages) + $templ_pages[__('Next')] = $current * $per_page
Re: [aur-dev] Old, unapplied patches
On 02/07/2011 02:36 PM, PyroPeter wrote: Hello AUR developers, there is a great backlog of patches that work well, but are not applied. Among them are: * The right-to-left fixes for the hebrew translation * Making links in comments clickable * Deletion through the web interface It would be great if you could take some time to review and apply them. Regards, PyroPeter It's a pity nobody even bothers to reply to this topic. Obviously there is no point in contributing to the AUR if the contribution is just ignored. -- freenode/pyropeter ETAOIN SHRDLU
Re: [aur-dev] Adding the HE language.
On 08/17/2010 04:51 PM, PyroPeter wrote: On 08/16/2010 05:47 AM, Loui Chang wrote: I appreciate your efforts PyroPeter. I have some suggestions though. I recommend you to keep your patches small and focused. Here's a guideline: Each of those bullet points above should be at least one commit. This huge all-in-one patch makes it very hard for me to review, and frankly I don't like to deal with them at all. Try to send debatable patches last - for example I'm not so sure that removing 'next' and 'previous' is a good idea. So that applies when the patch is a matter of opinion. Thanks Sorry for that, I will try to avoid that in the future. I am now splitting the commit into smaller ones. Attached are the first four patches: 0001. 00e497a pkg_search_results: rewrite of page navigation 0002. b65a5a3 pkg_search_results: increase size of links in page-navigation 0003. df02d42 pkg_search_results: replace blind-table with floating div's 0004. 76a874a Right-to-left written languages now supported ~~PyroPeter Maybe Lukas could review this patches, if Loui lacks the time to do it? -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).
On 10/01/2010 02:15 PM, PyroPeter wrote: I did not mean to offend you, and after applying the patch (which I should have done before sending the mails, you are right) your code in fact seems to work a lot better then I thought. While testing, I found a bug: Post this URL: http://foo.bar/lt;gt;lt;gt; It seems to trigger two bugs at once, first, the regex does not match whole URL, and second, the href is escaped twice. What I ment was the URL http://foo.bar/; Also, s/whole/the whole/ Regards, PyroPeter -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).
On 09/30/2010 05:22 PM, Lukas Fleischer wrote: This is a bit hacky patch to make links in AUR comments clickable (fixes FS#20137 [1]). Huge parts of this code are ripped from the DokuWiki plugin that is also used in Flyspray. I didn't have any time to test it extensively so I'd suggest to do some more tests if this will be commited. I fixed the / bugs and changed the indention to tabs. I also changed the regex to one that accepts everything that starts with one of 'http', 'https' or 'ftp' followed by a colon :, contains no whitespace and ends with a letter (\w) or a slash /. It also parses hostnames starting with www. and ending in a 2 to 5 letters long TLD consisting of only a-z. I have tested it with the comments at [0]. Regards, PyroPeter [0] http://aur.keks.selfip.org/packages.php?ID=298 --- diff --git a/web/lib/aur.inc b/web/lib/aur.inc index bd69c4c..7465fac 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -494,3 +494,24 @@ function salted_hash($passwd, $salt) } return md5($salt . $passwd); } + +function parse_link($matches) +{ + $name = $matches[0]; + $url = preg_replace('/^www\./', 'http://www.', $matches[0]); + return 'a href=' . $url . '' . $name . '/a'; +} + +function parse_comment($comment) +{ + $regex = '/' . str_replace('/', '\/', implode('|',array( + '\b(http|https|ftp):[^\s]*[\w\d/]', + '\bwww\.[^\s/]+\.[a-z]{2,5}' + ))) . '/S'; + + $comment = htmlspecialchars($comment); + $comment = preg_replace_callback($regex, 'parse_link', $comment); + $comment = nl2br($comment); + + return $comment; +} diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index 02171a0..2ca9bf0 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -20,7 +20,7 @@ while (list($indx, $carr) = each($comments)) { ? ?/div blockquote class=comment-body div -?php echo nl2br(htmlspecialchars($carr['Comments'])) ? +?php echo parse_comment($carr['Comments']) ? /div /blockquote ?php -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).
On 10/01/2010 05:52 PM, Lukas Fleischer wrote: This won't match URLs like https://aur.archlinux.org/packages.php?O=0K=; and an ampersand at the end of an URL won't be converted correctly :/ I'll try to implement it a more proper way the next days. Maybe I'll actually go with splitting comments at link boundaries as you suggested before... :) Well, that's the problem. Which characters should belong to the end of the URL, and which should not? There could also be cases in which punctuation belongs to the URL. If punctuation is parsed as not belonging to the URL, there would be no way to post a working link to certain URLs. If punctuation is parsed as part of the URL, one could insert a space between the URL and the punctuation that should not belong to the URL. One should also consider that inserting an URL into a sentence looks horrible and is normally not done (by me, at least). About splitting at boundaries: Contrary to what I have said before, using regular expressions seems to be a valid and efficient way. (I thought you would have to escape tag-content and attributes in different ways (percent-encoding vs. html-entities). After reading the HTML4 specification I realized this is not the case, as content and attributes are both escaped using html-entities) Regards, PyroPeter -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).
On 09/30/2010 05:22 PM, Lukas Fleischer wrote: This is a bit hacky patch to make links in AUR comments clickable (fixes FS#20137 [1]). Huge parts of this code are ripped from the DokuWiki plugin that is also used in Flyspray. I didn't have any time to test it extensively so I'd suggest to do some more tests if this will be commited. [1] https://bugs.archlinux.org/task/20137 --- web/lib/aur.inc | 45 + web/template/pkg_comments.php |2 +- 2 files changed, 46 insertions(+), 1 deletions(-) diff --git a/web/lib/aur.inc b/web/lib/aur.inc index bd69c4c..b0cfdc8 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -494,3 +494,48 @@ function salted_hash($passwd, $salt) } return md5($salt . $passwd); } + +function parse_link($matches) +{ + $name = $url = $matches[0]; + + if(substr($url, 0, 3) == 'ftp' (substr($url, 0, 6) != 'ftp://')) { +$url = 'ftp://'.$url; + } + elseif (substr($url, 0, 3) == 'www') { +$url = 'http://'.$url; + } + + $url = str_replace('','amp;', $url); + $url = str_replace('amp;amp;', 'amp;', $url); What about the occurrences of amp;(html-entity-code-here); you produced the line before? + $url = strtr($url, array('' = '%3E','' = '%3C', '' = '%22')); + + return 'a href=' . $url . '' . $name .'/a'; +} + +function parse_comment($comment) +{ + $schemes = array('http', 'https', 'ftp'); + $ltrs = '\w'; + $gunk = '\/\#~:.?+=%...@!\-'; + $punc = '.:?\-;,'; + $host = $ltrs . $punc; + $any = $ltrs . $gunk . $punc; + + $patterns = array(); + + foreach ($schemes as $scheme) { +$patterns[] = '(\b(?i)' . $scheme . '(?-i):\/\/[' . $any . ']+?(?=[' . $punc . ']*[^' . $any . ']))'; + } + + $patterns[] = '(\b(?i)www?(?-i)\.[' . $host . ']+?\.[' . $host . ']+?[' . $any . ']+?(?=[' . $punc . ']*[^' . $any . ']))'; + $patterns[] = '(\b(?i)ftp?(?-i)\.['. $host . ']+?\.[' . $host . ']+?[' . $any . ']+?(?=[' . $punc . ']*[^' . $any . ']))'; I am not that experienced with PHP, but this looks like the $patterns array got replaced instead of extended. + + $regex = '/' . implode('|', $patterns) . '/msS'; + + $comment = htmlspecialchars($comment); Won't this render the next instruction useless if there are html-characters in a link? + $comment = preg_replace_callback($regex, parse_link, $comment . \n); + $comment = nl2br($comment); + + return $comment; +} diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index 02171a0..2ca9bf0 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -20,7 +20,7 @@ while (list($indx, $carr) = each($comments)) { ? ?/div blockquote class=comment-body div -?php echo nl2br(htmlspecialchars($carr['Comments'])) ? +?php echo parse_comment($carr['Comments']) ? /div /blockquote ?php Generally I would not make hostnames (www.foo.tld) clickable. If people are not able to provide proper URL's, they have a serious problem. (there is also the technical argument that the hostname is not a good indicator for the kind of service the host provides.) Regards, PyroPeter -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).
On 09/30/2010 06:38 PM, Lukas Fleischer wrote: On Thu, Sep 30, 2010 at 06:18:24PM +0200, PyroPeter wrote: + $url = str_replace('','amp;', $url); + $url = str_replace('amp;amp;', 'amp;', $url); What about the occurrences of amp;(html-entity-code-here); you produced the line before? Nothing? Any occurrence of an HTML entity code is correctly encoded as amp;. People shouldn't be able to manually insert HTML entities in comments. The first line is actually even superfluous as I realized just now since ampersands should already have been replaced by htmlspecialchars() before at the time this line is executed (didn't check that before, this part of code has been extracted from the DokuWiki plugin). Well, but you are encoding existing entities, that are not amp; as amp;foo;. See the example below. + $patterns[] = '(\b(?i)www?(?-i)\.[' . $host . ']+?\.[' . $host . ']+?[' . $any . ']+?(?=[' . $punc . ']*[^' . $any . ']))'; + $patterns[] = '(\b(?i)ftp?(?-i)\.['. $host . ']+?\.[' . $host . ']+?[' . $any . ']+?(?=[' . $punc . ']*[^' . $any . ']))'; I am not that experienced with PHP, but this looks like the $patterns array got replaced instead of extended. Nope, it doesn't. Check [1]. I see, $var[] = foo creates the array $var if necessary and appends foo. + $comment = htmlspecialchars($comment); Won't this render the next instruction useless if there are html-characters in a link? Nope. Links need to be escaped as well. Not sure what happens if a link contains quotes or /. This shouldn't happen too often tho. Imo, you should split the message at the link boundaries. ( foo , http://foo.bar.tld;, baz) Then you should encode the html-entities in all elements, wrap the links in a's, and then join all that together. I can not think of a way to connect a-tags with proper encoding of the user input using just normal string functions like replace, or regexes. I would be happy if you could prove the opposite, and will help by providing you with input that breaks your system. == example 1 == input: foo http://foo.tld/iLikeToUseApersands/foobar.html baz If I am not mistaken, $regex would be /http://foo.tld/iLikeToUseApersands/foobar.html/msS; (are the / correctly escaped? I will assume they are.) Then, $regex would be: /http:\/\/foo\.tld\/iLikeToUseApersands\/foobar\.html/msS $comment would be set by htmlspecialchars() to: foo http://foo.tld/iLikeToUseApersands/fooamp;bar.html baz = preg_replace_callback() would not match, as got replaced. Generally I would not make hostnames (www.foo.tld) clickable. If people are not able to provide proper URL's, they have a serious problem. (there is also the technical argument that the hostname is not a good indicator for the kind of service the host provides.) Why not? What if you explicitly want to link to a project's home page? It'll also just convert hostnames if they start with a www or ftp subdomain, so comments refering to domains in other ways won't be converted. You can also link to a homepage using valid URL's. The additional feature may be nice, but makes the code more complex. It also trains users to omit the http://; and produces more work for devs, as they all now have to parse this invalid hostname+path stuff. Unrelated: You seem to accept only a-zA-Z in hostnames? Or does PHP's \w include 0-9 and language-dependent letters? What about underscores? Why does the a's content only include the Path of the URL? Regards, PyroPeter -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] AUR update
On 09/30/2010 09:34 PM, Manuel Tortosa wrote: On Thursday 30 September 2010 19:51:12 Lukas Fleischer wrote: On Thu, Sep 30, 2010 at 11:16:55PM +0530, Gaurish Sharma wrote: OMG!! I already told Manuel about this security vulnerability yesterday [1]. He didn't seem to do anyting against it yet tho. My advice is not to include any of those patches without proper review. [1] http://mailman.archlinux.org/pipermail/aur-dev/2010-September/001242.html I tried to do something but i failed. i removed this completelly and changed all the password and so but now i'm completelly disolated.. There were no passwords in that file. (They are saved in /etc/shadow) Without that file your server won't boot. Regards, PyroPeter -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] [PATCH] adding better validation of emailadress
On 09/29/2010 04:11 PM, Psykal wrote: This patch check the email address for more criteria. But it does not parse all valid email addresses. Iirc, you are allowed to put the username part in quotes/doubleticks ( foo@bar.tld) Also, you seem to allow only lowercase letters, digits, - and _. Have you thought about foo.@baz.tld and füü...@baz.tld? What about the mobi tld? Regards, PyroPeter -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] [PATCH] Add PKGBUILD Syntax Highlighting
On 09/29/2010 01:33 PM, Manuel Tortosa wrote: This patch adds pkgbuild syntax highlighting using geshi. Requisites: GeShi, the latest version the better, works with all versions http://sourceforge.net/projects/geshi/files/geshi/GeSHi%201.0.8.9/GeSHi-1.0.8.9.tar.gz/download You don't need the whole extension, just: geshi.php - lib/geshi.php bash.php - lib/geshi/bash.php Best Regard. I found that link to the raw PKGBUILD very useful in some cases, so I would appreciate it if it was kept. (e.g. Tarball :: Files :: view PKGBUILD :: download PKGBUILD) Regards, PyroPeter -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] small translation problem
On 09/26/2010 03:31 AM, Loui Chang wrote: Nope there's no automatic cleaning of the translation files, so they may very well contain duplicate and obsolete strings. I'd welcome contributors for such a task. The translation related scripts and functionality could use some attention too. How do you translators translate? I edited the .po file directly, is someone using the translation_tool? I created some scripts that parse the .po files and search the code for usage of the __() function. (I know there was code for this before, but it would take me less time to rewrite it then to understand and adapt the old code, my code also is modular) The scripts then search for obsolete translations and untranslated strings. [1] Based on that I could write a script that rewrites the *.po files (only the required strings). It could also reorganize the strings into sections of strings used by the same template (which would help translating, if one edits the .po file directly) It would be easy to write a script that allows to change some strings in the .po files without loosing the translations. (It could also be told to copy the translations to a second string, which would be what we need to solve the Submit issue) Regards, PyroPeter [1] http://gist.github.com/597985 -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] small translation problem
On 09/21/2010 09:56 PM, Stefan Husmann wrote: Hello, in AUR 1.7.0 there is a bad translation for the submit button for submitting comments. Paket hochladen means Upload Package. Here is a patch. Regards Stefan diff -Naur aur-1.7.0.orig//web/lang/de.po aur-1.7.0.new/web/lang/de.po --- aur-1.7.0.orig//web/lang/de.po 2010-09-21 21:42:46.0 +0200 +++ aur-1.7.0.new/web/lang/de.po2010-09-21 21:47:12.0 +0200 @@ -134,7 +134,7 @@ $_t[Update] = Aktualisieren; -$_t[Submit] = Paket hochladen; +$_t[Submit] = Abschicken; $_t[Password] = Passwort; I changed that to Paket hochladen, because header.php uses Submit too (for the button that leads to the package upload). Maybe Abschicken is the best translation here, as it does not sound that wrong with packages. The problem is, if you are new to AUR, the meaning of a link titled Abschicken in the header is not obvious. In my opinion there should be an english translation, which would enable us to include the template name in $_t's keys. (like $_[header: submit] vs. $_[pkg_comment_form: submit]) This would also make life for translators easier, as they would have additional information about where a string is used. Btw. has someone checked for duplicate entries in the .po files? When I read de.po, I had the impression of about 40% being redundant. Are obsolete entries removed automatically? Regards, PyroPeter -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] Adding the HE language.
On 08/17/2010 04:51 PM, PyroPeter wrote: Sorry for that, I will try to avoid that in the future. I am now splitting the commit into smaller ones. Attached are the first four patches: 0001. 00e497a pkg_search_results: rewrite of page navigation 0002. b65a5a3 pkg_search_results: increase size of links in page-navigation 0003. df02d42 pkg_search_results: replace blind-table with floating div's 0004. 76a874a Right-to-left written languages now supported ~~PyroPeter Is there something wrong with the patches? Or do I just lack patience once again? -- freenode/pyropeter 12:50 - Ich drücke Return.
Re: [aur-dev] Adding the HE language.
+select name='action' +option?php print __(Actions) ?/option +option value='do_Flag'?php print __(Flag Out-of-date) ?/option +option value='do_UnFlag'?php print __(Unflag Out-of-date) ?/option +option value='do_Adopt'?php print __(Adopt Packages) ?/option +option value='do_Disown'?php print __(Disown Packages) ?/option +?php if ($atype == Trusted User || $atype == Developer): ? +option value='do_Delete'?php print __(Delete Packages) ?/option +?php endif; ? +option value='do_Notify'?php print __(Notify) ?/option +option value='do_UnNotify'?php print __(UnNotify) ?/option +/select +?php if ($atype == Trusted User || $atype == Developer): ? +input type='checkbox' name='confirm_Delete' value='1' / ?php print __(Confirm) ? +?php endif; ? +input type='submit' class='button' value='?php print __(Go) ?' / +/div ?php endif; ? - /td - - td align='right' - span class='f4'span class='blue' - ?php print __(Showing results %s - %s of %s, $first, $last, $total) ? - /span/span +/div +div class=thatOtherBar + span class='f4' +span class='blue' +?php print __(Showing results %s - %s of %s, $first, $last, $total) ? +/span +/span br / div id=pages - ?php - if ($_GET['O'] 0): - $O = $_GET['O'] - $_GET['PP']; - - if ($_GET['O'] $_GET['PP']) { - $O = 0; - } - ? +?php +if ($_GET['O'] 0): +$O = $_GET['O'] - $_GET['PP']; + +if ($_GET['O'] $_GET['PP']) { +$O = 0; +} +? a class=page_num href=packages.php??php print mkurl(O=$O) ??php echo __('Previous') ?/a - ?php endif; ? +?php endif; ? ?php if ($_GET['PP'] 0) { @@ -174,15 +171,11 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { ?php endif; ? /div - - /td - /tr - ?php } } ? - /table +/div /div /form -- snap --- As AUR is a system mainly used by users of a bleeding-edge distro, I assumed everyone is using a browser supporting CSS 3. The search-results table looks pretty much like http://www.archlinux.org.il/packages/?q=foo now. I will now start to check the package-details page. -- irc: PyroPeter at freenode
Re: [aur-dev] Adding the HE language.
On 08/15/2010 02:29 PM, PyroPeter wrote: This is what I have now: (long patch) As AUR is a system mainly used by users of a bleeding-edge distro, I assumed everyone is using a browser supporting CSS 3. The search-results table looks pretty much like http://www.archlinux.org.il/packages/?q=foo now. I will now start to check the package-details page. Attached is a patch that adds Right-To-Left-support. From the commit message: This replaces most parts of pkg_search_results.php, as this file was the first one I looked at more closely that had great flaws: * The obscure page-number-generation-code was rewritten and moved to pkgfuncts.inc * There are no more Next and Previous buttons, imo they are redundant. * The links now cover the whole page range, not just the pages next to the current one. * The blind-table in the footer was replaced by floating divs to allow proper RTL-support. * The odd rows of the results-table are now made darker with means of CSS 3. Every arch-user's browser should support this. * The page is now valid HTML even if there are no results. * Removed all tdspanspancontent/span/span/td-like oddities. td is an inline element by itself, there is no need to place a span in there. Two of them make even less sense. * Removed reoccurring style-attributes. Adopted CSS to do the same. * Changed indention to something (imo) senseful. Indention is now done like in HTML; If there is an 'if' or 'for' in the PHP-code, the affected HTML-elements are also indented. If someone considers my indention scheme to be senseful, I would add an explaination to HACKING. Regards, PyroPeter -- irc: PyroPeter at freenode 0001-RTL-support-CSS-cleanup-search-results-page-partiall.patch.gz Description: GNU Zip compressed data
Re: [aur-dev] Adding the HE language.
On 08/14/2010 02:28 PM, foo bar wrote: On 08/08/2010 12:17 AM, Netanel Shine wrote: btw, it should be RTL, if you didnt know, mybe because of that it display like a bug. If we set the lang-attribute on the body-tag, we can use CSS to swich the whole body to direction:rtl;. (Somehow my chromium does not check the xml-tag's lang-attribute.) This is demonstrated here: http://keks.selfip.org/tmp/aur-lang.html I will upload a patch for that shortly. http://keks.selfip.org/tmp/aur-lang.html I just noticed you are setting xml:lang and lang on the html-tag. So there isn't even any change needed. (Btw. that why I hate php, mixing markup and code is extremely obscure) The main problem seems to be the frequency of text-align-declarations in the existing style-sheets. This is what I have atm: snip - diff --git a/web/html/css/containers.css b/web/html/css/containers.css index fc092de..fe7d26b 100644 --- a/web/html/css/containers.css +++ b/web/html/css/containers.css @@ -3,6 +3,12 @@ body,table,td,img { margin: 0; padding: 0; } + +/* Language specific formatting */ +body:lang(hu) { + direction:rtl; +} + /* Main Wrapper Data Format */ td.preHeader { background-color: #000; --- snap -- It would be nice to get some comments from right-to-left reading people. Why does direction:rtl; put punctuation at the beginning of the line? Is that wanted behavior or just a browser bug? -- irc: PyroPeter at freenode
Re: [aur-dev] Adding the HE language.
On 08/14/2010 03:24 PM, PyroPeter wrote: I just noticed you are setting xml:lang and lang on the html-tag. So there isn't even any change needed. (Btw. that why I hate php, mixing markup and code is extremely obscure) The main problem seems to be the frequency of text-align-declarations in the existing style-sheets. This is what I have atm: (long diff is long) It would be nice to get some comments from right-to-left reading people. Why does direction:rtl; put punctuation at the beginning of the line? Is that wanted behavior or just a browser bug? I made a typo, correct patch: snip - diff --git a/web/html/css/containers.css b/web/html/css/containers.css index fc092de..4707dac 100644 --- a/web/html/css/containers.css +++ b/web/html/css/containers.css @@ -3,6 +3,10 @@ body,table,td,img { margin: 0; padding: 0; } +/* Language specific formatting */ +body:lang(he) { + direction:rtl; +} /* Main Wrapper Data Format */ td.preHeader { background-color: #000; snap - What distinguishes the four different css-files? What is the sense of having style-declarations in the html/php-soup? -- irc: PyroPeter at freenode
Re: [aur-dev] Patch: German translation and CSS fixes
On 08/07/2010 02:54 AM, PyroPeter wrote: On 08/07/2010 02:52 AM, PyroPeter wrote: Hello AUR developers, appended is a patch that fixes some bugs in the german translation. There is also a patch that makes the Search-Form-buttons use a variable width to enable the german translation for Orphans (Verwaiste Pakete) to actually fit in there. As I have no idea how to get the AUR-software running, I did not test this changes. It would be nice if one of you could apply, test and push my patches. Regards, PyroPeter Maybe I will succeed this time... Could you please respond to this? Especially if you reject my patches, it would be nice to hear why. -- irc: PyroPeter at freenode
Re: [aur-dev] Adding the HE language.
On 08/08/2010 07:08 PM, Netanel Shine wrote: Not exactly. you can see in the israeli archlinux communiuty : http://archlinux.org.ilhow the page is RTL (not like the main site of arch.) for now you could deploy to translation (yep, meantime in LTR) but we should all work for working RTL Support. The israeli community is the first archlinux community which based on RTL language. 2010/8/8 Ng Oon-Eengoo...@gmail.com On Sun, 2010-08-08 at 12:33 -0400, Loui Chang wrote: On Sun 08 Aug 2010 06:21 +0300, Netanel Shine wrote: For the non-translate strings ill send you a patch, but we have another problem, its shows ok, but it should be RTL not LTR. can you do it some way that if use will choose hebrew the page will become to be RTL? I would appreciate your help with this. I'm not really sure what the issues are. Maybe I'll interject at this point. The issue with Hebrew (as with some other Arabic languages) is that the words are read right-to-left. I would assume the translations submitted by Netanel Shine need to be 'read' right-to-left as well. I'm not sure how the AUR does things (how the translation units are) but would a suitable 'hack' be for the translations themselves to be in reverse order? So for example the English A B C would be translated as the Hebrew c b a? It seems like it would be a good idea to add direction:rtl; to the CSS. This makes text right-aligned and cuts off text at the right side. -- irc: PyroPeter at freenode
[aur-dev] Patch: German translation and CSS fixes
Hello AUR developers, appended is a patch that fixes some bugs in the german translation. There is also a patch that makes the Search-Form-buttons use a variable width to enable the german translation for Orphans (Verwaiste Pakete) to actually fit in there. As I have no idea how to get the AUR-software running, I did not test this changes. It would be nice if one of you could apply, test and push my patches. Regards, PyroPeter -- irc: PyroPeter at freenode
Re: [aur-dev] Patch: German translation and CSS fixes
On 08/07/2010 02:52 AM, PyroPeter wrote: Hello AUR developers, appended is a patch that fixes some bugs in the german translation. There is also a patch that makes the Search-Form-buttons use a variable width to enable the german translation for Orphans (Verwaiste Pakete) to actually fit in there. As I have no idea how to get the AUR-software running, I did not test this changes. It would be nice if one of you could apply, test and push my patches. Regards, PyroPeter Maybe I will succeed this time... -- irc: PyroPeter at freenode 0001-Make-german-translation-sound-less-like-english.patch.gz Description: GNU Zip compressed data 0002-Fix-the-search-button-to-allow-captions-wider-than-8.patch.gz Description: GNU Zip compressed data