wiki:DevelopersGuide/StyleGuide

Version 7 (modified by stoecker, 16 years ago) ( diff )

Typos

Development Guidelines

How your code should look like

  • make sure the code is Java 1.5 compatible: no missing @Override or @Deprecated
  • make sure there is no trailing white space
  • don't use multiple consecutive empty lines

Configuring Eclipse

No image "ss4.jpg" attached to DevelopersGuide/StyleGuide

Internationalization

  • make sure you use use tr(...) for all localized strings
    import import static org.openstreetmap.josm.tools.I18n.tr;
    
    threw new Exception(tr("error message always in tr()"));
    
    new JLabel(tr("Label always in tr()"));
    
    // etc.
    
  • never assemble localized messages with +. Use format placeholders instead.

DONT new JLabel(tr("My Label " + labelId));

DO new JLabel(tr("My Label {0}",labelId));

Only exception: + can be used to break long lines of non-variable texts.

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.