[Fusionforge-general] String Case Format Rules Proposition

Franck Villaume franck.villaume at trivialdev.com
Fri May 3 18:34:48 CEST 2013


Hi all,

In Fusionforge source code, all contributors currently follow their own 
rules about string case format.

Some samples found in the source code.

$error_msg = _('Error: Please confirm the deletion of the role.');
$error_msg = _('ERROR - both subject and body are required');
$error_msg = _('ERROR doing insert');
$this->setError('ERROR: You can\'t set pending status if user is suspend 
or active');
$error_msg .= _('Error') . _(': ') . $acr->getErrorMessage();
$feedback .= _('Canned Response Deleted');

A little bit of consistency may help us for translations.
My proposition (valid for the source code only):

1) no more all CAPS word.
2) A sentence ends by a period '.'
3) First letter of the first word has capital case.
4) We use only one colon ':' between level of information and message.
5) There is no space between level of information and the colon.
6) level of information + colon = one word.
7) There is one space between the colon and the message.
8) gettext must be used as much as possible. Add a comment in your code 
to specify when not using gettext.

If I apply these rules on the above samples, I get :
$error_msg = _('Error: please confirm the deletion of the role.');
$error_msg = _('Error: both subject and body are required.');
$error_msg = _('Error: doing insert.');
$this->setError(_('Error: you can\'t set pending status if user is 
suspend or active'));
$error_msg .= _('Error:').' '.$acr->getErrorMessage();
$feedback .= _('Canned response deleted.');


I'm fully aware all rules wont apply for each translation. (I dont know 
about german punctuation rules)

Do not hesitate to make better proposition.


Regards,
Franck


-- 
TrivialDev Founder
http://trivialdev.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: franck_villaume.vcf
Type: text/x-vcard
Size: 211 bytes
Desc: not available
URL: <http://lists.fusionforge.org/pipermail/fusionforge-general/attachments/20130503/b7aba96f/attachment.vcf>


More information about the Fusionforge-general mailing list