1,068
edits
| 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: | ||
* | * .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 | |||
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" | |||
;Getting Started | ;Getting Started | ||
Débuter | Débuter | ||
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 | *# cannot use po editor, which most localizers know and love | ||
=== Example 3: gettext === | === Example 3: gettext === | ||
edits