L10n:Web parts:Snippets

From MozillaWiki
Jump to: navigation, search

Last Update: 2009-09-03

This page lists all the information needed to update the text snippets displayed under the search box on the Google-Firefox start page (http://www.google.com/firefox)

Publishing process

  1. update the strings in the html template provided by Google
  2. provide the updated templates to the google webmaster working with us

The templates we give to Google are hosted on svn:
https://svn.mozilla.org/projects/google_snippets/static/

Getting the snippets from the command line (linux/mac) is done using the following command:

svn co https://svn.mozilla.org/projects/google_snippets/static/

There is a staging server to see the templates as html there: http://google_snippets.stage.mozilla.com/

The Staging server is updated hourly from SVN.

Google needs a minimum of one week notice to update a snippet.

File structure to provide to google

es-es

snippet-1.html + snippet-2.html + snippet-3.html + snippet-4.html
title.txt

es-es-1.0

snippet-1.html
title.txt

es-es-1.5

snippet-1.html
title.txt

es-es-2.0

snippet-1.html
title.txt

images

addons.png


Notes on the above file structure:

  • The locale code corresponds to our locale codes but they are lower-case (es-es and not es-ES). The exception is en-US which is shortened as en.
  • The folders ending with a number are displayed for older versions of Firefox (1 / 1.5 / 2). We put only one snippet there which is a message to incitate them to upgrade to the current major version of Firefox.
  • the title.txt file contains the translated title of the page as will be displayed in the TITLE html element.
  • The snippets are rotating on the start page, there are usually 4 common snippets across all languages. On en-US, snippet-5.html is advised for temporary marketing promotions targetting en-US users.
  • the images folder contains the illustrative icons displayed on the side of snippets. This is a png file with dimensions of 40x50 pixels.
  • images have no expiry date in http headers sent by google, therefore if you want to update an image, you have to send a new file with a different name and update the <img> tag in html accordingly in the snippets. Our convention for new images is to version them like that: firefox35_v1.png, firefox35_v2.png, addons_v1.png, addons_v2.png...

The snippet template

The snippet template uses "traditional" HTML. Here is the current code:

<table border=0 cellpadding=4 cellspacing=0 width=618> 
 <tr>
  <td>
   <img src="../images/key_security.png" width=40 height=50 alt="">
  </td>
  <td>
   <font size=-1>Sie sind über Ihre Online-Sicherheit beunruhigt?
   Finden Sie heraus, warum Firefox der
   <a href="http://de.www.mozilla.com/de/firefox/security/">sicherste 
   Webbrowser</a> ist.</font>
  </td>
 </tr>
</table> 
<br>
<table border=0 cellpadding=4 cellspacing=0 width=618>
 <tr>
  <td align=center nowrap>
   <font size=-1>
    <a href="http://de.www.mozilla.com/de/firefox/about/">Über Mozilla</a>
   </font>
   </td>
  </tr>
</table>

Snippets for Right-To-Left languages such as Arabic should have the dir="rtl" attribute added to the table element.

Authorized html tags for the snippets:

  • HTML elements: "font", "table", "tr", "td", "img", "a", "br", "b"
  • HTML attributes: "size", "align", "border", "cellspacing", "cellpadding", "width", "height", "href", "hreflang", "src", "alt", "nowrap", "dir", "face", "title"

en-US vs other locales

English snippets have a special status, they are updated more frequently, by several different people in the marketing department and are therefore offering a different content than the other locales.

As a consequence, they are not included in automatic scripted updates of locales managed by the l10n-drivers team but are dealt with manually. If marketing wants an English snippet to be updated at the same time as the other locales, they should deal with it themselves or file a bug to have it done by webdev (or pascalc from l10n-drivers). When snippets are updated for all locales by scripting, remember that English is updated in svn manually!


Updating snippets for locales

Localizers translate snippets provided in the .lang format, here is an example:

http://viewvc.svn.mozilla.org/vc/projects/google_snippets/fi.lang?revision=8657&view=markup

Having all locales updating this file can take up to three months.

A bug has to be created for new localized snippets and the bug and task should be added to the web localization dashboard:

http://l10n.mozilla.org/webdashboard/?project=2