aboutsummaryrefslogtreecommitdiff
path: root/files/ru/mozilla/localization/web_localizability/localization_formats/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ru/mozilla/localization/web_localizability/localization_formats/index.html')
-rw-r--r--files/ru/mozilla/localization/web_localizability/localization_formats/index.html171
1 files changed, 0 insertions, 171 deletions
diff --git a/files/ru/mozilla/localization/web_localizability/localization_formats/index.html b/files/ru/mozilla/localization/web_localizability/localization_formats/index.html
deleted file mode 100644
index 73b6f46846..0000000000
--- a/files/ru/mozilla/localization/web_localizability/localization_formats/index.html
+++ /dev/null
@@ -1,171 +0,0 @@
----
-title: Localization formats
-slug: Mozilla/Localization/Web_Localizability/Localization_formats
-translation_of: Mozilla/Localization/Web_Localizability/Localization_formats
----
-<p>{{ Warning("This document pertains to the developemt of Mozilla web sites and not to the development of Gecko-based extensions or applications.") }}</p>
-
-<p>There are 4 main approaches to web l10n with regards to the choice of technology used for localization logic:</p>
-
-<ol>
- <li>HTML/PHP</li>
- <li>.lang</li>
- <li>gettext (.po)</li>
- <li>wiki (TBD)</li>
-</ol>
-
-<p>The choice of the filetype depends on a couple of factors:</p>
-
-<ul>
- <li>How much content is there to be localized?</li>
- <li>How often, if at all, the site will be updated after the launch?
- <ul>
- <li>Is this a long-term project with continuous updates to content?</li>
- <li>Is this a long-term project with stable content?</li>
- <li>Is this a short-term project?</li>
- </ul>
- </li>
- <li>Will the content differ per locale? If so, to what extent?</li>
-</ul>
-
-<p>As every new web-dev project takes shape, a project manager should ask themselves these questions and have the answers ready before starting the web l10n process.</p>
-
-<h2 id="HTMLPHP"><span class="mw-headline">HTML/PHP </span></h2>
-
-<p>Возможно, вы проектируете проект с относительно небольшими потребностями перевода, например, от трех до четырех строк (или более) контента, требующего от пользователей обновления до следующей версии доступного программного обеспечения. Вы можете представить только HTML для локализации:</p>
-
-<p>We give an HTML file which lists several pieces of content like,</p>
-
-<pre> &lt;H1&gt;Getting Started&lt;/H1&gt;
-</pre>
-
-<p>and the localizer translates to</p>
-
-<pre> &lt;H1&gt;Débuter avec Firefox&lt;/H1&gt;
-</pre>
-
-<p>The localizer then submits the translated HTML or PHP back to us by either checking in changes to SVN or sending us a patch that Pascal checks in.</p>
-
-<h3 id="Advantages_to_HTML"><span class="mw-headline">Advantages to HTML</span></h3>
-
-<ol>
- <li>Good for small projects</li>
- <li>Very simple for web developers</li>
- <li>Gives localizers the exact context of translations</li>
- <li>A localizer who knows basic HTML can style translations to make sure translations display correctly...we can allow slight modifications (e.g. RTL or wider display)</li>
- <li>Gives the possibility to customize content per locale</li>
- <li>Simple workflow, just put the file on svn and it can appear on the staging server</li>
-</ol>
-
-<h3 id="Disadvantages_to_HTML"><span class="mw-headline">Disadvantages to HTML</span></h3>
-
-<ol>
- <li>Very hard for QA
- <ul>
- <li>If localizer changes something incorrectly (i.e. accidentally removes some HTML like <code>&lt;/h1&gt;</code>, that localizer can break everything.)</li>
- </ul>
- </li>
- <li>Very hard to update automatically, if not impossible.</li>
- <li>Can be hard to tell what has changed</li>
-</ol>
-
-<h2 id=".lang_files"><span class="mw-headline">.lang files </span></h2>
-
-<p>Historically, Mozilla has used a gettext-like file to present content for localization. .lang files provide some features that differentiate it from Gettext:</p>
-
-<ul>
- <li>.lang is not dependent on PHP/.po library, so if our webdev team sets up a site without gettext support, we still have .lang. (It should be noted that this is near impossibility since most sites will be set up with gettext support.)</li>
- <li>.lang files can be easily edited in a text editor</li>
-</ul>
-
-<p>With this setup, a localizer is given a "[something].lang" file containing all the strings needing localization. That file will have the following structure:</p>
-
-<pre> ;Getting Started
- Débuter avec Firefox
-</pre>
-
-<p>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 used by the PHP code later.</p>
-
-<pre> $array["Getting Started"] = "Débuter avec Firefox"
-</pre>
-
-<p>The PHP code searches the array and returns the translation that is associated with the English term used by the web developer.</p>
-
-<p>See the example below.</p>
-
-<pre> &lt;H1&gt;&lt;?PHP echo ___("Getting Started")?&gt;&lt;/H1&gt;
- function ___($str) {
- return $array[$str];
- }</pre>
-
-<h3 id="Advantage_to_.lang"><span class="mw-headline">Advantage to .lang</span></h3>
-
-<ol>
- <li>Simple work-flow allowing the web developer to place the file in SVN and it can appear on the staging server</li>
- <li>.lang syntax is like simplified .po, which many localizers who are familiar with linux and other projects understand</li>
- <li>Mozilla has a basic tool called main.lang checker, which can show any untranslated files to the localizer</li>
- <li>no need to compile to .mo file so a localizer can see his/her changes more quickly</li>
- <li>creating simple diffs</li>
- <li>.lang files will be cached which will reduce any slowness effect</li>
-</ol>
-
-<h3 id="Disadvantage_to_.lang"><span class="mw-headline">Disadvantage to .lang</span></h3>
-
-<ol>
- <li>no plural forms</li>
- <li>no context for localizers unless you provide good comments</li>
- <li>no styling by localizers if it is needed</li>
- <li>may be slower because file is not compiled into binaries</li>
- <li>not used as a standard by any other localization project</li>
- <li>no tools to validate syntax, so a localizer may cause accidental errors that can cause breakage (level of breakage depends on level of error)</li>
- <li>cannot use po editor, which most localizers know and love</li>
-</ol>
-
-<h2 id="gettext_(.po)"><span class="mw-headline">gettext (.po) </span></h2>
-
-<p>Gettext is a widely-used localization format that uses .po files. With this arrangement, content for localization is presented in the following manner:</p>
-
-<pre> msgid "coming soon"
- msgstr "Bientôt disponible"
-</pre>
-
-<p>where the value in the "" of the <code>msgid</code> is the English content, and the value in the "" of the <code>msgstr</code> is the translation. <code>msgstr</code> can be longer translations than just the exact above. For example, below is the entire introduction used for a certificate that was presented to those who downloaded Firefox during the Download Day campaign. The French content runs three lines:</p>
-
-<pre> msgid "certificate_intro"
- msgstr ""
- "Merci de nous avoir aidé à établir ce record du monde ! "
- "Allez-y et montrez-le en téléchargeant et en imprimant votre "
- "certificat personnalisé Firefox 3 Download Day."
-</pre>
-
-<h3 id="Advantages_of_gettext"><span class="mw-headline">Advantages of gettext</span></h3>
-
-<ol>
- <li>gettext has very powerful tools to update this site (if you use the actual English strings in <code>msgid</code>s, not unique identifier strings like <code>certificate_intro</code>)</li>
- <li>Very established with a large set of powerful tools</li>
- <li>Harder to screw things up because existing tools will not allow localizers to edit the l10n file where they shouldn't</li>
- <li>Separates localizable strings available for localizers for the rest of the code, protecting it from unintended changes</li>
-</ol>
-
-<h3 id="Disadvantage_of_gettext"><span class="mw-headline">Disadvantage of gettext</span></h3>
-
-<ol>
- <li>.po file needs to be compiled into a .mo file for localizer to see changes</li>
- <li>Using regular <code>diff</code> to see changes to a file is sometimes impossible because the editing tool can save the .po file using a completely different structure or order of entities.</li>
-</ol>
-
-<p>Read more about gettext <a class="external" href="http://en.wikipedia.org/wiki/GNU_gettext" title="http://en.wikipedia.org/wiki/GNU_gettext">on Wikipedia</a> and <a href="/en/gettext" title="en/gettext">on MDC</a>.</p>
-
-<h2 id="Wiki"><span class="mw-headline">Wiki </span></h2>
-
-<p>Blogging, documentation, and other types of Mozilla content often surface as wikis.</p>
-
-<h2 id="Case_study_Download_Day"><span class="mw-headline">Case study: Download Day</span></h2>
-
-<p>In the above Gettext example, notice how the web developer used "certificate_intro" as the value of the msgid. This is not the actual content that was translated. So, if a localizer wanted to use one of the many powerful Gettext tools, like po-editor, the msgid provides NO CONTEXT for translation or for other localizers to verify translations when QA-ing. This should have been avoided.</p>
-
-<p>In the case of Download Day, someone created entity-like identifiers in the msgid, which we have shown above with the "certificate_intro" key. Then, an en-US repository was created holding the translations to all the entity-like values of msgid. This is very non-standard because it avoids one of the obvious powers of Gettext. When English content is used as the value of the msgid, there is no need to place that content in a special repository.</p>
-
-<p>But, in the Download Day example, when changes were made to en-US, the web-developer had to push those changes to all the repositories of all the locales. Localizers had to revisit an en-US repository to find the exact msgid, review the change, and return to their repository to make changes.</p>
-
-<p>Without having the exact content as the msgid, this process may cause several errors since the localizers cannot has to continually switch back-and-forth. In this case, the choice to use customized values for msgid was error-prone, onerous, and unfamiliar to localizers who are used to more customary Gettext operations.</p>