Update:Remora Standards: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎l10n: moved l10n to the l10n page)
 
Line 29: Line 29:


= l10n =
= l10n =
* If the string is a "widget" as defined in the shavictionary: (labels, common navigational elements like "Home" or "Top" or "Next")
see the [[Update:Remora Localization|remora localization page]].
**element_name_additional
 
*If the string is prose for explanations, error messages, instructions
**type_name_additional
 
*If the string is structural text like headers, titles, breadcrumbs, etc.
**If the string is not in a form:
***namespace_pagename_name_additional
**If the string is inside of a form:
***namespace_pagename_formname_element_name_additional
 
Where:
*namespace is the location in cake of the view, so if it's under /views/developers/ the namespace is "developers"
*pagename is the name of the file, with underscores taken out
*formname is just what you think the form should be called with "form" appended, since cake is actually naming them... (should we make this more specific?)
*name is a unique name for the element (preferably its id)
*element is the closest tag or parameter, so for an images alt tag it would be "alt". For a label it would be "label"
*additional is anything else needed to make a string unique
*type is a global category, like "error"

Latest revision as of 23:16, 23 October 2006

« Back to Update:Remora

Style

Follow the PEAR Coding Standards with one exception:

No new line at EOF

Leaving a new line at the end of a .php file after the ?> will make horrible things happen for HTTP headers. Do not follow this standard.

(In that case, the PHP documentation suggests removing the closing tag at the end of the file altogether.)

Comments and PHPDoc

  • Read and understand the PHPDoc reference when needed.
  • Make a concerted effort to [write out comments], especially before function definitions. Bare minimum comments for function defs:
    • What it is for
    • @param - define all inputs and their type/purpose
    • @return - define all retvals and their type/purpose
  • // style comments can be used for smaller statements, just footnotes. If the footnote turns into an essay, use /** */

HTML

HTML 4.01 Strict. Close and nest your tags correctly, as if you were writing XHTML.

CSS

Valid

JavaScript

No errors with javascript.options.strict set to true

Testing

l10n

see the remora localization page.