Hi all
though phpcs with PMAStandard does already cover this, it seems to be necessary to mention it explicitely:
Please don't wrap translatable strings to fit into 85 chars width limits. It just causes further troubles (the strings are translated with newlines and indentation what looks weird). The PMAStandard should ignore such lines from checking for line length (if it does not please tell me, it's a bug in the rules).
On Tue, May 29, 2012 at 1:21 PM, Michal Čihař michal@cihar.com wrote:
Hi all
though phpcs with PMAStandard does already cover this, it seems to be necessary to mention it explicitely:
Please don't wrap translatable strings to fit into 85 chars width limits. It just causes further troubles (the strings are translated with newlines and indentation what looks weird). The PMAStandard should ignore such lines from checking for line length (if it does not please tell me, it's a bug in the rules).
Hi Michal, I noticed that PMAStandard ignores lines with translatable strings only if the overflowing "translatable string" part in the line has more chars than a "certain number". Although if the line starts with a translatable string longer than 85 chars, the "certain number" limit is mostly crossed, so PMAStandard ignores it mostly.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Hi
Dne Tue, 29 May 2012 13:44:48 +0530 Atul Pratap Singh atulpratapsingh05@gmail.com napsal(a):
I noticed that PMAStandard ignores lines with translatable strings only if the overflowing "translatable string" part in the line has more chars than a "certain number".
Yes, if translatable string is at least 40 chars long, this line is not considered for line length check. Otherwise I think it could be easily split so that it does not violate anything.
2012/5/29 Michal Čihař michal@cihar.com:
Hi all
though phpcs with PMAStandard does already cover this, it seems to be necessary to mention it explicitely:
Please don't wrap translatable strings to fit into 85 chars width limits. It just causes further troubles (the strings are translated with newlines and indentation what looks weird). The PMAStandard should ignore such lines from checking for line length (if it does not please tell me, it's a bug in the rules).
Hi Michal,
It's a good thing to have an ignore rule for this, but by using splitting and concatenation of string (example below), it might not be necessary :
$text = __('This is an example of a very long translatable string' . ' that is too long to fit on one line, so wrapping of long lines' . 'is neccessary.');
But I'm not sure if this triggers other rules (like the one where the argument of a multiline function call should start on a new line), so it probably is best to use the ignore rule you added for translatable string. Besides, if it gets to complicated developers will forget what the correct way is of wrapping a translatable string, so not wrapping them at all is probably best.
Kind regards,
Dieter
Hi
Dne Tue, 29 May 2012 12:04:11 +0200 Dieter Adriaenssens dieter.adriaenssens@gmail.com napsal(a):
It's a good thing to have an ignore rule for this, but by using splitting and concatenation of string (example below), it might not be necessary :
$text = __('This is an example of a very long translatable string' . ' that is too long to fit on one line, so wrapping of long lines' . 'is neccessary.');
Indeed this works fine. What I would like to avoid is:
$ text = __(' This is an example of a very long translatable string that is too long to fit on one line, so wrapping of long lines is neccessary. ');
This pulls indentation and new lines into translatable strings and will only cause pain in future.