L10n:Localizability/Web: Difference between revisions

Jump to navigation Jump to search
Line 71: Line 71:
=== Example 2: .lang files ===
=== Example 2: .lang files ===


Historically, Mozilla has used a gettext-like file to present content for localization.   
Historically, Mozilla has used a gettext-like file to present content for localization.  .lang files provide some features that differentiate it from Gettext:


*# not dependent on PHP .po library...if our webdev team set up a site without gettext support, we still have .lang but this is a near impossibility
* .lang is not dependent on PHP/.po library, so if our webdev team set up a site without Gettext support, we still have .lang.  (It should be noted that this is a near impossibility since most sites will be set up with Gettext support.)
* .lang files can be edited in a text editor


*# .lang  edit in a text edit
With this setup, a localizer is given a "[something].lang" file containing all the strings needing localization.  That file will have the following structure:
 
With this setup, a localizer is given a "[something].lang", which will have the following structure:


   ;Getting Started
   ;Getting Started
   Débuter
   Débuter


Where the English content is designated by the semi-colon and the localizer provides the translation.  That content is placed into an array that is called by the PHP code later.   
The English content is designated by the semi-colon and the localizer provides the translation underneath.  That content is placed into an array that is called by the PHP code later.   


   $array["Getting Started"] = "Débuter"
   $array["Getting Started"] = "Débuter"
Line 108: Line 107:
*#  not used as a standard by any other localization project
*#  not used as a standard by any other localization project
*#  no tools to validate syntax, so a localizer may cause accidental errors that can cause breakage (level of breakage depends on level of error)
*#  no tools to validate syntax, so a localizer may cause accidental errors that can cause breakage (level of breakage depends on level of error)
*#  cannot use po editor, which most localizers have and are familiar with using
*#  cannot use po editor, which most localizers know and love


=== Example 3: gettext ===
=== Example 3: gettext ===

Navigation menu