Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:l10n [2007/10/01 09:50]
prabath
dev:l10n [2009/07/06 20:36] (current)
Line 65: Line 65:
 <?=_($org)?> <?=_($org)?>
 </code> </code>
 +
 +
 +
 +
  
 ===== gettext Best Practices ===== ===== gettext Best Practices =====
  
-  - Please make sure gettext contain only word phrases.  +    * 1. Please make sure gettext contain only word phrases.  
-  If there are html tags which we have to put within word phrase make sure to separate it from gettext.  + 
-  When writing paragraph within gettext make sure line brakes are not there (In this case line breaks are behave in  different ways in different editors for instance Eclipse put line break when you press enter but Qunata won't put line break but it'll wrap it).  +<code php> 
-  - Html special characters should separate from gettext. +e.g: 
-  Beware of quotation marks please put html special characters for quotation marks(Quotation marks are always bother   developers) +_('<h2>Welcome to the Sahana FOSS Disaster Management System</h2>'); 
 + 
 +this should be, 
 +echo "<h2>"._('Welcome to the Sahana FOSS Disaster Management System')."</h2>"; 
 +</code> 
 + 
 +    * 2. If there are html tags which we have to put within word phrase make sure to separate it from gettext. (see above example)  
 + 
 +    * 3. When writing paragraph within gettext make sure line brakes are not there (In this case line breaks are behave in  different ways in different editors for instance Eclipse put line break when you press enter but Qunata won't put line break but it'll wrap it).  
 + 
 +<code php> 
 +e.g: 
 +Eclipse behave as follows 
 +_("The SAHANA Disaster Victim Registry is a central online repository " . 
 +"where information on all the disaster victims can be stored. Information like name, age" . 
 +", contact number, id card number, religion, race, displaced location, current location and other ") 
 + 
 +This paragraph appears in sahana.po file in separate lines,not in a paragraph.Solution for Eclipse IDE users is   
 +writing the paragraph in same line. 
 +  
 +Quanta will wrap this paragraph and appears in sahana.po file as a paragraph,which is allright :-) . 
 + 
 +</code> 
 + 
 +    * 4. Html special characters should separate from gettext. 
 +    * 5. Beware of quotation marksplease put html special characters for quotation marks(Quotation marks are always bother developers :-))  
  
 Rule of thumb is to keep contain of gettext as simple as possible Rule of thumb is to keep contain of gettext as simple as possible

Navigation
QR Code
QR Code dev:l10n (generated for current page)