Difference between revisions of "Karma/i18n"

From Sugar Labs
Jump to navigation Jump to search
Line 4: Line 4:
 
* Integrate with pootle
 
* Integrate with pootle
 
* Handle strings inside code and html markup
 
* Handle strings inside code and html markup
 +
  Examples
  
=== Technical Requirements ===
+
  $("#someDiv").text(gettext("Hello World"));
* All strings stored in one file, messages.json
+
 
*  
+
  <div>Hello <strong>W</strong>orld</div>
 +
 
 +
* All strings stored in one file per locale, messages.json
 +
* All message identifiers must be unique within an a lesson
 +
* Accommodating numeric, currency, and date formatting is not an immediate requirement
  
 
=== General Strategy ===
 
=== General Strategy ===
 
+
* Use a modified version of gettext, where the key for getting translations, we will use an arbitrary message identifier. This will remove the need for managing translation contexts.
Lesson to use for prototyping
+
* We will try to use the [http://en.wikipedia.org/wiki/Internationalization_Tag_Set Internationalization Tag Set] for handling strings inline with html. The [http://okapi.sourceforge.net/ Okapi] tool may be able to parse out strings marked with ITS.
examples/6_Maths_matchingAnglesAndShapes/
+
* We will use this lesson for prototyping examples/6_Maths_matchingAnglesAndShapes/
 +
* For the immediate future we will dynamically change out strings per locale on page load

Revision as of 09:31, 24 February 2010

Rough plan for implementing i18n for Karma

Requirements

  • Integrate with pootle
  • Handle strings inside code and html markup
 Examples 
 $("#someDiv").text(gettext("Hello World"));
 
Hello World
  • All strings stored in one file per locale, messages.json
  • All message identifiers must be unique within an a lesson
  • Accommodating numeric, currency, and date formatting is not an immediate requirement

General Strategy

  • Use a modified version of gettext, where the key for getting translations, we will use an arbitrary message identifier. This will remove the need for managing translation contexts.
  • We will try to use the Internationalization Tag Set for handling strings inline with html. The Okapi tool may be able to parse out strings marked with ITS.
  • We will use this lesson for prototyping examples/6_Maths_matchingAnglesAndShapes/
  • For the immediate future we will dynamically change out strings per locale on page load