Search completed in 1.40 seconds.
139 results for "localization":
Your results are loading. Please wait...
Localization content best practices
This document provides best practices for developers to create localizable code, and describes how to avoid some localizability (l12y) common mistakes. Note: If you're a localizer and you want to contribute to the localization of Mozilla products, you might want to read our Localization quick start guide for information on localizing Mozilla code. Note on localizers Mozilla localizers are volunteers with very diverse technical skills: some of them rely exclusively on translation tools, others prefer to work directly with text editors and don't have problems working with VCS systems. It's important to consider this when adding strings, and especially localization comments for strings that contain references, or obscure technical details. Localization files Choose good key IDs The ID...
...han new-event-header1. If a string is tied to an accesskey or a tooltip, use string IDs that highlight this relation: neweventbtn.label = Add event neweventbtn.accesskey = A neweventbtn.tooltip = Add a new event Don't duplicate IDs If you're adding new strings, check that you're not duplicating an existing ID. Depending on the parser logic, one of these two translations will be ignored. ...
...rings, check that you're not duplicating an existing ID. Depending on the parser logic, one of these two translations will be ignored. Add localization notes Localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too. These comments are generally referred to as localization notes. Don't forget to add a localization note when: Part of the string is not supposed to be localized (for example, the name of an HTML attribute in a warning). String includes variables: always explain what will be the value of these variables at run-time. English could be ambiguous. For example: bookmark. Is this a noun or a verb? Using meaningful IDs could also help in these cases. St...
...And 14 more matches
Localization - Archive of obsolete content
See Limitations below. Localized strings Translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...See Limitations below. Localized strings Translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
... string you want to localize, consisting of an identifier for the string and its translation in that locale, in the format identifier=translation need to use UTF-8 without BOM encoding Lines starting with "#" (after optional whitespace) are comments Suppose your add-on contains a single localizable string, represented in English as "Hello!", and you want to supply US English and French French localizations. You'd add two files to the "locale" directory: my-addon/ data lib locale/ en-US.properties fr.properties "en-US.properties" contains this: hello_id= Hello! "fr.properties" contains this: hello_id= Bonjour ! Now whenever your JavaScript or HTML asks the localization system for the translation of the hello_id identifier, it will get the correct translation fo...
...And 9 more matches
Localization technical reviews
This guide provides details on what a localization technical review is, what criteria are used for the technical reviews, and the process for requesting one and following its progress. The technical review process we use for new localizations can be confusing for any trying to start a new localization. We use this review process to perform quality assurance (QA) testing on your L10n efforts. This ensures that every user who downloads your localized Mozilla application receives all of your hard work in a functional product. Each QA review helps us in these ways: Ensures that your L10n work is visible and functional within the Mozilla application. Allows us to understand how each L10n team is performing their localization work. Allows us to discover potential bugs within L10n tools. Over...
... Mozilla application receives all of your hard work in a functional product. Each QA review helps us in these ways: Ensures that your L10n work is visible and functional within the Mozilla application. Allows us to understand how each L10n team is performing their localization work. Allows us to discover potential bugs within L10n tools. Overview You've completed most, if not all, of your localization work. The merge date for migrating from one product release channel to the next (e.g., aurora to beta, or beta to release) is rapidly approaching. You need to make sure that your work can effectively be compiled into a build for the next release channel. Here is a detailed overview of what a technical review is and who it's meant for: A technical review: is performed as a QA measure on a revi...
.... is very comprehensive and covers the entire product. focusses on technical accuracy and completion of L10n work, not translation quality. is only performed on the first revision a new locale wants to have released to the public. must be approved prior to migrating your revision from Aurora to Beta. Technical review evaluation criteria In principal, a technical review's criteria looks for localization issues common to localizing software but within the Mozilla context. Since it is performed on the first revision a L10n team proposes for release, this first revision requires a very detailed and comprehensive form of review. That being the case, there are some criteria in a technical review that will only ever be considered once, as all reviews after this only evaluate the changes you're adding ...
...And 4 more matches
Localizations and character encodings - Developer guides
990s as a deployed in the America has and in Western Europe. However, there are locales where Web publishing was common already in the 1990s but the windows-1252 encoding was not suitable for the local language. In these locales, legacy content that doesn't declare its encoding is typically encoded using a legacy encoding other than windows-1252. In order to work with legacy content, some Firefox localizations need a non-windows-1252 fallback encoding. Unfortunately, this means that the Web-exposed functionality of Firefox differs by locale and it is hard to read legacy content across locales with different fallback encodings. To avoid introducing this problem in locales where Web publishing took off after the adoption of UTF-8, locales that don't have a non-windows-1252 legacy encoding arising from ...
...ies. Specifying the fallback encoding As of Firefox 28, this section is obsolete, since the preference intl.charset.default no longer exists. The mapping from locales onto fallback encodings is now built into Gecko itself. The fallback encoding is specified by the preference intl.charset.default in intl.properties. ...
...t.default in intl.properties. It should be set to the canonical name of the legacy encoding that users of the localizations are most likely to encounter when browsing non-conforming legacy Web content that doesn't declare its encoding. Note that the fallback encoding as defined by the previous sentence does not necessarily need to be able to represent the characters needed for the language of the localization! The fallback encoding should be left to windows-1252 for Western European locales, North, Central and South American locales, African locales, Central Asian locales and Oceanian locales. It typically needs to be set to something other than windows-1252 for Central and Eastern European locales, Middle Eastern locales and East Asian locales. In order to avoid the problem of Web authors creating ...
...And 3 more matches
Localization and Plurals
number qualifying the word. Different languages can have different rules. plural form: For a particular plural rule, there can be multiple forms of a word, such as "page" and "pages". In this case, there are 2 forms, but other languages can have 1 or many more. If you're here for pluralRule in the chrome/global/intl.properties file, you'll need to figure out what plural rule to choose for your localization. This plural rule is used to determine how many plural forms are needed for each word that needs to be localized, with plurals in mind. For all other properties files that link to this page, you'll need to provide enough plural forms of the desired word, and separate them with semi-colons (;). If you don't know how many plural forms you need, check the pluralRule number in chrome/global/intl.pro...
..., the strings to be localized will be placed in a separate file, such as yourextension.properties, instead of being hardcoded in the JavaScript code file. The following 3 file snippets show how to use PluralForm with your .xul, .properties, .js files. ...
...d in the JavaScript code file. The following 3 file snippets show how to use PluralForm with your .xul, .properties, .js files. downloads.xul: <stringbundleset> <stringbundle id="strings" src="chrome://downloads.properties"/> </stringbundleset> downloads.properties: # LOCALIZATION NOTE (downloadsTitleFiles): Semi-colon list of plural forms. ...
...And 2 more matches
Patching a Localization
Say you have found a problem with an existing localization. More specifically, it's a problem with an already released localization. What do you do now? Well, you have come to the right place! This page will walk you through creating a patch for an existing localization. The steps below are fairly generic; for the most part they apply to creating l10n patches for Firefox, Thunderbird, SeaMonkey, or Calendar. I'll use Firefox in the example below to help you understand the general steps to creating a l10n patch. Prerequisites If you are to the point that you are patching existing localizations, we assume that you have the basic set of tools listed on the L10n Prerequisites wiki page. If you do not have these tools, take a few steps back, grab a cookie (because, let's face it, you deserve it for...
...ssume that you have the basic set of tools listed on the L10n Prerequisites wiki page. If you do not have these tools, take a few steps back, grab a cookie (because, let's face it, you deserve it for all of your work), and visit the L10n Prerequisites page. There you'll learn what tools you need, where to find them, and how to install them. Get the source First, you need to get the source for the localization in question using its two or three character ISO language code. For our example, I'll use gl (Galician). Whenever you see gl in blue text, replace it with the locale code for your language. Next thing you need to know is which localization version you want to patch. All of our localizations work on the Aurora branch. The repository for this version is releases/l10n/mozilla-aurora. For more inform...
...thing you need to know is which localization version you want to patch. All of our localizations work on the Aurora branch. The repository for this version is releases/l10n/mozilla-aurora. For more information about branches see L10n:Branches. Now let's get a little more detailed. Start bash and do the following: Create a clean directory for your work. For example, create a directory like localization-workdir (in this example it is located in your home directory): mkdir ~/localization-workdir Navigate to the directory you just created. ...
...And 2 more matches
Localization sign-off reviews
This article presents an overview of why we do sign-off reviews of localizations, the details on the criteria used for the sign-off reviews, and the process for requesting a review and for following its progress. The sign-off review process has been notoriously shrouded in mystery. We use this review process to perform quality assurance (QA) testing on your L10n efforts. This ensures that every user who downloads your localized Mozilla application receives all of your hard work in a functional product. Each QA review helps us in these ways: Ensures that your L10n work is visible and functional within the Mozilla application. Allows us to understand how each L10n team is performing their localization work. Allows us to discover potential bugs within L10n tools. Overview You've done some lo...
...on work and are ready for it to be released. The merge date for migrating from one product release channel to the next is rapidly approaching. You need to make sure that your work can effectively be compiled into a build for the next release channel. Here is a detailed overview of what a sign-off review is and who it's meant for: A sign-off review: is performed as a QA measure for maintaining a localization from release-to-release. only evaluates new L10n work. This is done by generating a diff between the new release revision being considered and the previously approved release revision. focuses on technical accuracy and completion of L10n work, not translation quality. evaluates new release revisions, not entire L10n repos. does not need to be approved before revision merge between release cha...
... for changes in localized code that should not have been localized or wasn't localized in the previous revision. Search plugin changes This greatly impacts productization. We look for these changes and file bugs when they're found in a new revision. Further indications of tool-originated corruption This is common. Most bugs filed from sign-offs are caused by a tool corrupting your localization's files. Newly translated strings that shouldn't have been translated Self-explanatory enough, right? Access key changes We ensure that when access keys are changed that they are consistent with the keyboard layout for that particular locale and not blended between two or more distinct layouts. How it all works A large part of the review process takes place before you even subm...
...And 2 more matches
Localization formats
Warning: This document pertains to the development of Mozilla web sites and not to the development of Gecko-based extensions or applications. ...
...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. HTML/PHP Maybe you are designing a project that has relatively small translation needs like three to four lines (or more) of content asking users to update to the next version of software available. You may choose to present just the HTML for localization: We give an HTML file which lists several pieces of content like, <H1>Getting Started</H1> and the localizer translates to <H1>Debuter avec Firefox</H1> 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. Advantages to HTML Good for small projects Very simple for web developers Gives loca...
...an appear on the staging server Disadvantages to HTML Very hard for QA If localizer changes something incorrectly (i.e. accidentally removes some HTML like </h1>, that localizer can break everything.) Very hard to update automatically, if not impossible. Can be hard to tell what has changed .lang files 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 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.) .lang files can be easily edited in a text editor With this setup, a localizer is given a...
...And 2 more matches
Localization quick start guide
Along the way, you'll learn about the variety of projects you can contribute to and the tools used to localize them. When we get to specific examples, we'll take them from the Firefox project, as it is the most widely localized project within Mozilla. ...
...Along the way, you'll learn about the variety of projects you can contribute to and the tools used to localize them. When we get to specific examples, we'll take them from the Firefox project, as it is the most widely localized project within Mozilla. ...
... guide, you will have all the tools necessary to start contributing! Remember, this guide will instruct you on the technical aspects of Mozilla L10n only. Visit the L10n Process page to learn about the whole process. Initial setup Tech prep work before localizing. Translation phase L10n tools tutorials for translation. QA phase L10n testing tutorials. Release phase Steps to shipping your localization work. These four stages make up tech side of the l10n program. To learn more about any of these, click on any of the links above. To get the big picture, we suggest you start with the green bubble and move from stage to stage. Note: This guide is written for two types of contributors: those starting a new localization and those joining an existing localization. It is important to know which i...
...with the green bubble and move from stage to stage. Note: This guide is written for two types of contributors: those starting a new localization and those joining an existing localization. It is important to know which information applies to which type of contributor. To help you filter through to the most applicable information, note that all information that is unique to those starting a new localization will be in orange font. All information that is unique to those joining an existing localization will be in blue font. Next >> ...
Localization Use Cases
In all presented examples, we try to show the existing code, explain the problem from the localizers' or developers' perspective, and suggest a solution. Declensions In Gaia's Browser app, there's an about-browser string defined as follows in apps/browser/locales/browser: about-browser=About {{browserBrandShortName}} Problem definition In many inflected languages (e.g. German, Finnish, Hungarian, all Slavic languages), the about preposition governs the grammatical case of the complement. It might be the accusative (German), ablative (Latin) or locative (Slavic languages). ...
...ze(self.appStorageDesc, 'availableSize', freeSpace); }); }, Problem definition For all values of freeSpace, the following string is enough to construct a grammatically-correct sentence in English: availableSize = {{$size}} {{$unit}} available However, other languages might need to pluralize this string with different forms of the available adjective. ...
...e" : "other" }> <availableSize[plural($size)] { one: "{{ $size }} {{ $unit }} disponibile", other: "{{ $size }} {{ $unit }} disponibili" }> So far, so good. The JavaScript code hasn't changed yet, but there's another improvement that can be introduced, which is described below. Asymmetry The example above could benefit from another of L20n's features: local variables. In L20n, localization files can be asymmetrical and have more entities that the source language. You'll notice that DeviceStorageHelper.showFormatedSize passes a localized name of the unit to availableSize: function showFormatedSize(element, l10nId, size) { // ... var _ = navigator.mozL10n.get; element.textContent = _(l10nId, { size: sizeInfo.size, unit: _('byteUnit-' + sizeInfo.unit) }); } Problem...
...e in other languages we might need to use localized names. byteUnit-B = B byteUnit-KB = KB byteUnit-MB = MB byteUnit-GB = GB byteUnit-TB = TB For example in French, the unit abbreviations are as follows: byteUnit-B = o byteUnit-KB = Ko byteUnit-MB = Mo byteUnit-GB = Go byteUnit-TB = To Solution In L20n, the French localizer could provide the translation of unit abbreviations locally in the localization file, without impacting the English localization file. In the JavaScript code, the developer needs to pass sizeInfo.unit instead of a localized value: function showFormatedSize(element, l10nId, size) { // ... element.textContent = document.l10n.get(l10nId, { size: sizeInfo.size, unit: sizeInfo.unit }); } And then use the $unit variable verbatim in the English message: <availabl...
Localization - Archive of obsolete content
Entities Many applications are built such that translating the interface into a different language is as simple as possible. Usually, a table of strings is created for each language. Instead of hard-coding text directly into an application, each piece of text is only a reference into the string table. XML provides entities which can be used for a similar purpose. You should already be familiar with entities if you have written HTML. The codes &lt; and &gt; are examples of entities which can be used to place less than and greater than signs into the text. XML has a syntax which allows you to declare custom entities. ...
...new language all you need to do is create another DTD file. By using the chrome system to add the DTD file to a different locale, the same XUL file can be used in any language. Find files example so far: Source Next, we'll look at property files. << PreviousNext >> See Also How to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: Bootstrapped Extensions :: Localization (L10n) ...
Localization - MDN Web Docs Glossary: Definitions of Web-related terms
The following are common factors to consider: language unit of measure (e.g., kilometers in Europe, miles in U.S.) text direction (e.g., European languages are left-to-right, Arabic right-to-left) capitalization in Latin script (e.g., English uses capitals for weekdays, Spanish uses lowercase) adaptation of idioms (e.g., "raining cats and dogs" makes no sense when translated literally) use of register (e.g., in Japanese respectful speech differs exceptionally from casual speech) number format (e.g., 10 000,00 in Germany vs. ...
...raining cats and dogs" makes no sense when translated literally) use of register (e.g., in Japanese respectful speech differs exceptionally from casual speech) number format (e.g., 10 000,00 in Germany vs. 10,000.00 in the U.S.) date format currency cultural references paper size color psychology compliance with local laws local holidays personal names Learn more General knowledge Localization at Mozilla on MDN Localization on Wikipedia ...
Localization notes
There is an established format for those, which is described in this document. It's important to follow the format as closely as possible. There are a number of automated tools that parse these comments for easier access and use by localizers. ...
...s; it is important to add comments to the localizable files themselves, too. These comments are generally referred to as localization notes. There is an established format for those, which is described in this document. It's important to follow the format as closely as possible. There are a number of automated tools that parse these comments for easier access and use by localizers. DTD files <!-- LOCALIZATION NOTE (entity name): comment --> Properties files # LOCALIZATION NOTE (key): comment File-wide comments should use the same format, be at the top of the file (after the license header, though) and just drop the (entity name/key) reference. ...
Encodings for localization files
In general, files in the Mozilla repositories are UTF-8 encoded. There are a few exceptions, though. Installer The Windows installer can't handle UTF-8, but only the codepages provided by Windows. This is tricky to hook up in the build process, so here it goes: File Encoding Notes toolkit/installer/windows/charset.mk ASCII The WIN_INSTALLER_CHARSET variable must be set to an encoding which matches toolkit/installer/windows/install.it CHARSET= parameter. See the table below for appropriate values. toolkit/installer/windows/install.it A Windows codepage. ...
Localization: Frequently asked questions
How do I preserve whitespace in an entity? Do you really want to preserve whitespace or are you looking for a no-break space, you can add that via a &ua0; or \ua0 to DTD and properties files, resp. ...
Localization prerequisites
On Mac and Linux, you should be just fine, and on Windows, MozillaBuild should get you everything you need. Tools A recent POSIX Shell Python 2.5 or newer. Perl 5.6 or higher Older perl versions may work if you upgrade File::Spec to version 0.8 GNU make 3.79.1 or higher. Other varieties of "make" will not work. autoconf-2.13 - Autoconf 2.5x will not work. zip 2.3 (or higher) Mercurial 1.2 or higher recommended. Needed for development of Firefox 3.5/SeaMonkey 2.0/Thunderbird 3.0 and later. A text editor. You can try one of these: Notepad++ or Notepad2 on Windows, vim, gedit or Kate on GNU/Linux, BBEdit on Mac OS X. To verify that they work, open a shell. ...
Localization at Mozilla
These resources are for anyone with an interest in the technical aspects involved in localization. They are for developers and all contributors. The documentation here is no longer being maintained and is inaccurate. L10n documentation has moved to https://mozilla-l10n.github.io/localizer-documentation/ . ...
Index
Found 42 pages: # Page Tags and summary 1 Localization at Mozilla Landing, Localization, Mozilla, Translation, l10n Localization (L10n) is the process of translating software user interfaces from one language to another and adapting it to suit a foreign culture. These resources are for anyone with an interest in the technical aspects involved in localization. 2 Application Translation with Mercurial Android, Draft, Editing, Firefox, Lightning, Localization, Mercurial, SeaMonkey, Translate, patch, thunderbird First, get the required programs to compile Mozilla applications like Firefox and Thunderbird from Build Instructions. This is only necessary once. ...
... aspects involved in localization. 2 Application Translation with Mercurial Android, Draft, Editing, Firefox, Lightning, Localization, Mercurial, SeaMonkey, Translate, patch, thunderbird First, get the required programs to compile Mozilla applications like Firefox and Thunderbird from Build Instructions. This is only necessary once. ...
...iting, Firefox, Lightning, Localization, Mercurial, SeaMonkey, Translate, patch, thunderbird First, get the required programs to compile Mozilla applications like Firefox and Thunderbird from Build Instructions. This is only necessary once. 3 Bootstrapping a new locale Localization, Mercurial, Translate, bit bucket (see also https://developer.mozilla.org/en/Create_a_new_localization) 4 Encodings for localization files Internationalization, Localization When creating a localization for Mozilla products, it's important to be aware of the encoding of the files that you generate. 5 Index Localization Found 42 pages: 6 L10n Checks Internationalization, Localization, Localization:Tools, Tools L10n Checks is a Python sc...
...And 32 more matches
Application Translation with Mercurial
Next check what is still untranslated by going to Localization status page and click on the page for your language. In the section "Applications & Sign-offs", you will find different products and branches which are currently in translation. gaia-* denotes branches of Firefox OS, the operating system for mobile devices. ...
... Check what is available for translation Find out on which branch localization is done for your locale: Read your localization team's page by clicking on the team with your language code (e.g. "de" for German). The localization lead for your language knows the branch. The default localization branch is aurora. Next check what is still untranslated by going to Localization status page and click on the page for your language. In the section "Applications & Sign-offs", you will find different products and branches which are currently in translation. gaia-* denotes branches of Firefox OS, the operating system for mobile devices. Firefox and fx-* denote branches of Firefox for Desktop, the browser for desktops and notebooks running, Windows, Mac OS or Linux. Fennec and fennec-* d...
...ng system for mobile devices. Firefox and fx-* denote branches of Firefox for Desktop, the browser for desktops and notebooks running, Windows, Mac OS or Linux. Fennec and fennec-* denote branches of Firefox for Mobile, the Firefox browser for the Android operating system. Thunderbird and tb-* denote branches of Thunderbird, the mail client, newsgroup and feed reader and chat client. The localization of the Lightning calendar add-on also takes place on these branches. SeaMonkey and sea-* denote branches of SeaMonkey, the suite consisting of browser, mail and chat client and more. Lightning and cal-* denote branches of Lightning, the calendar add-on for Thunderbird. The localization of Lightning now happens on Thunderbird's tb-* branches, the cal-* branches have been retired. In t...
...And 15 more matches
Localizing without a specialized tool
From the Create a New Localization document, an interested localizer can follow a technical step-by-step process that starts the localization process by focusing on how to localize two of the primary types of localization files (DTD and properties) used in the Mozilla source code. With that document, users can see immediately two localized files in their user interface by following closely and carefully the steps to create a language pack or a binary file that is ready for installation. Repeating the process allows a localizer to create a testable package to see his or her work as they progress to a final version. ...
...y following closely and carefully the steps to create a language pack or a binary file that is ready for installation. Repeating the process allows a localizer to create a testable package to see his or her work as they progress to a final version. If you choose to localize Mozilla with nothing more than a text editing application and not a specialized tool, this document (along with Create a New Localization) will enable you to learn just what needs to be done. Before we start, did you make sure to install Mercurial and confirm that you have set up the proper build environment on your local machine? You cannot begin localizing Mozilla file by file without a specialized tool without going through the Create a New Localization page. What we will translate We will translate a small piece of the UI foun...
...rch Engines... There is also a tooltip that appears when you hover over the magnifying glass icon on the right side of the bar. Folder structure Throughout this document, we will be using the following folder structure in all examples: your working directory (root) mozilla-1.9.2 (en-US source, pulled from http://hg.mozilla.org/releases/mozilla-1.9.2) l10n-mozilla-1.9.2 (a directory containing localization directories, one dir per localization; often referred to as "l10n base") x-testing (a directory with your localization files) Please either follow this structure closely or adjust all commands in the documentation as needed by your custom set-up. Get the source Change your current directory to your working directory with the following command: $ cd /path/to/your/working/directory First, yo...
...And 9 more matches
Index - Archive of obsolete content
orial we've built and packaged an add-on using three commands: 157 Getting started (cfx) In this tutorial we've built and packaged an add-on using three commands: 158 List Open Tabs Add-on SDK No summary! 159 Listen for Page Load Add-on SDK No summary! 160 Listening for Load and Unload No summary! 161 Localization Add-on SDK, Localization No summary! 162 Logging Add-on SDK No summary! 163 Modifying Web Pages Based on URL Add-on SDK No summary! 164 Modifying the Page Hosted by a Tab Add-on SDK No summary! 165 Open a Web Page Add-on SDK No summary! 166 Troubleshooting No summary! 167 ...
... Add-on SDK, JPM No summary! 168 Using XPCOM without chrome Bookmarks, Chrome, SDK, XPCOM No summary! 169 Using third-party modules (jpm) Addon-SDK, JPM First, while in the root of your add-on, install the package that contains the modules you want to use: 170 Bootstrapped extensions Add-ons, Extensions, Firefox 4, Gecko 2.0, Guide, Localization No summary! 171 Code snippets Add-ons, Code snippets, Extensions No summary! 172 Alerts and Notifications Code snippets non-modal notification and further interaction with users 173 Autocomplete Code snippets, Form Fill, Satchel No summary! 174 Bookmarks Code snippets, Developing Mozilla, Extensions, Places ...
...s: the structure, the style, and the behavior. The structure layer identifies the widgets (menus, buttons, etc.) and their position in the UI relative to each other, the style layer defines how the widgets look (size, color, style, etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals. mention the localization layer 393 Making a Mozilla installation modifiable Add-ons, Extensions Mozilla's user interface is made up of XUL (described below), XBL (a topic for another tutorial), JavaScript, CSS, and image files. XUL, XBL, JavaScript, and CSS files are all in text format and can be edited in a standard text editor, while image files are in binary GIF, JPG, or PNG format and must be edi...
...And 7 more matches
Bootstrapping a new locale
where active development of the upcoming release of Firefox occurs) and then begin the necessary work for translation. ...
...where active development of the upcoming release of Firefox occurs) and then begin the necessary work for translation. ...
...where active development of the upcoming release of Firefox occurs) and then begin the necessary work for translation. Hg allows localizers to work locally on their machines and then "push" changes to their official Mozilla repository. ...
...And 6 more matches
Localizing with Koala
) updating working directory 40357 files updated, 0 files merged, 0 files removed, 0 files unresolved Configure the Locale Locale ID: x-testing (put your locale's code) Version: 3.6 Location: choose the folder where you want to keep the localized files or leave empty for now Check "Mercurial" if you wish to use Mercurial to keep the revision history of your files (very recommended) Existing localizations: URL: if you're editing an existing localization or you already have a repository set up (either on hg.mozilla.org or BitBucket), type the URL of the remote repository, e.g. http://bitbucket.org/mozillal10n/x-testing or http://hg.mozilla.org/releases/l10n-....9.2/x-testing. New localizations: URL: If you already have a repository set up by l10n-drivers (on BitBucket), type the URL of the remot...
...It is still recommended to use Mercurial locally to version your local files. ...
... form: "Firstname Lastname <me@example.com>" (be sure to type the wrapping quotes: "") Note that you no longer have to edit the location now, it automatically fills in when you check the "Mercurial" checkbox (e.g. "C:\mozilla\l10n\locale\x-testing\3.6" If you enabled Mercurial (recommended), Koala will ask you if you wish to clone the remote repository. Click "OK" (even if you're creating a new localization and there is no remote repository). Existing localizations: if Koala fails to clone the remote repository, you will need to do it manually. Just open the console and issue the following commands: C:\Users\stas> cd C:\mozilla\l10n\locale\x-testing C:\mozilla\l10n\locale\x-testing> rmdir 3.6 C:\mozilla\l10n\locale\x-testing> hg clone http://hg.mozilla.org/releases/l10n-mozilla-1.9.2/x-testing 3.6 ...
...And 5 more matches
Release phase
You've made it! You've setup up your local and remote environments, you've selected your L10n tools and projects, done some localization and even some testing! Now you're ready for the final phase: becoming an official L10n release. Here, we'll continue to stay true to the original intent of this guide and only present you with the technical information you need to become an official release. We'll primarily focus on getting your release repository setup and the Mercurial commands you'll need to know to use that repository. For more information on the release part of the L10n process, visit the Mozilla wiki here. Your official release repository Now that your locale has been registered, the localization files will live on Mozilla Mercurial server at hg.mozilla.org. Depending on which branch yo...
...There are two different protocols you can use to connet with your Mercurial repository: HTTP and SSH. Be advised that there's an important distinction between them. You can pull using both, but you can only push through SSH. ...
...242 changes to 239 files updating to branch default 239 files updated, 0 files merged, 0 files removed, 0 files unresolved The default push URL is the same as the default pull URL (i.e., ssh://hg.mozilla.org/releases/l10n-central/x-testing). You should now be able to push to the remote repository! Commit, outgoing, and push You should try to commit your work regularly as you progress through the localization files. Keep in mind that the hg commit command will save your changes locally (in the local clone). With the hg push command you can send the changesets to the remote server. Here's how that's done: Run this command to see recent commits in your local clone: $ hg log -l 3 You should a list of the most recent commits, similar to this one: changeset: 0:7c543e8f3a6a tag: tip user: ...
...And 4 more matches
Localizing extension descriptions
> <em:name>Tab Sidebar</em:name> <em:description>Laat voorbeeldweergaven van uw tabbladen in de zijbalk zien.</em:description> </Description> </em:localized> <em:name>Tab Sidebar</em:name> <em:description>Displays previews of your tabs in your sidebar.</em:description> </Description> </RDF> All of the metadata mentioned below can be localized in this way. The localization information provided by the em:localized property can be overriden using a set of localized preferences as detailed below. The process for selecting the em:localized property to use for a given locale is as follows: If a property exists with an em:locale that matches the locale exactly, then use that. If we have inexact matches then use the one with the most matching parts, parts being separ...
...o 1.9 Before Gecko 1.9, add-on developers must go through a special process to define localized add-on descriptions for add-ons targeting toolkit-based apps (such as Firefox or Thunderbird). If you do not currently have them, create localized properties files. Make sure to use UTF-8 encoding (without BOM) to ensure foreign characters display correctly. Add the following line to each of your localization properties files (where EXTENSION_ID matches your extension ID (<em:id> from install.rdf) and LOCALIZED_DESCRIPTION is the description of your extension that you want to appear in the given language): extensions.EXTENSION_ID.description=LOCALIZED_DESCRIPTION If you do not currently have one, create a default preferences file. Add the following line to it (where EXTENSION_ID matches your ap...
...hes your extension ID (<em:id> from install.rdf) and LOCALIZED_DESCRIPTION is the description of your extension that you want to appear in the given language): extensions.EXTENSION_ID.description=LOCALIZED_DESCRIPTION If you do not currently have one, create a default preferences file. ...
...And 3 more matches
The Essentials of an Extension - Archive of obsolete content
anslate the extension's description, or even its name. A localized description and name can be added with the following code: <em:localized> <Description> <em:locale>es-ES</em:locale> <em:name>XUL School Hola Mundo</em:name> <em:description>Bienvenido a XUL School!</em:description> </Description> </em:localized> The es-ES locale string indicates that this is the Spanish (es) localization for Spain (ES). You can add as many <em:localized> sections as you need. For Firefox 2, localizing this file is a little more complicated. We'll discuss localization further ahead in this section. <em:type>2</em:type> This specifies that the add-on being installed is an extension. You can read about different possible types in the install.rdf specification. <em:targetApplication> <Desc...
...the most important section, holding user interface (XUL) and script (JS) files. The skin section has the files that define most of the look and feel of the UI (using CSS and images, just like web pages). Finally, the locale section holds all text used in the extension, in DTD and properties files. This division allows other developers to create themes that replace skins, and translators to create localizations in different languages, all of this without having to change your extension or your code. This gives Firefox extensions a great deal of flexibility. Chrome files are accessed through the chrome protocol. This is what a chrome URI looks like: chrome://packagename/section/path/to/file So, for instance, if I want to access the file browserOverlay.xul in the extension, the chrome URI would be...
... you can see the association between keys and localized strings: <!ENTITY xulschoolhello.hello.label "Hello World!"> <!ENTITY xulschoolhello.helloMenu.accesskey "l"> <!ENTITY xulschoolhello.helloItem.accesskey "H"> Notice that on the XUL file you enclose the string key with & and ; while on the DTD file you only specify the key. You may get weird parsing errors or incorrect localization if you don't get this right. Access keys are the shortcuts that allow you to quickly navigate a menu using only the keyboard. They are also the only way to navigate a menu for people with accessibility problems, such as partial or total blindness, or physical disabilities that make using a mouse very difficult or impossible. You can easily recognize the access keys on Windows because the letter ...
...And 2 more matches
Localizing an extension - Archive of obsolete content
Performing a few simple steps makes your extension much easier to localize into various languages without having to edit the XUL or JavaScript files themselves. ...
...EM "chrome://stockwatcher2/locale/options.dtd"> We add a similar line to the stockwatcher.xul file: <!DOCTYPE overlay SYSTEM "chrome://stockwatcher2/locale/stockwatcher2.dtd"> In larger applications you might need to use entities from several locale files in a single XUL file. Using multiple DTDs describes how to do it. Note that the URLs of the DTD files don't actually include the name of the localization to use. The Chrome Registry resolves the URIs based on the user's current locale setting and the data you provide in your Chrome manifest. Then we simply replace each text string in our XUL files with the corresponding entity. For example, in stockwatcher2.xul, we change this line: <menuitem label="Refresh Now" oncommand="StockWatcher.refreshInformation()"/> to <menuitem label="&menu_refresh_n...
...l, we change this line: <menuitem label="Refresh Now" oncommand="StockWatcher.refreshInformation()"/> to <menuitem label="&menu_refresh_now.label;" oncommand="StockWatcher.refreshInformation()"/> Do this for every string used in each XUL file. Update the chrome manifest To let Firefox know about the locale files, we need to make a revision to our chrome.manifest file, adding one line for each localization: locale stockwatcher2 en-US chrome/locale/ This instructs Firefox that the en-US localization is located in the chrome/locale/en-US directory. Localizing strings in JavaScript code If your JavaScript code contains literal strings that need to be localized, as does our stock watcher sample, we need to make those localizable as well. We can do this by moving the strings into a string bundle. Stri...
...And 2 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
486 getHTMLEditor XUL Methods, XUL Reference No summary! 487 getIcon XUL, XUL Methods, XUL Reference No summary! 488 getIndexOfFirstVisibleRow XUL Methods, XUL Reference No summary! 489 getIndexOfItem XUL Methods, XUL Reference No summary! 490 getItemAtIndex XUL Methods, XUL Reference ...
...r describing application interfaces. It contains elements for all common UI widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers). 965 Using Visual Studio as your XUL IDE Compared to a simple text-editor, Visual Studio gives you some special features when writing XUL: 966 Using multiple DTDs Internationalization, Localization, XUL No summary! 967 Using nsIXULAppInfo Add-ons, Extensions Starting with Mozilla/XULRunner 1.8, there now is a way to find out which application, application version, and Gecko version your code is running on. 968 Using spell checking in XUL Add-ons, Extensions Spell checking functionality is available starting in Firefox 2. This document describe...
... This document expands on the XUL Template Primer by introducing the <bindings> element in the extended XUL template syntax. 1000 XUL Tutorial Tutorials, XUL, XUL_Tutorial This tutorial describes XUL, the XML User-interface Language. This language was created for the Mozilla application and is used to describe its user interface. 1001 Accesskey display rules Localization Each controls of XUL can have an accesskey which is specified by accesskey attribute or accessKey property (See accesskey attribute document for the detail). XUL elements display their accesskeys in their label automatically if it's necessary. This document describes the rules of generating a label text. 1002 Adding Buttons Tutorials, XUL, XUL_Tutorial In this section, ...
...And 2 more matches
Localizing with Pontoon
At Mozilla, we use Pontoon to localize all Mozilla products and websites, ranging from Firefox to Mozilla.org. Pontoon is a very simple and intuitive tool that requires little to no technical skill to use in the l10n workflow. Here we'll discuss how to use Pontoon to localize projects, from first sign-in to finalizing your contributions. Along the way, we'll point out some sweet features that will make you more efficient and make your l10n contributions easier. Are you a developer? Read about implementing Pontoon in your project or learn how to get involved on GitHub. First steps Pontoon's home page is very easy to use. ...
...f the interface is taken by the website being translated. Only the toolbar on top belongs to Pontoon, containing the following items (from left to right): List of strings Opens a sidebar with a list of all strings to localize. Project selector (Affiliates) Switches between projects to localize. Resource selector (Homepage) Switches between project resources to localize, like subpages or localization files. Hidden if no resources available for project. Locale selector (Slovenian) Switches between languages to localize. Go Opens project-resource-locale selection. Progress indicator Displays your progress on the resource being localized. More details are available in the popup. User menu Allows for user-specific tasks, like commiting to repository, downloading files and signin...
...s on the resource being localized. More details are available in the popup. User menu Allows for user-specific tasks, like commiting to repository, downloading files and signing out. Info menu Gives important information, like the anticipated project timeline and a list of keyboard shortcuts. Alright, how about we do some translating now? Translate strings When using Pontoon for localization, you have a couple of options to translate your strings. You can translate in-context, out-of-context, or a combination of the two. We'll start with looking at in-context translation. In-context Pontoon's in-context translation mode is what puts it above others. It opens a web page (or web app) and enables real-time editing of that page. Here's how you translate your first string: Hover ov...
...And 2 more matches
Initial setup
As a pre-requisite to contributing to the L10n program, you need to have access to code, tools, and a properly configured local environment (i.e., your personal computer). You also need to determine if a localization effort already exists for your locale. Here we'll go over the accounts you need as well as the tools and their configurations you need to set up before contributing. New or existing Before anything else, you need to know if you will be creating a new localization or joining an existing one. This will determine what information is most applicable to you throughout the rest of this guide. Here's what you do: Look through the existing localization community directory to see if one already exists for your locale. If a community already exists, reach out to them and ask how you ...
...ional guidance. Accounts There are a handful of accounts that you need to be aware of as you begin. They're not required for you to begin contributing, but will be required when you are preparing to produce an official release. For now, simply be aware that these will become important as your efforts progress. These accounts will store your code, contributions, and help you produce an official localization. hg (Mercurial) Mercurial is the revision control environment that houses the main Mozilla source code as well as localized code for each official Mozilla localization. You will need this for localizing Mozilla applications. Hg commit access is not necessary to begin localizing. After you have some experience with hg, you may want to get commit access. At that point, you must visit the Mozill...
...nt, you must visit the Mozilla Committer page and follow the process outlined there. Here is an example bug that illustrates the process well. Use this bug template when filing your hg account registration bug. Add a request about creating your locale's repository to the new locales newsgroup. SVN SVN is a revision control environment that Mozilla uses to house Mozilla source websites and their localizations for each official Mozilla localization. See this wiki page about how to gain access to SVN. The SVN for Localizers guide will help you learn the most important SVN commands for l10n. Add a request about creating your locale's repository to the new locales newsgroup. Web-based L10n tools We'll talk about these in a little bit. For now, just be aware that should you choose to use them, you ma...
...And 2 more matches
What every Mozilla translator should know
Planning list Also available as mozilla.dev.planning, .planning in short. The Mozilla project discusses general planning and schedule questions here. Discussions of interest to the general Mozilla developer community are at least notified here. ...
... Planning list Also available as mozilla.dev.planning, .planning in short. The Mozilla project discusses general planning and schedule questions here. Discussions of interest to the general Mozilla developer community are at least notified here. ...
...to day developing work is done. When a development is started for an specific version, a new repository is created under hg.mozilla.org/releases/. All the content of the trunk is copied to this new branch so that the developing work is done in two (or more) parallel places: the generic trunk and the version oriented branch(es). For every branch and every locale, there is a separate repository for localization files committed by the localizers. Some branch/release names identified: Mozilla source + en-US Localization files for [ab-CD] locale Corresponding Firefox version Branches in hg mozilla-central l10n-central Firefox.next (trunk) mozilla-1.9.2 l10n-mozilla-1.9.2 Firefox 3.6 mozilla-1.9.1 l10n-mozilla-1.9.1 Firefox 3.5 And, o...
...And 2 more matches
L20n HTML Bindings
You can take advantage of HTML bindings to localize your HTML documents with L20n. Download L20n with HTML Bindings We maintain a repository with L20n optimized for production use: one file (~110KB) one file, minified (~35KB) It's recommended to include the l20n.js file as the last script in the head element. <head> ... ...
...load L20n with HTML Bindings We maintain a repository with L20n optimized for production use: one file (~110KB) one file, minified (~35KB) It's recommended to include the l20n.js file as the last script in the head element. <head> ... <script src="l20n.js"></script> </head> Create Manifest Use a localization manifest to define available languages and their resource files. <link rel="localization" href="../locales/manifest.json"> An example of the manifest file (all keys are required): { "locales": [ "en-US", "pl"], "default_locale": "en-US", "resources": [ "../locales/{{locale}}/strings.l20n", "/shared/{{locale}}/date.l20n"? ] } Make HTML Elements Localizable Use the data-l10n-id attribute on an HTML element to mark it as localizable. <p data-l10n-id="about"></p> ...
... "default_locale": "en-US", "resources": [ "../locales/{{locale}}/strings.l20n", "/shared/{{locale}}/date.l20n"? ] } Make HTML Elements Localizable Use the data-l10n-id attribute on an HTML element to mark it as localizable. <p data-l10n-id="about"></p> Notice that you don't have to put the text content in the HTML anymore (you still can if you want to). All content lives in the localization resources. A safe subset of HTML elements (e.g. em, sup), attributes (e.g. title) and entities can be used in translations. In addition to the pre-defined whitelists, any element found in the original source HTML is allowed in the translation as well. Consider the following source HTML: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> Assume the f...
...And 2 more matches
Mozilla Content Localized in Your Language
All we ask is that you name this page according to this example, "Mozilla Content in Spanish (es-MX)" and add your locale code tag at the bottom. ...
...All we ask is that you name this page according to this example, "Mozilla Content in Spanish (es-MX)" and add your locale code tag at the bottom. ...
... name][building and suite numbers][addressee] Countries of European languages start from small to big: [addressee][street number and name][building and suite numbers][district][city][state/province][postal code][Country] Name Convention What are the order of family name and given name in your language. ...
...Title on the final page (meaning no more click through) should allow enough room to display full text. Buttons Capitalize the first letter of each word. Limit to one or two words. Use verbs that precisely describe the button's action. ...
Creating localizable web applications
om website for example. The URL http://getpersonas.com/nature/popular/2 points to the second page of the listing of the popular Personas in the "Nature" category. You could easily use list($category, $tab, $page) = explode('/', $path); to get this information directly from the URL. After that, it is tempting to use the $category or $tab variables in the interface. However, this is problematic for localization. You probably don't want to localize the URLs to keep them uniform across locales as well as to avoid issues with non-Latin and/or RTL characters. So in order to display a localized label of a category or a tab, you should create a mapping between the non-localizable English names used in the URLs and the localizable English strings used in the interface. Consider the following example: Snippet...
...="en"><?= _('Privacy policy'); ?></a> Don't mingle app logic and localizable content when using pure HTML If you decide not to use gettext on some pages (e.g. because they contain a lot of text and localizing source HTML is easier), make sure to keep the code responsible for application logic separate from the localizable content. The logic of the website should not be exposed directly in the localization files, to avoid any accidental changes by localizers. Snippet 1. Bad: require_once('lib/user.php'); $user = new PersonaUser(); Snippet 2. Good: require_once('templates/footer.php'); If it's not possible to remove the app logic code, you should consider using gettext. Gettext extracts localizable content form the source files, thus making it impossible for localizers to accidentally change th...
...%s MB>"), $size); Snippet 2. Good: function num_format($num, $decimals) { $locale_info = localeconv(); return number_format($num, $decimals, $locale_info['decimal_point'], $locale_info['thousands_sep']); } printf(_("%s MB"), num_format($size, 1)); Wrap as few HTML tags as possible When wrapping the localizable content with the gettext function calls, put all the code that irrelevant to localization outside the function call. Snippet 1. Bad: <?= _("<a href=\"https://addons.mozilla.org/firefox/downloads/latest/10900\" class=\"get-personas\" id=\"download\"><span>Get Personas for Firefox - Free</span>");?><span class="arrow"></span></a> Snippet 2. Good: <a href="https://addons.mozilla.org/firefox/downloads/latest/10900" class="get-personas" id="download"> <span><?= _("Get Personas for F...
...anslating. You can explain where the string will appear in the application, or what the variables used in the string will be replaced with. Put comments in the same line as the gettext function call (inline comments, in PHP these are /* ... */), or one line directly above the gettext function call (block comments, in PHP they start with # ... or // ...). In either way, use a consistent prefix for localization-related comments, e.g. "L10n". When extracting strings with xgettext you will be able to include only comments starting with this prefix using the --add-comments=PREFIX option, for example xgettext --add-comments=L10n. Snippet 1. Bad: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img src="/static/img/logo.png" alt="<?= _("Mozilla Labs Personas"); ?>" /> </a> </h1> Snippet 2. Good: <...
Writing localizable code
This page tells you about best practices and guidelines when dealing with UI code with respect to localization. It is aimed at Mozilla and extension developers. For technical details please also look at XUL_Tutorial:Localization. About Localizers A few notes about localizers for developers who rarely deal with them: localizers like tools, and they don't like editors, localization tools are often based on key-value pairs, at least some localizers have their talents focused on language skills and are not savvy in programming, or even building applications. ...
...Think of them as long variable names. If you change the semantics of a localized string, change the key. ...
...ed files, be sure to request feedback from l10n@. In most cases, you can just as well put the processing into the content code and reference different key-value pairs in l10n. Use a good source directory structure Be sure to put the localizable files in the right place. The addition of new top-level directories is a compromise between module ownership in the cvsroot repository and the ease of localization. Use a good chrome directory structure For a particular module mod, a target path jar:ab-CD.jar!/locale/ab-CD/mod/foo.dtd has been widely tested and is a good place for your files referenced as chrome://mod/locale/foo.dtd. Using a directory structure like this eases the localization process without the source code and is especcially recommended to extension authors. JAR Manifests can make thi...
...rees, there is the rule to not check in l10n-impact changes. So what does that mean? l10n-impact is any change to mozilla/@mod@/locales; Localizers find out if they have to catch up on changes by doing bonsai queries, just as everybody else does. No change means that this query result is empty. any changed or new use of existing localized strings; Anything that triggers a QA cycle on our 40+ localizations is l10n-impact. ...
l10n - Archive of obsolete content
Note that you can't currently use localize strings appearing in content scripts or HTML files, but you can share the localized strings you want by assigning it's values to a JSON serializable object. Globals Functions get(identifier, count, placeholder1...n) This function takes a string parameter which it uses as an identifier to look up and return a localized string in the locale currently set for Firefox. ...
...Hello! If this function can't find the string referenced by the identifier parameter, it returns the identifier itself. This enables you to write functional, localizable code without localizing any strings - just make the identifiers the default language: var _ = require("sdk/l10n").get; console.log(_("Hello!")); However, this will make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .properties files. If you're supplying different localizations for a string depending on the number of items (that is, whether to use a singular or plural form) then get() takes a second integer parameter which indicates the number of items there are. You can supply one or more placeholders to get(), which are strings, such as proper...
...ch indicates the number of items there are. You can supply one or more placeholders to get(), which are strings, such as proper names, that should not be translated themselves but instead should be inserted into the translated string. You can't use plurals and placeholders in the same expression: if you do, the placeholders will be ignored. Parameters identifier : string A identifier for the localization of a particular string in the current locale. count : integer Optional parameter. If you're supplying different localizations for a string for singular or plural forms, this parameter is the number of items there are in this case. var _ = require("sdk/l10n").get; console.log(_("child_id", 1)); console.log(_("child_id", 2)); See the tutorial on plural support for more information. Note that i...
simple-prefs - Archive of obsolete content
type of the stored value depends on the default value. The options are specified by a mandatory "options" attribute, that is an array of objects with mandatory attributes "label" and "value" The values of the "value" attributes must be supplied as strings. The values of the "label" attributes prefixed with "{name}_options.", where {name} is the name of the preference, are used as localization keys. If no matching entries are found, the value of the "label" attributes is used verbatim as labels. { "name": "typeOfBreath", "type": "menulist", "title": "Type of breath", "value": 0, "options": [ { "value": "0", "label": "Fire" }, { "value": "1", "label": "Cold" }, { ...
...type of the stored value depends on the default value. The options are specified by a mandatory "options" attribute, that is an array of objects with mandatory attributes "label" and "value" The values of the "value" attributes must be supplied as strings. The values of the "label" attributes prefixed with "{name}_options.", where {name} is the name of the preference, are used as localization keys. If no matching entries are found, the value of the "label" attributes is used verbatim as labels. { "name": "alignment", "type": "radio", "title": "Alignment", "value": "N", "options": [ { "value": "L", "label": "Lawful" }, { "value": "N", "label": "Neutral" }, { ...
...lled. This type requires a mandatory attribute called "label" which is provided as a string. It is used to label the button. In "package.json": { "type": "control", "label": "Click me!", "name": "sayHello", "title": "Say Hello" } In "main.js": var sp = require("sdk/simple-prefs"); sp.on("sayHello", function() { console.log("hello"); }); Localization Using the SDK's localization system, you can provide translated forms of the title and description attributes. See the localization tutorial for more details. Getting and setting preferences Unless you've marked them as hidden, the user will be able to see and change the preferences in the Add-on Manager. You can also see them and change them programmatically using the prefs property, and lis...
How to convert an overlay extension to restartless - Archive of obsolete content
Some of that will have to be replaced and the rest will need to be loaded differently. ...
...om "myAddonName-unload" event and just tear down and clean up when that event or a regular "unload" event comes in. Step 10: Bypass cache when loading properties files The above will get you a working add-on that will install without a Firefox restart. It will even get you a working add-on that will update without a Firefox restart... usually. Some parts work only if you don't look too closely; localization is one of them. As mentioned in the previous section, you'll need to clear the chrome caches on add-on shutdown, namely for chrome images and properties files. Doing this will get an update's new properties file to load, however sometimes this will instead produce an error on the next property access. It just doesn't seem that it can reliably clear the cache correctly, for whatever reason. String...
...wever it will now also load cleanly on add-on updates. The old file should still be cleared. Put it all together That should be all the pieces. Your chrome.manifest will have just chrome and locale (and possibly skin) mappings in it now. No resource mappings or chrome overlays. The new entry point for your add-on is via bootstrap.js:startup() rather than a "load" handler in a XUL overlay. Your localization handling should be unaffected by your transition to a restartless/extractionless add-on so long as you properly clear the chrome cache on add-on shutdown and load your properties files using the method listed above. Your property files and DTD files loaded from chrome:// URIs should work just as before. This is all assuming a minimum version of Firefox 17+ (or other Gecko 17+ application) which y...
A XUL Bestiary - Archive of obsolete content
la's XML-based User Interface Language, XUL. Chrome Some of the most powerful and frequently misunderstood features of XUL and the Mozilla browser have to do with chrome. The term chrome is used in different contexts to mean different things. In general, chrome refers to a XUL interface and all of its supporting files; chrome means the XUL content and structure, plus the CSS skin, plus whatever localization and platform-specific files are part of that XUL interface. By contrast, the skin is just the CSS and referenced graphics for a XUL file, the localization strings are just a DTD, and the content is just the XUL. The Chrome URL This concept of a chrome as an integrated, dynamic thing in some way divorced from the "appcore" is realized in the use of the chrome URL to point to chunks of XUL and th...
...nd begins to suggest some possibilities for XUL-as-platform beyond the simple restyling of the browser. Package A package is in some ways like a chrome, but it is specific to the Mozilla architecture. A package is a chunk of interface code that sits in a particular place within Mozilla's package hierarchy. ...
... skin/ default/ navigator.css nav-icon.gif ... ...
XUL Coding Style Guidelines - Archive of obsolete content
Introduction XUL, pronounced as "zool", stands for "XML-based User Interface Language", is a cross platform way of describing user interface. It could contain XUL specific element types for UI controls, HTML4 markups for content data, and even JavaScript for user event handling. To make XUL files easy to read and maintain, localization friendly, and portable across user agents, we need to have a set of coding style guidelines to ensure our objectives are achievable. The author has collected a set of guidelines from various sources listed in the References section. While some of the guidelines are recommended practices, the others are mandatory. XML, XUL, HTML, and XHTML guidelines The following are considered good coding style for XML/XUL documents. Disobeying them might not cause any parsi...
..., Mozilla 5.0, this is not true any more. Most of the windows and dialogs in Mozilla will be described using XUL. To make XUL stream/file localizable, several guidelines are to be adopted to make the translation work easier and less error-prone. The issues are discussed in details here: What is localizable? Widget resources Content data Style info Layout geometry How to make them localizable? Localization Notes Localization notes are the XUL writers' notes to the localizers/translators. They are placed above the actual entity string in the format: <!-- LOCALIZATION NOTE (entity.name): content --> where the <var>entity.name</var> is the entity name (id) for the string (entity value) to be localized, and the content provides helpful hints to the localizers. For example: <!-- LOCALIZATION NOTE h...
...> where the <var>entity.name</var> is the entity name (id) for the string (entity value) to be localized, and the content provides helpful hints to the localizers. For example: <!-- LOCALIZATION NOTE homeBtn.label : Do not translate the entity value "Home". --> <!-- ENTITY homeBtn.label "Home" --> Properties files are very similar, but use the pound sign instead of <!--<var>xxxxx</var>-->: # LOCALIZATION NOTE entity name : content We recognize that translation is a subset of localization even though we've consistently referred to our notes as "LOCALIZATION NOTE". Files not to be localized? Some files live in the tree but aren't really part of the build; they're just there as programming examples or a kind of source documentation. To prevent them from being localized, you may insert a line of c...
2006-10-06 - Archive of obsolete content
FFx 2 RC2 testing today L10n builds were completed was completed and ready for test. test resumt will be found here Another Lightning localization update with some bad news Difference has been located between SUNBIRD_0_3_BRANCH (for Sunbird 0.3) and MOZILLA_1_8_BRANCH. ...
... Summary: mozilla.dev.l10n - October 6, 2006 Announcements English United States Dictionary English United States Dictionary for firefox 2. Firefox 2 sign-off procedure Localization team should begin intense QA as outlined here. FFx 2 RC2 testing today L10n builds were completed was completed and ready for test. ...
...or firefox 2. Firefox 2 sign-off procedure Localization team should begin intense QA as outlined here. FFx 2 RC2 testing today L10n builds were completed was completed and ready for test. test resumt will be found here Another Lightning localization update with some bad news Difference has been located between SUNBIRD_0_3_BRANCH (for Sunbird 0.3) and MOZILLA_1_8_BRANCH. Sunbird/Lightning localization update You need to update your localization if you want your locale to ship with Lightning 0.3 or Sunbird 0.3. MozillaTranslator 5.13 RFEs new version of MozillaTranslator will be relaesed in a few weeks. Calendar localization update RC1 for Sunbird 0.3 is out now and ready for testing. L10n locked down - FF2 RC2 Code Freeze 9/29/2006 at 9AM PDT the l10n repository is locked down. Dis...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
ative work using a GPL-licensed program must be released under the same terms (free to use, share, study, and modify), the LGPL only requires the LGPL-licensed component of the derivative program to continue using the LGPL, not the whole program. LGPL is usually used to license shared components such as libraries (.dll, .so, .jar, etc.). 246 LTR (Left To Right) Composing, Glossary, Localization LTR (Left To Right) is a locale property indicating that text is written from left to right. For example, the en-US locale (for US English) specifies left-to-right. 247 Latency Audio, Glossary, Media, Networking, Reference, Video, Web Performance, latency Latency is the network time it takes for a requested resource to reach its destination. Low latency is good, meaning...
..., the variable name is only bound to its value within a scope which is not the global scope). 252 Local variable CodingScripting, Glossary, NeedsContent A variable whose name is bound to its value only within a local scope. 253 Locale Composing, Glossary, Locale Locale is a set of language- or country-based preferences for a user interface. 254 Localization Collaborating, Glossary, Intro, Localization, WebMechanics Localization (l10n) is the process of adapting a software user interface to a specific culture. 255 Long task Glossary, Long Tasks API, Reference, Web Performance A long task is a task that takes more than 50ms to complete. 256 Loop CodingScripting, Glossary, control flow, programming A...
...(RTCP) is a partner to the RTP protocol. RTCP is used to provide control and statistical information about an RTP media streaming session. 358 RTF Composing, Format, Glossary, RTF, Rich Text Format RTF (Rich Text Format) is a plain-text-based file format with support for formatting instructions (like bold or italic). 359 RTL (Right to Left) Composing, Glossary, Localization RTL (Right To Left) is a locale property indicating that text is written from right to left. 360 RTP (Real-time Transport Protocol) and SRTP (Secure RTP) Glossary, Network, Protocol, RTP The Real-time Transport Protocol (RTP) is a network protocol which described how to transmit various media (audio, video) from one endpoint to another in a real-time fashion. RTP is sui...
Creating a Language Pack
This page is out of date. Please consult the documentation on localized builds on firefox-source-docs. To create a language pack, or a localization repack, you first need to go through the initial setup process. Pre-build steps In the .mozconfig, you want to have mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-firefox-build ac_add_options --disable-compile-environment ac_add_options --with-l10n-base=../l10n-central # path relative to MOZ_OBJDIR ac_add_options --enable-application=[browser or mail] The given path should have your localization directory as child (i.e., a subdirectory ab-CD where ab-CD is your locale code). You still need to specify which application you're localizing (e.g., for Firefox, that's browser, Thunderbird would be mail). Configure step You need to prepare the build...
...this file ... // lots of notifications about missing entities ... x-testing: changed: 6 missingInFiles: 6124 missing: 5 0% of entries changed This step is not necessary anymore to create the language pack, because it is included in the next command. It is only useful if you want to preview the contents of the mergedir. You'll see that it contains the files which in your localization were missing some entities. All other files will be taken from x-testing directly. It's now time to create a langpack with: $ make langpack-x-testing LOCALE_MERGEDIR=$(PWD)/mergedir Each time you need to generate a new langpack, you need to run this command. Remember that you need to be in the directory obj-firefox-build/browser/locales. $ make langpack-x-testing LOCALE_MERGEDIR=$(PWD)/mergedi...
...c/l10n-central x-testing x-testing: browser chrome browser aboutCertError.dtd // add and localize this file ... // lots of notifications about missing entities ... x-testing: changed: 6 missingInFiles: 6124 missing: 5 0% of entries changed If you now preview the contents of the mergedir, you'll see that it contains the files which in your localization were missing some entities. All other files will be taken from en-US directly. It's now time to repackage the en-US binary with $ make installers-x-testing LOCALE_MERGEDIR=$(PWD)/mergedir Again, for 64-bit Mac, append MOZ_PKG_PLATFORM=mac to this command. Each time you want to generate a new binary (often called a "repack"), you need to run these two commands. Remember that you need to be in...
L10n Checks
ched/ $ sudo python setup.py install or, if you're on Windows: $ hg clone http://hg.mozilla.org/users/akalla_aviary.pl/silme-patched/ $ cd silme-patched/ $ python setup.py install Running it Mercurial source (source) mode L10n Checks gathers the directories to compare from an ini file, usually found in $APP/locales/l10n.ini. You pass both the path to the ini file and the parent directory of the localizations as first arguments, followed by the locale codes of the locales you want to compare. If you want to test the localization for de, run: check-l10n-completeness browser/locales/l10n.ini ../l10n/ de Add-ons (xpi) mode L10n Checks gathers the locales to compare from the chrome.manifest file inside the xpi file. You pass the path to the xpi file (optionally) followed by the locale codes of the local...
...es of the locales you want to compare. If you want to test the localization for de, run: check-l10n-completeness browser/locales/l10n.ini ../l10n/ de Add-ons (xpi) mode L10n Checks gathers the locales to compare from the chrome.manifest file inside the xpi file. You pass the path to the xpi file (optionally) followed by the locale codes of the locales you want to compare. If you want to test the localization for de, run: check-l10n-completeness -i xpi my-extension.xpi de To check all locales in an extension: check-l10n-completeness -i xpi my-extension.xpi Language packs (xpis) mode L10n Checks can compare two locales found in different xpi files. You pass both paths to the xpi file and both paths to the locales inside the files, e.g.: check-l10n-completeness -i xpis en-US-langpack.xpi my-langpack.x...
...own in a hierarchical form, so in the example above, your files are browser.dtd in ab-CD/browser/chrome/browser and migration.dtd in another directory level deeper. The output closes with a summary, giving the total counts of missing and obsolete strings and some statistics on how many strings are changed or not, excluding access and command keys. That gives localizers an idea on how thorough the localization is. This number won't reach 100% in general; mid 80s should be the target, though. Options Reference locale In the source and xpi modes you can change the default reference locale (en-US) by setting the -r parameter, e.g.: check-l10n-completeness -r pl browser/locales/l10n.ini ../l10n/ de Output mode You can change the look and feel of the output by setting the -o parameter to 0 (tree; default),...
L10n testing with xcode
Follow the cloning and building instructions for Firefox on iOS. Open the Client.xcodeproj file in Xcode. Select the Client project in the left pane and choose Editor > Import Localizations from the toolbar and select your localized XLIFF file. A window will then appear showing the diff between the imported XLIFF file and the existing resources in the project folder. Click the Import button. ...
...ect folder and replacing the existing strings. Next, you need to configure the iOS app simulator to run the app in your locale. Choose Product > Scheme > Edit Scheme from the toolbar menu. In the Edit Scheme screen, select Run from the left pane and then navigate to the Options tab. Select your language from the Application Language menu and click Close. Tah dah! You're ready to test your localization of Firefox on iOS. Launching & testing your Firefox on iOS localization The iOS Simulator is fairly easy to use once you launch your app. To perform the next steps, you'll need to be familiar with how user gestures and hardware interactions work in the simulator. This guide should help. Press the Run button in the upper left-hand corner (the button has a playback icon). Navigate to...
... In the iOS Simulator, press the Home button from the Hardware toolbar menu. Navigate to the Settings app, open it, and go to General > Accessibility. Slide the Accessibility Inspector switch to On. The Accessibility Inspector remains active until you turn it off, even if you quit and restart iOS Simulator. Press the Home button again, navigate to the pane with your Firefox for iOS localization on it, and reopen Firefox. Now, you can navigate through the Firefox app in the iOS Simulator, viewing both UI elements and accessibility strings as you go. Congratulations, now your testing your app! See, that wasn't so hard, right? ...
Localizing extension metadata on addons.mozilla.org
e default locale. Getting translation help You are kindly advised NOT to use any automatic online translation, which can bring unpleasant low-quality output to users. Always prefer a qualified human translation. ...
...provide translation assistance to extension authors, but there are a couple services that can help: BabelZilla.org BabelZilla.org is a community dedicated to the localization of extensions for Moz family apps. They are volunteer translators from all over the world and are maintaining translations for more than 400 extensions with an online translation system. They also provide help for adding a localization support to your extension if there is no localization structure yet. You can already request for AMO fields localization on the forums, and these fields will be added soon to the Web Translation System. Amazon Mechanical Turk This is not free, but for a very modest amount of money you can get your AMO page quickly translated by native speakers. Create an account and then, using the "Basic Open-...
...ge quickly translated by native speakers. Create an account and then, using the "Basic Open-ended Question" template, follow the instructions to upload the text of your AMO page. On the Properties page you can specify the location of the worker in order to restrict to people living in the country where the language is spoken. The Reward is up to you, but $5-10 per translation seems to work well. Localization codes AMO offers 33 localizations, including English. Here is a list of the codes: Arabic (ar), Catalan (ca), Czech (cs), Danish (da), German (de), Greek (el), Basque (eu), Spanish (es-ES), Farsi (fa), Finnish (fi), French (fr), Gaeilge (ga-IE), Hebrew (he), Hungarian (hu), Indonesian (id), Italian (it), Japanese (ja), Korean (ko), Mongolian (mn), Dutch (nl), Polish (pl), Brazilian Portuguese (...
Localizing with Mercurial
Mercurial allows localizers to work locally (on their machines) and then push (an Hg term) changes to a remote repository, which usually is hosted on the Mozilla servers (hg.mozilla.org). Localizing current versions of Firefox, Thunderbird and SeaMonkey includes working with Mercurial. If the documentation is incomplete or you have questions, please drop by the #l10n or #hg channels on irc.mozilla.org. The Mercurial FAQ are also worth a read, should you run into trouble. ...
...underbird: hg clone https://hg.mozilla.org/comm-central/ cd comm-central python client.py checkout The first command will create a clone of the comm-central repository. The second command will move you into that directory. The third command will do a clone of mozilla-central, and pull some other hg repositories. The other directories are required for SeaMonkey and Thunderbird. Cloning your localization repository for the first time is just as easy. For example, to clone your Firefox Nightly L10n repo, run the following command, replacing ab-CD with your locale code: hg clone https://hg.mozilla.org/l10n-central/ab-CD/ Updating your local repos To update your working copy of mozilla-central, go to your local mozilla-central directory and run: hg pull -u This will both get new changesets...
...atches. Mercurial account priviledges Eventually, you or your team leader will need Hg account priviledges. Let's face it, it's just more convenient to commit and push your work to the remote repo yourself, rather than creating patches and asking someone else to push them for you. To get write access to the l10n hg repositories on the Mozilla server, there's a bit of paper work to be done. The localization team owner needs to file a bug requesting an hg account. This bug will request level 1 L10n priviledges. You need to follow the instructions regarding the contributor form. Write access to the hg repositories requires a ''voucher'', which, for the owner, will be done based on the review by Mozilla. For peers of a localization, the owner can vouch (once she or he is registered). Sending changes t...
Localizing with Mozilla Translator
lator also. If you decide to use MozillaTranslator, be sure you have Java 1.7 or above installed on your system. Like most CAT tools, MozillaTranslator employs glossaries and translation memory to leverage your work from previous translations, thus cutting time and effort when localizing new versions of Mozilla applications. Getting started with MozillaTranslator MT uses products as groups of localization files with a common root directory (for instance, you may have a product for Thunderbird, other for SeaMonkey, other for Dom, other for Toolkit, etc.) You update your repository copy using your favorite repository tool, and then update the product(s) in MT. This will remove obsolete strings and files from the internal database of MT, and will present you with a list of new and updated strings. ...
...directory (for instance, you may have a product for Thunderbird, other for SeaMonkey, other for Dom, other for Toolkit, etc.) You update your repository copy using your favorite repository tool, and then update the product(s) in MT. This will remove obsolete strings and files from the internal database of MT, and will present you with a list of new and updated strings. If you are starting a new localization, all strings will be marked as new or updated.MT puts a fuzzy flag on each flag and saves it in its database. All this means is that the strings have yet to be translated. You can save your work in progress and reopen it to continue working by selecting View Fuzzy from the Edit menu. After translating those strings (if using the Edit Phrase dialog, you can get translation suggestions for strings...
...s temporary nature, don't fit in the user manual. Migrating contents when the directory structure changes Overall, if you are a ''good'' MT user and you do things like: checking "Keep Original" flags for strings not needing translation, instead of just leaving the translation empty struggling to get empty lists when running "Untranslated strings" and "View Fuzzy" if you are up to date in localization regularly running QA checks and trying to minimize them. you will always do better if you can export a partial glossary and reimport it as needed. See the following example. Let's assume you have a Firefox product in MT with the directory layout present in language packs, as you probably would need for a initial localization. The directory structure will look like this: (ab-CD JAR root) ...
QA phase
n repack), which allows you to install next to your existing Mozilla application installation and use separately. Visit the links above to learn how to make these testing builds. Testing your L10n & seeing your work Now that you have your langpack or L10n repack, let's discuss seeing your work and testing it in the application. Testing the langpack will put you one step closer to having your localization added to the L10n releases. Follow the steps below to test your localization: Install Aurora in your preferred language. Install the .xpi langpack you just created (or exported). Set your language using the Quick Locale Switcher or Locale Switcher add-ons by navigating to Tools->Language->Your localization's language code. Restart your browser and start testing! Now you should be able to ...
...tall Aurora in your preferred language. Install the .xpi langpack you just created (or exported). Set your language using the Quick Locale Switcher or Locale Switcher add-ons by navigating to Tools->Language->Your localization's language code. Restart your browser and start testing! Now you should be able to see all of your work up to this point. Click here for guidelines on how to test your localization. Don't lose your work! Your work is SO important! We would really hate to see you lose any of it. After you test your localization, you should send it to a remote repository, which will serve as a backup for your work and will let others follow your progress. We're going to go through the process below. The official localization teams use repositories at hg.mozilla.org. Before a team becomes o...
... on your local machine. If you're using Koala, this should be located at /path/to/your/koala.project/locale/3.6/x-testing, otherwise, it should be located at /path/to/your/working_dir/l10n_base/x-testing. In this directory, you should have an hg repository. You might have created it yourself by running hg init or hg clone or you might have had it created by Koala when you were setting up a new localization project. Also at this point, you shouldn't have any uncommitted changes (i.e., running the hg status command should show nothing). Let's see what the last revision in this repository is. Enter the following command: $ hg log -l 1 You should see an output similar to the one below: changeset: 0:7c543e8f3a6a tag: tip user: Your Name <email@example.com> date: Mon Nov 23 ...
Translation phase
client, an HTML editor, web development tools, and an IRC chat client. Firefox Mobile By adding Firefox(R) to your mobile phone, you can access rich Web content and enjoy your favorite Firefox features wherever you go. Lightning Lightning is a popular calendaring, scheduling and task management extension. If your locale has an hg repository hosted on the Mozilla servers, you can track your localization's current progress by visiting the l10n dashboards. Note: If you are starting a new localization and decide to use an offline tool for localizing Mozilla applications, you will need to become familiar with using Mercurial (hg). Visit the tutorial on using hg in your localization efforts here. Mozilla websites So you're interested in localizing Mozilla websites. Each l10n tool follows a diff...
...mpaigns Individual campaigns created by Mozilla to attract new contributors. hacks.mozilla.org For everyone interested in the leading-edge stuff that people are doing with Mozilla Firefox and the open web. In-product pages A set of pages used to interact with and give information to the end-user as part of their first experience with their Mozilla applications. If you are creating your own localization, there are a number of Mozilla websites that need to be localized before your efforts become an officially released localization. See the list of localized Mozilla websites. You should also read more information on localizing Mozilla web projects. Add-ons l10n for add-ons is handled by at least two other organizations/services called Babelzilla and Adofex. They both have created compreh...
...d more information on localizing Mozilla web projects. Add-ons l10n for add-ons is handled by at least two other organizations/services called Babelzilla and Adofex. They both have created comprehensive programs and l10n tools for localizing any and all third-party add-ons for Mozilla applications. Visit their websites to learn how to get involved. Babelzilla Adofex Tool-independent localization Are you a command-line master? Do you prefer Unicode text editors to any other applications on Earth? Do you have a pet CAT (computer-assisted translation) tool, like OmegaT? Then you may not be interested in using any of the tools listed above for your localizations. If that is the case, then this section is for you! For localizers who prefer localizing without a specialized tool the workflows...
Web Localizability
Why localizability is important There are many reasons why you should start thinking about making your web app localizable as soon as possible. You will make localizer's life easier, for which they will be grateful. ...
... Why localizability is important There are many reasons why you should start thinking about making your web app localizable as soon as possible. You will make localizer's life easier, for which they will be grateful. ...
... Why localizability is important There are many reasons why you should start thinking about making your web app localizable as soon as possible. You will make localizer's life easier, for which they will be grateful. You will have quality content, localized and adapted to the needs of the local market. ...
Research and prep
Productization is the process of determining a user's choice of default search engines, content and protocol handlers (RSS Readers, Web Mail and Web Calendar), bookmarks, and links to recommended sites on the in-product pages as it relates to their locale. It is one of the most customizable and localizable parts of the product l10n process, as it goes beyond string translation. We believe that localization teams are in the best position to provide recommendations on what local providers we can use for web services because you're in the market, work in the language, and know your users. This is, therefore, meant to be a guideline for how you should be formulating your recommendations. Here's the basic process: File a bug under Mozilla Localizations>[your_locale] to request updates to your locale's...
...dations on what local providers we can use for web services because you're in the market, work in the language, and know your users. This is, therefore, meant to be a guideline for how you should be formulating your recommendations. Here's the basic process: File a bug under Mozilla Localizations>[your_locale] to request updates to your locale's productization preferences. If this is your first localization for a product, the l10n drivers will file this bug as part of the new product localization release process. It is your l10n team's responsibility to perform research and identify the most appropriate web services for your region and present them in your bug as your informed recommendations. If there's no existing collaboration with the site provider and Mozilla, ask for permission from the site...
...ections for default RSS readers and content handlers should follow these guidelines: Be translated in your language (because it makes the application unusable if it's not in your language Provide for the intended user experience (e.g., minimal to no advertisements within the user experience) No more than three (if possible) choices. Choosing based on popularity is fine. Examples from various localizations Some examples from en-US Web Service Provider Rationale Global Search Google Best user experience and broadest results. e-Commerce Search Amazon Broad set of products, simple search interface with no/limited advertising, popular shopping engine. Specific Interest Wikipedia Good user experience (no ads, simple interface), popular sit...
L20n
Note: This document is in draft form/out-of-date -- for current documentation please see our documentation on GitHub. A JavaScript localization framework to unleash your natural language's power with simple code. Introducing L20n L20n reinvents software localization. Users should be able to benefit from the entire expressive power of the natural language. L20n keeps simple things simple, and at the same time makes complex things possible. Through L20n, Mozilla is creating a new generation of technology that places more power in localizers' hands. L20n lets localizers reach higher levels of free linguistic expression by sharpening the divide between localization and application logic. It allows to adapt your web application not only to languages and cultures, but also contextual data, u...
...being provided: <brandName "Firefox"> <about "About {{ brandName }}"> Here is the same string being provided in Slovenian: <brandName { nominative: "Firefox", genitive: "Firefoxa", dative: "Firefoxu", accusative: "Firefox", locative: "Firefoxu", instrumental: "Firefoxom" }> <about "O {{ brandName.locative }}"> For Developers Documentation for developers wanting to implement localization functionality on their web apps using L20n. Internationalization for your web app First read for developers looking to use the L20n infrastructure. L20n's HTML bindings Tutorial on implementing L20n in your HTML code. L20n JavaScript API An API for l20n.js. L20n syntax cheatsheet for developers A simple cheatsheet to help developers as they add L20n to their localization infrastructure.
... API An API for l20n.js. L20n syntax cheatsheet for developers A simple cheatsheet to help developers as they add L20n to their localization infrastructure. For Localizers Documentation for Localizers creating localized content for a project that uses L20n. Learn the L20n syntax How to naturally localize applications using L20n. Complete with use cases and examples of L20n in action. Localization use-cases How to naturally localize applications using L20n. Complete with use cases and examples of L20n in action. L20n and Translation Memory eXchange (TMX) How L20n impacts the Translation Memory eXchange standard for translation memory data. L20n syntax cheatsheet for localizers A simple cheatsheet to help localizers as they localize projects with L20n. Additional resources Some ad...
compare-locales
it requires that you have Python 2.7 or 3.5+ installed on your machine. The easiest way is to just run $ pip install -U compare-locales Running it compare-locales gathers the directories to compare from a TOML file, usually found in $APP/locales/l10n.toml. The details of the configuration file are described in the l10n-config docs. ...
...ompare-locales Running it compare-locales gathers the directories to compare from a TOML file, usually found in $APP/locales/l10n.toml. The details of the configuration file are described in the l10n-config docs. You pass the path to the toml file and the parent dir of the localizations as first arguments, followed by the locale codes of the locales you want to compare. ...
...rarchical form, so in the example above, your files are browser.dtd in ab-CD/browser/chrome/browser and migration.dtd in another directory level deeper. The output closes with a summary, giving the total counts of missing and obsolete strings and words, and some statistics on how many strings are changed or not, excluding access- and commandkeys. That gives localizers an idea on how thorough the localization is. This number won't reach 100% in general, mid 80s should be the target, though. Pass --json to get just the summary in JSON format. ...
Activity Manager examples
nents.interfaces.nsIActivityProcess; const nsIAE = Components.interfaces.nsIActivityEvent; const nsIAM = Components.interfaces.nsIActivityManager; let gActivityManager = Components.classes["@mozilla.org/activity-manager;1"].getService(nsIAM); let process = Components.classes["@mozilla.org/activity-process;1"].createInstance(nsIAP); // Assuming folder is an instance of nsIMsgFolder interface // Localization is omitted, initiator is not provided process.init("Processing folder: " + folder.prettiestName, null); // Note that we don't define a custom icon, default process icon // will be used process.contextType = "account"; // group this activity by account process.contextObj = folder.server; // account in question gActivityManager.addActivity(process); // Step 2: Showing some progr...
...g some progress let percent = 50; process.setProgress(percent, "Junk processing 25 of 50 messages", 25, 50); // Step 3: Removing the process and adding an Event using Process' attributes process.state = Components.interfaces.nsIActivityProcess.STATE_COMPLETED; gActivityManager.removeActivity(process.id); let event = Components.classes["@mozilla.org/activity-event;1"].createInstance(nsIAE); // Localization is omitted, initiator is omitted event.init(folder.prettiestName + " is processed", null, "No junk found", process.startTime, // start time Date.now()); // completion time event.contextType = process.contextType; // optional event.contextObj = process.contextObj; // optional gActivityManager.addActivity(event); Showing a user-defined activ...
..... } SenderContextDisplayHelper.prototype = { getContextDisplayText: function(contextType, contextObj) { // in this particular example we know that contextType is "Sender" // since we also pass the contextType along with the contextObject // in some cases, one helper can be registered for a group of context types // we know that the context object is the author of the message // Localization is omitted return "Messages coming from " + contextObj.surname + ", " + contextObj.firstname; } } // Step 2: Register the helper for this context type gActivityManager.registerContextDisplayHelper("Sender", new SenderContextDisplayHelper()); // Step 3: Create the process ... let process = new nsActProcess("Processing folder: " + folder.prettiest...
package.json - Archive of obsolete content
license The name of the license under which the add-on is distributed, with an optional URL in parentheses. Defaults to "MPL-2.0". Note: It is recommended that you use an SPDX license ID. locales An object holding JSON objects referenced by a locale name that use the following keys: title, description and homepage. These JSON objects will be used to localizations for the add-on's meta data shown within the Add-ons Manager. See the documentation for how to localize the add-on's meta data. main A string representing the name of a program module that is located in one of the top-level module directories specified by lib. Defaults to "index.js". name The add-on's name. This name cannot contain spaces or periods,...
...ternative branch for your add-on's simple-prefs. See "Simple-prefs in the preferences system" for more details. title The human-readable title of the package; this can contain spaces. If this key is present, its value will be used as the add-on's em:name element in its install.rdf. translators An array of strings listing the people who contributed to the localization of this add-on. These values will be used as the add-on's em:translator elements in its install.rdf. Note: jpm supports NodeJS people fields. unpack Same as the unpack in an install.rdf file. Useful when the extension contains binaries. updateKey Same as the updateKey in an install.rdf file. See Supporting updates for self-hosted add-o...
Bootstrapped extensions - Archive of obsolete content
Note: An add-on may be upgraded/downgraded at application startup, in this case the startup method reason is APP_STARTUP, and the oldVersion property is not set. Also be aware that in some circumstances an add-on upgrade/downgrade may occur without the uninstall method being called. Add-on debugger From Firefox 31 onwards, you can use the Add-on Debugger to debug bootstrapped add-ons. Localization (L10n) Localizing bootstrapped add-ons is very much the same since Firefox 7, as that is when chrome.manifest compatibility landed. JS and JSM Files - Using Property Files To localize your .js and .jsm files you have to use property files. The absolute minimum needed here is: File: install.rdf File: chrome.manifest File: bootstrap.js Folder: locale Folder: VALID_LOCALE_HERE ...
...F_YOUR_ADDON en-US locale/ Here is an example add-on that opens an HTML page and a XUL page on install: GitHub :: l10n-xhtml-xul. Here is an example showing how to use a localized HTML page as an options page: GitHub :: l10n-html-options. You can go to about:config and change the value of the preference general.useragent.locale to en-US and then to en-GB and then reload the open pages to see the localization change. Further reading How to convert an overlay extension to restartless a step by step guide. Some code samples are provided. The page is based on and expanded from Dave Garrett's step-by-step guide to convert an old overlay based extension into a restartless addon. Dave Townsend provides a basic code base to load UI for each opened window in a bootstrapped extension. Mark Finkle provide...
Adding windows and dialogs - Archive of obsolete content
are several types of dialogs that are fairly common, so there are ways to create them easily without having to reinvent the wheel and write all their XUL and JS code all over again. Whenever you need a new dialog, you should ask yourself if it can be implemented using these common dialogs, and use them whenever it is possible. They have been thoroughly tested for OS integration, accessbility and localization, so you save yourself a lot of work and favor them. Using the Prompt Service is the recommended way to create common dialogs in an extension. Read the article and its examples carefully, because there are many useful functions to use in the Prompt Service. There are some equivalent, simpler functions that are available in the window object, but those are meant for unprivileged HTML JavaScript co...
...s without having to worry about your dialog looking odd in some operating systems. The only constant rule is that clicking on OK and Cancel will close the dialog unless your associated function returns false. You should avoid returning false, though, specially with the Cancel button. Dialogs in general should be easy to dismiss. Your dialogs shouldn't have fixed dimensions because of potential localization problems. Dialogs are sized to their contents and will generally work fine. However, there are cases where the dialog contents are generated or expanded dynamically by your code, and you'll need to resize them appropriately. The window.sizeToContent function is what you need in this case. Input Controls Most additional XUL windows and dialogs in extensions are some kind of input form. Let's l...
Source code directories overview - Archive of obsolete content
etc. gfx contains C interfaces and code for platform independent drawing and imaging. It can be used to draw rectangles, lines, images, etc. Essentially, it is a a set of interfaces for a platform-independent device (drawing) context. It does not handle widgets or specific drawing routines; it just provides the primitive operations for drawing. intl contains C interfaces and code for supporting localization. It contains code for various character sets, locale formats (e.g. the format of the date and time for different cultures) and other localization facilities. ipc contains jpeg contains C code for reading/writing JPEG images. This code originated as the reference implementation for the JPEG specification from the Independent JPEG Group. js contains C code for tokenizing, parsing, interpretting ...
... layout contains the C interfaces and code for the layout engine. The layout engine decides how to divide up the "window real estate" among all the pieces of content. It resizes and aligns pieces of content according to the CSS1 and CSS2 (cascading style sheets), alignment styles and the content itself. ...
Creating XPI Installer Modules - Archive of obsolete content
package), you ought to be able to see the image and the JavaScript function working as defined in barley.js (provided that both all three files are in the same working directory). Organizing the Resources Now that you have created the basic files to be included in your package, you should put them all in a single directory so that they can be bundled up. When your package includes its own theme, localization packs, or other components it's convenient (but not necessary to create a subdirectory structure that reflects the role of the different parts. For the Barley package, you only need to create a single subdirectory, content/ (see figure below). barley/ content/ barley.gif barley.js barley.xul Creating the contents.rdf File One of the most important ingredients of the software packag...
...te a single subdirectory, content/ (see figure below). barley/ content/ barley.gif barley.js barley.xul Creating the contents.rdf File One of the most important ingredients of the software package is the contents.rdf file that describes the contents of the package in terms that the chrome registry can make sense of. For a package such as this one with its own content but no special localization or custom skin, the contents.rdf file describes package in terms of its relation to the "root" package of Mozilla. In the following listing, the items in red are particular to the barley package and can be edited for your own distribution: <?xml version="1.0"?> <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <!-- list all the ...
2006-11-10 - Archive of obsolete content
SeaMonkey 1.0.6 and 1.1 Beta upcoming SeaMonkey 1.0.6 and 1.1 Beta are both available here. ...
... SeaMonkey 1.0.6 and 1.1 Beta upcoming SeaMonkey 1.0.6 and 1.1 Beta are both available here. Discussions Help about Firefox 3 A discussion on how to syncronise MOZILLA_1_8_BRANCH with the trunk, which tag should be used to check-in files on trunk, and when files will be pulled from trunk to create another branch (MOZILLA_1_9_BRANCH?) for Firefox 3. ...
E4X for templating - Archive of obsolete content
createBundle('chrome://myeExt/locale/myExt.properties'); if (args){ args = Array.prototype.slice.call(argument...
... createBundle('chrome://myeExt/locale/myExt.properties'); if (args){ args = Array.prototype.slice.call(arguments, 1); return STRS.formatStringFromName(msg,args,args.length); } return STRS.GetStri...
Date.prototype.toLocaleFormat() - Archive of obsolete content
mat expected by the strftime() function in C. Return value A string representing the given date using the specified formatting. Description The toLocaleFormat() method provides greater software control over the formatting of the generated date and/or time. Names for months and days of the week are localized using the operating system's locale. However, ordering of the day and month and other localization tasks are not handled automatically since you have control over the order in which they occur. You should take care that the format string is localized properly according to the user's system settings. Be aware that the locale used is not necessarily the same as the locale of the browser. Extension and XULRunner developers should know that just loading the format string from a .dtd or .propertie...
...ich could result in odd looking or even ambiguous or unreadable dates. Also note that the behavior of the used locale depends on the platform, and the user might customize the locale used, so using the system locale the choose the format string might in some cases not even be adequate. You might consider using some of the more general toLocale* methods of the Date object or doing your own custom localization of the date to be displayed using some of the get* methods of the Date object instead of using this method. Examples Using toLocaleFormat() var today = new Date(); var date = today.toLocaleFormat('%A, %B %e, %Y'); In this example, toLocaleFormat() returns a string such as "Wednesday, October 3, 2007". Note that the format string in this example is not properly localized, which will result in...
Makefile - variables
sts in rules.mk but not referenced by mozilla-central. Deprecated? FINAL_TARGET Directory to install distributed content. default=$(DIST)/bin XPI_NAME If set FINAL_TARGET=$(DIST)/xpi-stage/$(XPI_NAME) DIST_SUBDIR If set FINAL_TARGET will be $(DIST)/bin/$(DIST_SUBDIR) [ metro build ] l10n.mk and localization Variable Description EN_US_BINARY_URL Server URL from which wget will FTP binaries. L10NBASEDIR MOZ_CHROME_MULTILOCALE A list of locale names to process MOZ_CHROME_FILE_FORMAT both, file, jar, omni, symlink PACKAGER_NO_LIBS Hack to allow one makefile to includ...
...ill FTP binaries. L10NBASEDIR MOZ_CHROME_MULTILOCALE A list of locale names to process MOZ_CHROME_FILE_FORMAT both, file, jar, omni, symlink PACKAGER_NO_LIBS Hack to allow one makefile to include another without pulling in libs:: target definitions. STAGEDIST Local staging directory for localization and packaging. Todo: xpcom/xpinstall variables: https://developer.mozilla.org/en/Adding_XPCOM_components_to_Mozilla_build_system ...
SVN for Localizers
First things first, we need to give you a brief introduction to what SVN is and where you can find the necessary tools to get started. If you're already familiar with this information, skip ahead to Mozilla's SVN repositories. Brief intro to SVN SVN (abbreviation for Subversion) is a free and open source repository tool we use to manage the localized Mozilla web pages. ...
... ...
Building the WebLock UI
or.xul, which means that the overlay mechanism will merge the new UI here (i.e., the weblock statusbarpanel) and the UI already defined within that browser <statusbar/> at runtime. Other Resources This chapter describes the remaining files that must be added to and packaged up with the WebLock component to provide user interface for web locking. Other Front End Resources In some UI packages, localization resources are also defined. These include DTDs in which the language in which the UI is labelled can be extracted into external files, which are swapped with DTDs for other languages. For example, user interface packages often include an English DTD that defines labels and strings for button and menus and other elements in the interface. When the user selects a different language pack, all of the...
... external files, which are swapped with DTDs for other languages. For example, user interface packages often include an English DTD that defines labels and strings for button and menus and other elements in the interface. When the user selects a different language pack, all of the English that's been externalized in these files is dynamically replaced with the new choice. In addition to DTDs, the localization parts of a user interface may also include string bundles in which strings that are used in the interface JavaScript can be similarly replaced. There are also technologies, not discussed here, which may be used in separate, installable files. These include bindings in XML files, metadata in RDF files, whole collections of CSS files called skins, and others. weblock.css The following style rule...
Index
Mozilla › Tech › XPCOM › Index
artRequest will be called. 714 nsILocalFile Interfaces, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference Implemented by: @mozilla.org/file/local;1. To create an instance, use: 715 nsILocalFileMac File I/O, Interfaces, Interfaces:Scriptable, NeedsContent, XPCOM Interface Reference None. 716 nsILocale Interfaces, Interfaces:Scriptable, Localization, XPCOM, XPCOM API Reference, XPCOM Interface Reference Retrieves a string with the current locale name. 717 nsILocaleService Interfaces, Interfaces:Scriptable, XPCOM Interface Reference Implemented by: @mozilla.org/intl/nslocaleservice;1. To use this service, use: 718 nsILoginInfo Firefox 3, Interfaces, Interfaces:Scriptable, Login Manager, Thunderbird 3,...
...natively, a string bundle can be created within a javascript context with nsIStringBundleService. 925 nsIStringBundleOverride Interfaces, Interfaces:Scriptable, String bundles, XPCOM, XPCOM Interface Reference Implemented by: @mozilla.org/intl/stringbundle/text-override;1. To create an instance, use: 926 nsIStringBundleService Interfaces, Interfaces:Scriptable, Localization, NeedsContent, XPCOM API Reference, XPCOM Interface Reference Implemented by: @mozilla.org/intl/stringbundle;1. To access this service, use: 927 nsIStringEnumerator Called to retrieve the next string in the enumerator. The "next" element is the first string upon the first call. Must be preceded by a call to hasMoreElements() which returns PR_TRUE. This method is genera...
Mozilla
Creating a Firefox sidebar Web publishers can offer visitors a Firefox sidebar to encourage their engagement. There are two ways to create a sidebar for Firefox users: the Social API and an extension. You can choose either depending on your needs and resources. Creating a Language Pack To create a language pack, or a localization repack, you first need to go through the initial setup process. Creating a localized Windows installer of SeaMonkey Preamble: not all of the programs listed below are necessary. Some of them are simply the ones I use because I like them, while others are scripts that I've created to speed up the work. You can in every case choose the program you pref...
...discussion on extended C++ support see bug 505907. Other work made possible by js-ctypes is JNI, this is elaborated on in the JNI.jsm section and not the js-ctypes section due to the JSM abstracting away all of the js-ctypes. Unlike binary XPCOM components, it allows developers to ship a single binary for use with multiple versions of Firefox. Localization at Mozilla Localization (L10n) is the process of translating software user interfaces from one language to another and adapting it to suit a foreign culture. These resources are for anyone with an interest in the technical aspects involved in localization. Memory Sanitizer Memory Sanitizer (MSan) is a fast detector used f...
Index - Web APIs
Web › API › Index
190 AudioTrack.label API, Audio, Audio Track, AudioTrack, HTML DOM, Media, Property, Read-only, Reference, label, metadata, track The read-only AudioTrack property label returns a string specifying the audio track's human-readable label, if one is available; otherwise, it returns an empty string. 191 AudioTrack.language API, Audio, AudioTrack, HTML DOM, Language, Localization, Media, Property, Read-only, Reference, Translated, Translation, track The read-only AudioTrack property language returns a string identifying the language used in the audio track. 192 AudioTrack.sourceBuffer API, Audio, AudioTrack, HTML DOM, MSE, Media, Media Source Extensions, Property, Read-only, Reference, SourceBuffer, track The read-only AudioTrack property source...
...perty, Read-only, Reference, SourceBuffer, Video, VideoTrack, track The read-only VideoTrack property sourceBuffer returns the SourceBuffer that created the track, or null if the track was not created by a SourceBuffer or the SourceBuffer has been removed from the MediaSource.sourceBuffers attribute of its parent media source. 4530 Videotrack.language API, HTML DOM, Language, Localization, Media, Property, Read-only, Reference, Video, VideoTrack, track The read-only VideoTrack property language returns a string identifying the language used in the video track. 4531 VideoTrackList API, HTML DOM, Interface, Media, Reference, Track List, Tracks, Video, VideoTrackList, list The VideoTrackList interface is used to represent a list of the video tracks containe...
Index - Developer guides
Web › Guide › Index
he full web technology stack. 29 Index Guide, Index Found 31 pages: 30 Introduction to Web development Beginner, CSS, CodingScripting, Development, HTML, JavaScript, Web Whether you're just getting started with Web development, or are just expanding your horizons into new realms of Web awesomeness, the links here should help you get started. 31 Localizations and character encodings Character encodings, HTML, Localization, NeedsMarkupWork Browsers process text as Unicode internally. However, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. The HTML specification recommends the use of the UTF-8 encoding (which can represent all of Unicode) and regardless of...
... possible scenarios: 39 SVG-in-OpenType Draft, Fonts, Guide, NeedsContent The SVG-in-OpenType work is currently in the hands of the MPEG group. Once we're ready for wider adoption the information from wiki.mozilla.org will be moved here, updated and expanded. 40 The Unicode Bidirectional Text Algorithm Algorithm, BiDi, Guide, Internationalization, Introduction, Localization, Text, Unicode, direction, i18n, l10n, ltr, rtl The Unicode(R) Bidirectional Algorithm (also known as the BiDi Algorithm) is part of the Unicode text standard that describes how the user agent should order characters while rendering Unicode text. 41 The Web Open Font Format (WOFF) Fonts, NeedsMobileBrowserCompatibility, WOFF WOFF (the Web Open Font Format) is a web font...
Digital audio concepts - Web media technologies
ply the science of psychoacoustics. This is the science that studies how humans percieve sound, and what parts of the audio frequencies we hear are most important to how we respond to those sounds, given the context and content of the sound. Factors such as the ability to sense the change in frequency of a sound, the overall range of human hearing versus the frequencies of the audio signal, audio localization, and so forth all can be considered by a codec. By using a sound (no pun intended) understanding of psychoacoustics, it's possible to design a compression method that will minimize the compressed size of the audio while maximizing the percieved fidelity of the sound. An algorithm employing psychoacoustics may use any of the techniques mentioned here, and will almost certainly apply others as wel...
...\quad =\quad mid\quad -\quad side On its own, mid-side stereo coding is lossless, and is commonly used by both lossless and lossy audio codecs. Any loss of detail comes from other steps of the encoding process. Intensity stereo coding Intensity stereo coding reduces the encoded audio bit rate by taking advantage of the way humans determine the location of sounds in space; this is called sound localization. We hear in stereo because our ears detect a sound at different times depending on where the sound is coming from. This is because our ears are separated by several inches, thanks to being on opposite sides of our heads. A sound coming from our right will arrive at our right ear before it arrives at our left ear. Our brains determine where the sound is in the space around us by using that time d...
Tutorials - Archive of obsolete content
your add-on to load and use any XPCOM object. Creating event targets Enable the objects you define to emit their own events. Listen for load and unload Get notifications when your add-on is loaded or unloaded by Firefox, and pass arguments into your add-on from the command line. Using third-party modules (jpm) Install and use additional modules which don't ship with the SDK itself. Localization Writing localizable code. Mobile development Develop add-ons for Firefox Mobile on Android. Add-on Debugger Debug your add-on's JavaScript. Putting it together Annotator add-on A walkthrough of a relatively complex add-on. ...
Add-on SDK - Archive of obsolete content
s and tools for creating, running, testing, and packaging add-ons. Tutorials Getting started How to install the SDK and use the jpm tool to develop, test, and package add-ons. Interact with the browser Open web pages, listen for pages loading and list open pages. Development techniques Learn about common development techniques, such as unit testing, logging, creating reusable modules, localization, and mobile development. Create user interface components Create user interface components such as toolbar buttons, context menus, menu items, and dialogs. Modify web pages Modify pages matching a URL pattern or dynamically modify a particular tab. Putting it together Walkthrough of the Annotator example add-on. Guides Contributor's guide Learn how to start contributing to t...
Install Manifests - Archive of obsolete content
:optionsType>2</em:optionsType> Options can be opened in a new tab since Firefox 7.0a1. To do so, set optionsType to 3 and set optionsURL to a the path of a page to open. <em:optionsType>3</em:optionsType> <em:optionsURL>chrome://myaddon/content/options.html</em:optionsURL> This section here contains an example of localized HTML page as an option panel in a new tab: Bootstrapped Extensions :: Localization (L10n) (example linked to is: GitHub :: l10n-html-options). optionsURL The chrome:// URL of the extension's options dialog box. This is only useful to extensions. If this property is specified, when the extension is selected in the Extensions list, the Options button is enabled and will show this. <em:optionsURL>chrome://myext/content/options.xul</em:optionsURL> Gecko 7 note In Firefox 7 yo...
Introduction - Archive of obsolete content
are exclusively built with XUL. It usually means that the projects were built using Mozilla technologies. Even this project, called XUL School, covers several other technologies such as JavaScript, CSS, XBL and XPCOM. XULRunner XULRunner includes the Gecko rendering engine, the Necko networking library, and several other components that provide OS-independent file management, accessibility, and localization, among others. It is this very powerful platform that has allowed such a fast growth of the development community surrounding Mozilla and Firefox. XULRunner is available in binary form at the XULRunner page, and it is the base for several projects, such as Songbird, Miro and Eudora. There's a very comprehensive list of XULRunner applications in the XULRunner Hall of Fame. Gecko The Gecko engin...
The Box Model - Archive of obsolete content
abel;</description> Even then, the text will extend as much as it can in a single line, so you need to add some CSS limits in order to make it wrap inside a XUL dialog or window. You can use the CSS property width to restrict the width of the description so that it wraps as you need it to. Never cut text lines into separate locale strings in order to bypass wrapping difficulties. This makes localization much harder, or even impossible in some cases. There are other more complicated text wrapping cases where a description won't be good enough. For instance, templates don't allow you to set the internal text in a description element in a way that it wraps properly. One way to work around this is using a textbox element instead. This blog post is a good guide on the subject, and you should keep ...
Add-ons - Archive of obsolete content
v), and to Japanese things (like some specific locales, which have been translated to French since non-latin characters are not well supported). Hotfix Extension This document has been moved to the Add-ons wiki. How to convert an overlay extension to restartless First off, what kind of add-on are we talking about here? Well, XUL overlays and windows, JSM files, chrome & resource mappings with localization, default preferences, but no XPCOM components of your own. Some of that will have to be replaced and the rest will need to be loaded differently. Inline options Firefox 7 supports a new syntax for defining extensions' preferences for both bootstrapped and traditional extensions. The user interface for the preferences defined with this new syntax appears in the extension's detail view in the Add...
Index of archived content - Archive of obsolete content
Chrome Authority Creating Event Targets Creating Reusable Modules Developing for Firefox Mobile Display a Popup Getting Started (jpm) Getting started (cfx) List Open Tabs Listen for Page Load Listening for Load and Unload Localization Logging Modifying Web Pages Based on URL Modifying the Page Hosted by a Tab Open a Web Page Troubleshooting Unit Testing Using XPCOM without chrome Using third-party modules (jpm) Bootstrapped extensions C...
Finding the file to modify - Archive of obsolete content
s: the structure, the style, and the behavior. The structure layer identifies the widgets (menus, buttons, etc.) and their position in the UI relative to each other, the style layer defines how the widgets look (size, color, style, etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals. mention the localization layer (Note: These layers are not completely mutually exclusive. In particular, positioning information can be specified in both the structure layer and the style layer, and some behavior can be partly defined in the style layer.) We're going to add code to all three UI layers, starting with the structure layer. The structure layer consists of XUL files. XUL, which is short for XML-based User I...
Repackaging Firefox - Archive of obsolete content
e the DEX to support it. That means that you will need to change the version of the DEX, and that will cause any users with the earlier version to get unnecessarily upgraded. On the other hand, if you create a DEX which supports all locales, you can only ship on a few, and later expand your set without any upgrade hassles. Of course, this strategy only works when your strings either do not need localization, or are programmatically localizable (for example, simply adding the locale to a URL, like http://<locale>.example.com/). But it's something to keep in mind when planning your locale support. Preferences Preferences are one of the two main things you will want to set in your extension (the other is bookmarks). There are two kinds of preferences in Firefox, both set in the partner.js file: Lo...
Mozilla Application Framework - Archive of obsolete content
develop cross-platform applications Want to build applications? Use the Mozilla framework and make your life easier. We provide a comprehensive framework that does much of the work for you, tools to help you develop your apps, and a community of people to help. Framework XUL A comprehensive, cross-platform UI toolkit with an easy-to-learn XML language for defining UI structure, a schema for localization, and support for both native and cross-platform (using CSS) look and feel to make writing UIs quick and painless. Gecko A performant web content rendering/editing engine with world-leading support for standards that you can drop into your application with a single line of XUL. Necko A wicked-fast, extensible networking library with built-in support for many common protocols and a well-d...
The new nsString class implementation (1999) - Archive of obsolete content
n library. nsString Use these locally in objects who span of control is known to live within your own process. These should typically not be exposed to objects in other modules. nsAutoString Use these locally in cases where you don't want to incur heap allocation unless absolutely necessary. nsCString Same as nsString, but should be used with caution because of localization concerns. nsIString Use to pass strings between modules that may not use nsStrImpl implementation. This is the most generic approach, but offers reference counted strings. There are implications regarding this implementation, notably dealing with API changes throughout Gecko. Notably, nsStrings in API's will be discouraged in public API's. These API's will need to be rewrit...
Venkman Internals - Archive of obsolete content
Manager. There is one ScriptManager per url (web page). This method is set into jsdIScriptHook.onScriptCreated venkman-views.js Views are the panels shown within the venkman window. For example, the "Open Windows" view shows the browser's windows. venkman-records.js A "record" seems to be data underlying a view. For example, FrameRecord represents a JavaScript stack frame. venkman-msg.js Localization code, reads venkman.properties from a subdirectory of "locale" and injects variables. Things like msg.alert define variables MSG_ALERT. venkman-utils.js Defines the dd debug dump and friends WindowRecord Representation of the open windows. FileContainerRecord - List of script tags found in the parent record's window.document property. To obtain the antecedent files: doc.getElementsByTagN...
Learn XPI Installer Scripting by Example - Archive of obsolete content
rary" (see getFolder in the XPInstall API Reference for a list of keywords). Registering the Software Registering software is sometimes a requirement of both the operating system and of the Netscape 6 platform. When you install new chrome, for example, like the browser.xpi install does, you need to alert the chrome registry to these changes, so that skins, user preferences, packaging lists, and localization bundles will all track the new software. For registering software with the win32 operating system, the XPInstall API provides two special Install objects, WinProfile and WinReg. These two objects provide programmatic access to the Windows user profile and the Windows registry, respectively. The browser.xpi install script does not demonstrate the use of these objects, but see the XPInstall API Re...
International characters in XUL JavaScript - Archive of obsolete content
the same code to work in both Gecko 1.8 and earlier versions, you must limit yourself to ASCII. However, you can use unicode escapes - the earlier example rewritten using them would be: var text = "Ein sch\u00F6nes Beispiel eines mehrsprachigen Textes: \u65E5\u672C\u8A9E"; An alternative might be to use property files via nsIStringBundle or the XUL <stringbundle> element; this would allow for localization of the XUL. This can not be done in XUL files loaded from the web, only in privileged code, e.g. in extensions. ...
Introduction to XUL - Archive of obsolete content
ul.css" type="text/css"?> <!DOCTYPE window> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> ... </window> We would like to head more toward the "package" implementation in the future. Internationalization For practical reasons, the locale-specific attributes of a UI description would be most happily developed (and possibly distributed) in separate files, where localization can be performed by altering only a subset of the UI description devoted expressly to localization issues. That is, a separate file of localized strings. Internationalization is discussed more completely in the XUL Coding Style Guidelines document. In brief, Mozilla has settled on XML entities as the mechanism. Entities are a feature of the language and therefore outside the scope of this paper.
getFormattedString - Archive of obsolete content
...
The Joy of XUL - Archive of obsolete content
logic or presentation. This degree of separation results in applications that are easier to maintain by programmers and readily customized by designers and language translators. The work flow of these interdependent activities is more easily coordinated than with HTML-based web applications, with less impact on the overall stability and quality of the system. Easy customization, localization, or branding Another highly practical benefit of the separation that XUL provides among application logic, presentation, and language text is the ease of customizing for different customers or groups of users. A developer can maintain one primary code base for their application and customize the logo and branding for each of their customers by supplying different skins. An application that...
Complete - Archive of obsolete content
t might depend on the locale are the text strings displayed in the user interface. These are in the files button.xul and button.js. XUL and JavaScript each have mechanisms for loading text strings from the correct locale directory. This extension only uses the XUL method. Its JavaScript code gets the text strings it needs from the XUL. For more information about working with locales, see the main Localization page here. How a text sting gets localized When you press button 1 you see an message in English or French, depending on your application's locale. This is how it happens: For example, if your locale is fr-FR, it loads: locale/fr-FR/allcustom/allcustom.dtd from inside the jar file. When you restart after installing the extension, the locales en-US and fr-FR are both registered for the componen...
Introduction - Archive of obsolete content
nderstanding of XML and CSS. Here are some guidelines to keep in mind: XUL elements and attributes should all be entered in lowercase as XML is case-sensitive (unlike HTML). Attribute values in XUL must be placed inside quotes, even if they are numbers. XUL files are usually split into four files, one each for the layout and elements, for style declarations, for entity declarations (used for localization) and for scripts. In addition, you may have extra files for images or for platform specific data. XUL is supported in Mozilla and browsers that are also based upon on the Gecko engine, such as Netscape 6 or later and Mozilla Firefox. Due to various changes in XUL syntax over time, you will want to get the latest version for the examples to work properly. XUL is fairly similar in Firefox and to ...
Manifest Files - Archive of obsolete content
e name. The locale is 'en-US'. The chrome URLs that these would map to would be chrome://browser/skin and chrome://browser/locale. If you were creating your own theme or locale for the browser, all you need to do is create a manifest file with one of these two lines in it, modified to suit your theme or locale. For more information about Themes, see Themes. For more information about Locales, see Localization. Our example find files dialog Let's create a manifest file for the find files dialog we'll be creating. You can combine all of the three types into a single file if you wish. This may be done when creating an extension such that all of the parts are in one file. We will do this for the find files dialog. Create a file findfile.manifest in the chrome directory. Add the following to the file: ...
Property Files - Archive of obsolete content
ter code. ...
Skinning XUL Files by Hand - Archive of obsolete content
it by specifying classes for all of the interested elements. The skin will reside in a single CSS file, appropriately named drxul.css. As you will see, CSS provides a lot of flexibility for defining styles to individual elements, to classes of elements, to pseudo-classes, and to anonymous classes. By the way, in contrast to the term skin, "chrome" refers to the skin and the content and whatever localization and platform-specific files are necessary for a particular part of the application or window. The skin is just the style or appearance of an interface, where the chrome is the style, content, and structure. The chrome is everything in the front end of an application. Much of what makes XUL look (and act!) the way it does comes from the CSS for each XUL element. CSS2, for example, gives you contr...
XUL Tutorial - Archive of obsolete content
XPCOM Interfaces XPCOM Examples Trees Trees More Tree Features Tree Selection Custom Tree Views Tree View Details Tree Box Objects RDF and Templates Introduction to RDF Templates Trees and Templates RDF Datasources Advanced Rules Persistent Data Skins and Locales Adding Style Sheets Styling a Tree Modifying the Default Skin Creating a Skin Skinning XUL files by hand Localization Property Files Bindings Introduction to XBL Anonymous Content XBL Attribute Inheritance Adding Properties Adding Methods Adding Event Handlers XBL Inheritance Creating reusable content using CSS and XBL XBL Example Specialized Window Types Features of a Window Creating Dialogs Open and Save Dialogs Creating a Wizard More Wizards Overlays Cross Package Overlays Installat...
Using Visual Studio as your XUL IDE - Archive of obsolete content
d at: HKEY_CURRENT_USER\Software\Whole Tomato\Visual Assist X\ Find the folder that represents your Visual Studio version ((VANet8, VANet9, etc.) and add your extensions to the corresponding registry entries ExtJS and ExtXml. Make sure that Visual Studio is not running, when you do this. 5. Problems that need to be solved There are still some problems for which I did not find a solution yet. 5.1 Localization using DTD You will get validation errors in Visual Studio, if you are localizing your XUL files. That has to do with the way Mozilla implemented localization: < !DOCTYPE window SYSTEM "chrome://loomo/locale/main.dtd"> Visual Studio doesn't recognize the chrome URI prefix, what will give you an error at the previous line ("The URI prefix is not recognized"). As VS doesn't know how the chrome prot...
stringbundle - Archive of obsolete content
or the given key name in the string bundle and returns a formatted copy where each occurrence of %S (uppercase) is replaced by each successive element in the supplied array. Alternatively, numbered indices of the format %n$S (e.g. %1$S, %2$S, etc.) can be used to specify the position of the corresponding parameter explicitly. If you need to handle substitutions involving plurals, take a look at Localization and Plurals. getString( key ) Return type: string Returns the string with the given key name from the string bundle. Inherited Methods addEventListener(), appendChild(), blur, click, cloneNode(), compareDocumentPosition, dispatchEvent(), doCommand, focus, getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getBoundingClientRect(), getClientRects(), getElementsByAt...
Windows and menus in XULRunner - Archive of obsolete content
"&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> ... </window> Notice the references to CSS and DTD files. The CSS is used to apply formatting to elements, just as it would in HTML. The DTD is used to create entity references so strings for titles and labels are not stored directly in the XUL file; this makes updating the text -- and localization of the application -- much easier. The window title is done this way in the above example. Also notice the <script> element which is used to include the window's JavaScript into the XUL file. Keeping CSS, DTD and Javascript out of the XUL file is considered a best practice. When you launch your XUL application, you'll notice that XULRunner gives your windows a default icon (top left corner on Wi...
2006-09-29 - Archive of obsolete content
Summary: mozilla.dev.apps.calendar - September 22 - September 29, 2006 Announcements Lightning and Sunbird 0.3 RC1 TEST DAY! Clint announced the Lightning and Sunbird 0.3 RC1 TEST DAY Oct.3 to Oct. 4. Updated L10n status for Sunbird 0.3 release According to Simon Paquet, we now have a full l10n comparison on the trunk between en-US and all locales with a calendar localization. Details are available for Calendar Only and for Calendar and Core. Discussions No Discussions available this week. Meetings Sept. 27 status meeting cancelled Most of the Mozilla Calendar participants were unavailable during Sept. 27, the meeting was cancelled and rescheduled for a later date. Sept 20 Brief Status Meeting The meeting consisted entirely of the status and details of Sunbird 0.3. The deta...
2006-10-06 - Archive of obsolete content
suggests a top down architectural description of TB's data structures along with documentation about extracting them. Brian King also mentions that documentation on handling message headers on the UI side would be helpful. Cedric Corazza recommends that the proposed documention should be made available on the l10n cvs once it reaches a decent stage so that localizers can get a head-start on the localization before the final version is made available. Updated : Need UI to Rearrange Tags Peter Lairo suggested some UI should be available for rearranging tags. Related: bug 342065 Meetings None for this week. ...
2006-10-13 - Archive of obsolete content
L10n freeze on SeaMonkey 1.1 code is imminent in the next days, as well as beta release. ...
2006-11-17 - Archive of obsolete content
to ftp.mozilla.org SeaMonkey 1.0.6 in Czech (cs-CZ) SeaMonkey 1.0.6 in Czech (cs-CZ) is uploaded to ftp.mozilla.org SeaMonkey 1.0.6 he-IL SeaMonkey 1.0.6 he-IL is released. SeaMonkey 1.0.6 in French SeaMonkey 1.0.6 in French (fr-FR) is released. Discussions How to translate mozilla to a language called Quiche How to translate mozilla to a language called Quiche. How to start a localization How to start a localization PO format usage Discussion on how to make l10n easier due to expansion to 100 locales. Quick builds for localisers (full or partial) Discussion on moz-l10n-builder, which automates many of the functions required in localization process. Link is located here. Going to FOSDEM 2007 FOSDEM 2007 (Free and Open source Software Developers' European Meeting), Februar...
2006-11-24 - Archive of obsolete content
Beta 2 Freeze around January 4th. Final Release date in in early 2007. approval queue for fx 2.0.0.1 closing Closing the approval queue for Firefox 2.0.0.1 Discussions Quality of localized builds and process requirements Quality of localized builds and process requirements The Translate Toolkit MDNto PO: its current state and how to use it Discussion on clarifications on Translate Toolkit to avoid confusion. ...
2006-11-3 - Archive of obsolete content
check-ins on sun-calendar-event-dialog.* files From 50 to 100 locales How to get from the 50 locales and releasing 40 to a hundred. Revisiting MozillaTranslator bugs in Bugzilla Revisiting MozillaTranslator bugs in Bugzilla dictionary packages There are some dictionaries at http://dictionaries.mozdev.org/installation.html which are not at https://addons.mozilla.org/en/dictionaries. Localization of AMO and some other pages of Mozilla.com Suggestion on localizing popular add-ons as well as web pages at Mozilla.com. Meetings None for this week. Authors Paul Yanchun Gu (gpaul) Aditya Nanda Kuswanto(vipers101) ...
2006-12-01 - Archive of obsolete content
.dic to .xpi MozillaTranslator and Sourceforge.net about the best way to organize things Creating a <locale>.jar file from the CVS structure Discussion on how to package a <locale>.jar from the CVS structure without having to download the entire mozilla source. At the moment there is no simple way of doing this. From 50 to 100 locales Discussion continues on finding a better tool for localization. Feedback on L10n:Ownership draft Feedback on the L10n:Ownership draft at Mozilla wiki site detailed here continues. There's a question about the roles of Peer in the team Meetings None for this week. Authors Paul Yanchun Gu (gpaul) Aditya Nanda Kuswanto(vipers101) ...
2006-11-03 - Archive of obsolete content
Test Day Results The Calendar QA Team had a successful test day on Tuesday Discussions storage format for events storage format of timestamps in lightning. aborting a new event/edit event dialog Discussions about behaves of new event/edit event. wcap calendar subscription Discussions about calendar subscriptions. Last check-ins on sun-calendar-event-dialog.* files Discussions about some localization issues with sun-calendar-event-dialog. Meetings No Meetings were scheduled this week. Authors Mark Paruzel Yi (Eric) Shen [Back to Weekly Summaries ] ...
Building a Theme - Archive of obsolete content
ls Firefox to treat the URI as a web page. Secondly, a package name (in the example above, browser) which identifies the bundle of user interface components. Thirdly, the type of data being requested. There are three types: content (XUL, JavaScript, XBL bindings, etc. that form the structure and behavior of an application UI), locale (DTD, .properties files etc that contain strings for the UI's localization), and skin (CSS and images that form the theme of the UI) Finally, the path of a file to load. So, chrome://foo/skin/bar.png loads the file bar.png from the foo theme's skin section. When you load content using a Chrome URI, Firefox uses the Chrome Registry to translate these URIs into the actual source files on disk (or in JAR packages). Create a Chrome Manifest The Chrome Manifest is th...
Archive of obsolete content
This list is likely to be incomplete since we think there are many dark matter projects that we don't know about. If you have information about a new project or extra information about an existing project, please feel free to update this page. Localizing an extension This article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension. Performing a few simple steps makes your extension much easier to localize into various languages without having to edit the XUL or JavaScript files themselves. Makefile - .mk files Misc top level These pages were moved from the top level of MDN in a spate of furious reorganization. MMgc ...
I18N - MDN Web Docs Glossary: Definitions of Web-related terms
i18n (from "internationalization", a 20-letter word) is the best practice that enables products or services to be readily adapted to any target culture. Internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language. (The W3C definition) Among other things, i18n requires support for multiple character sets (usually via Unicode) units of measure (currency, ?C/?F, km/miles, etc.) time and date formats keyboard layouts text directions Learn more General knowledge i18n on Wikipedia Technical reference i18n on W3C i18n on gala-global.org Learn about it i18n material on i18nguy.com ...
LTR (Left To Right) - MDN Web Docs Glossary: Definitions of Web-related terms
LTR (Left To Right) is a locale property indicating that text is written from left to right. For example, the en-US locale (for US English) specifies left-to-right. Most Western languages, as well as many others around the world, are written LTR. The opposite of LTR, RTL (Right To Left) is used in other common languages, including Arabic (ar) and Hebrew (he). Technical reference Localization and internationalization ...
MDN Web Docs Glossary: Definitions of Web-related terms
IPv6 IRC ISO ISP ITU J Jank Java JavaScript JPEG jQuery JSON K Key Keyword L Latency Layout viewport Lazy load LGPL Ligature Local scope Local variable Locale Localization Long task Loop Lossless compression lossy compression LTR (Left To Right) M Main Axis Main thread markup MathML Media Media (Audio-visual presentation) Media (CSS) Metadata Method Microsoft Edge Microsoft Internet Explorer Middlew...
create fancy boxes - Learn web development
e bottom of the cloud remains flat, we must make the bottom left corner of the right ear square. */ border-bottom-left-radius: 0; } Blockquote A more practical example of using pseudo-elements is to build a nice formatting for HTML <blockquote> elements. So let's see an example with a slightly different HTML snippet (which provide us an opportunity to see how to also handle design localization): <blockquote>People who think they know everything are a great annoyance to those of us who do. <i>Isaac Asimov</i></blockquote> <blockquote lang="fr">L'intelligence, c'est comme les parachutes, quand on n'en a pas, on s'ecrase. <i>Pierre Desproges</i></blockquote> So here comes our style: blockquote { min-height: 5em; padding : 1em 4em; font : 1em/150% sans-serif; position : ...
Configuring Build Options
use the --enable-extensions option; the build system will automatically select the proper default set of extensions. Tests ac_add_options --disable-tests By default, many auxiliary test applications are built, which can help debug and patch the mozilla source. Disabling these tests can speed build time and reduce disk space considerably. Developers should generally not use this option. Localization mk_add_options MOZ_CO_LOCALES=ISOcode TBD. ac_add_options --enable-ui-locale=ISOcode TBD. ac_add_options --with-l10n-base=/path/to/base/dir TBD. Other Options mk_add_options AUTOCLOBBER=1 If a clobber would be required before a build, this will cause mach to clobber and continue with the build instead of asking the user to manually clobber and exiting. ac_add_options --disable-cry...
The Firefox codebase: CSS Guidelines
think of how some CSS could be written cleanly without the CSS variable(s) and then think of how the CSS variable could improve that CSS. Using variables Use the variable according to its naming Do this: xul|tab:hover { background-color: var(--in-content-box-background-hover); } Not this: #certificateErrorDebugInformation { background-color: var(--in-content-box-background-hover); } Localization Text Direction For margins, padding and borders, use inline-start/inline-end rather than left/right. Example: Use margin-inline-start: 3px; instead of margin-left: 3px. For RTL-aware positioning (left/right), use inset-inline-start/inset-inline-end. For RTL-aware float layouts, float: inline-start|inline-end can be used instead of float: left|right. The RTL-aware equivalents of border-{t...
Commenting IDL for better documentation
he saying number to return. * * @returns An AString containing the requested funny quote. If the specified * quote number is invalid, an exception is thrown. * * @throws NS_ERROR_FAILURE Unable to locate the requested quote. */ AString getFunnySaying(in integer number); /** * Says something appreciative of the tastiness of the cookie in the specified * language. * * @param language The localization identification indicating the language in * which the cookie monster is to express his love of cookies. */ [noscript] void sayYummy(in AString language); }; In conclusion With just a little extra help from you, the intrepid developer, the documentation team can crank out full, formatted documentation for your interface much more quickly and accurately. ...
Localizing XLIFF files for iOS
Most translation tools support the XLIFF standard, making localizing the XLIFF files for Firefox for iOS easy to do using translation tools. Editing the raw XLIFF file is also rather easy, especially if you're already familiar with XML. This tutorial will walk you through the steps you need to take to translation strings within an XLIFF file. ...
Setting up the infrastructure
Requirements: PHP with gettext support, Apache and some Unix experience. Create a new branch for l10n (optional if starting a new project). Create a locale directory in your website (usually something like DOCROOT/locale). ...
Mozilla projects on GitHub
Mozilla support web site, SUMO. kuma The Django project that powers this site (MDN). mdn Code samples for the MDN Web site. mozbrick The Mozilla Brick project. mozilla-B2G The Firefox OS project. mozilla-appmaker The Appmaker project -- a Web tool to let non-programmers create apps. mozilla-l10n Scripts and tools used by the localization drivers. mozilla-metrics Tools used to collect metrics about Mozilla code. mozilla-services Mozilla cloud services projects. opennews The Knight-Mozilla Open News project, helping the journalism/technology community do great work through shared knowledge and code. PluotSorbet A J2ME-compatible virtual machine written in JavaScript. rust-lan...
Productization guide
erwise wouldn't be as discoverable. For example, putting one sample news feed on the Bookmarks Toolbar in new profiles in Firefox helps in learning about the Live Bookmarks. Including a couple of search engines instead of one in the Search Toolbar can help users understand that they can add as many plug-ins as they wish. This guide will walk you through the steps to successfully productizing your localization. The first page will cover performing research and preparing to submit productization recommendations. The following (and last) page will cover the technical steps to creating and submitting productization patches. Next >> ...
Mozilla Projects
ta used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among all your devices. JSHydra JSHydra is a static analysis tool that is capable of performing analysis of general JavaScript code. L20n L20n lets localizers reach higher levels of free linguistic expression by sharpening the divide between localization and application logic. Leak Monitor Leak Monitor is a Firefox extension by L. David Baron that helps extension and chrome developers to find memory leaks. It will pop-up an alert when a window is closed and JavaScript still links to that window (for example, an observer that is not cleared when the window closes). MailNews ...
Life After XUL: Building Firefox Interfaces with HTML
n this is being tracked in bug 1453783 and bug 1446829. This page gathers technical solutions to common problems encountered by teams shipping HTML-based interfaces inside Firefox. Background: Discussion of how to replace XUL is ongoing within the Platform team. ...
nsILocaleService
getLocaleFromAcceptLanguage(in string acceptLanguage); nsILocale getSystemLocale(); nsILocale newLocale(in AString aLocale); nsILocale newLocaleObject(in nsILocaleDefinition localeDefinition); Obsolete since Gecko 1.9 Methods getApplicationLocale() Gets the user preference for locale from the operating system. Note: This has nothing to do with the locale used for localization of the application (UI text strings and so on.). This method returns something similar to getSystemLocale. nsILocale getApplicationLocale(); Parameters None. Return value The user's OS setting for preferred locale. getLocaleComponentForUserAgent() Gets the user preference for locale from the operating system. Note: This has nothing to do with any HTTP User-Agent. This method returns the same as ...
nsIStringBundleService
atusArg The status message argument(s). ...
Building a Thunderbird extension 2: extension file layout
You can find information about the locale/ and defaults/ folders in the more general "Building an Extension" documentation. To star...
Using js-ctypes
el = 2; var kCFUserNotificationPlainAlertLevel = 3; // DECLARE FUNCTIONS /* https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFUserNotificationRef/index.html#//apple_ref/c/func/CFUserNotificationDisplayNotice * SInt32 CFUserNotificationDisplayNotice ( * CFTimeInterval timeout, * CFOptionFlags flags, * CFURLRef iconURL, * CFURLRef soundURL, * CFURLRef localizationURL, * CFStringRef alertHeader, * CFStringRef alertMessage, * CFStringRef defaultButtonTitle * ); */ var CFUserNotificationDisplayNotice = libcf.declare("CFUserNotificationDisplayNotice", ctypes.default_abi, SInt32, // return CFTimeInterval, // timeout CFOptionFlags, // flags CFURLRef, // iconURL CFURLRef, // soundURL CFURLRef, // localizationURL CFStringRef, // alert...
NavigatorID.userAgent - Web APIs
other related methods on the Navigator object. The user agent string is built on a formal structure which can be decomposed into several pieces of info. Each of these pieces of info comes from other navigator properties which are also settable by the user. Gecko-based browsers comply with the following general structure: userAgent = appCodeName/appVersion number (Platform; Security; OS-or-CPU; Localization; rv: revision-version-number) product/productSub Application-Name Application-Name-version Example alert(window.navigator.userAgent) // alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1" Specifications Specification Status Comment HTML Living StandardThe definition of 'NavigatorID.userAgent' in that specification. Living ...
PaymentAddress - Web APIs
Properties for which values were not specified contain empty strings. Obsolete properties The following properties are obsolete and should no longer be used, but may still be present in some browser versions. PaymentAddress.languageCode Read only A DOMString indicating the language code of the address. This identifies the language in which the address is given, and is intended to aid in localization of the display of the address. Methods PaymentAddress.toJSON() A standard serializer that returns a JSON representation of the PaymentAddress object's properties. Examples In the following example, the PaymentRequest() constructor is used to create a new payment request, which takes three objects as parameters -- one containing details of the payment methods that can be used for the paym...
Web Video Text Tracks Format (WebVTT) - Web APIs
d to the 5th second, inclusive. Following the similar steps, a complete WebVTT file for specific video or audio file can be made. CSS pseudo-classes CSS pseudo classes allow us to classify the type of object which we want to differentiate from other types of objects. It works in similar manner in WebVTT files as it works in HTML file. ...
Using the slider role - Accessibility
n must programmatically adjust the slider's aria-valuenow (and possible aria-valuetext) attribute to reflect the current value. See the Examples section below for more information. Keyboard And Focus The slider should be keyboard focusable and operable. When the user tabs focus to the slider, it should land on the thumb: the control a mouse user would drag. Arrow keys should operate as follows (localization for right-to-left languages should reverse the direction of the arrows): Key(s) Action Right and Up arrows Increase the selected value Left and Down arrows Decrease the selected value Page Up and Page Down Optionally increase and decrease the value by a set amount (e.g. by 10 on a range from 0 to 100) Possible effects on user agents and ...
Accessibility and Spacial Patterns - Accessibility
Symbols which have the same luminance as their background are perceptually less securely located in space and time than are symbols with higher luminance contrast. They tend to "float" visually or be "captured" by adjacent symbols with high luminance-contrast. The phenomenon seems to be especially problematic for symbol/background combinations that differ only in the blue channel." Distance between stripes Photosensitive seizures may be caused by static images as well as animation. ...
unicode-range - CSS: Cascading Style Sheets
of Unicode code points containing wildcard characters, that is using the '?' character, so for example U+4?? means include all characters in the range U+400 to U+4FF. Description The purpose of this descriptor is to allow the font resources to be segmented so that a browser only needs to download the font resource needed for the text content of a particular page. For example, a site with many localizations could provide separate font resources for English, Greek and Japanese. For users viewing the English version of a page, the font resources for Greek and Japanese fonts wouldn't need to be downloaded, saving bandwidth. Formal definition Related at-rule@font-faceInitial valueU+0-10FFFFComputed valueas specified Formal syntax <unicode-range># Examples Using a different font for a single chara...
The Unicode Bidirectional Text Algorithm - Developer guides
The Unicode(R) Bidirectional Algorithm (also known as the BiDi Algorithm) is part of the Unicode text standard that describes how the user agent should order characters while rendering Unicode text. Understanding this algorithm in at least basic terms is helpful when you're striving to produce localization-ready web content or apps. In this guide, we'll take a look at the BiDi Algorithm and learn in general what it does and how it applies to your content, so that you'll be better prepared when using the features of HTML and CSS to which the algorithm applies while determining the order and directionality of text during rendering. Fundamentals (base direction, character types, etc) The algorithm Character level directionality Directional runs (what they are, how base direction applies...
Developer guides
interface without reloading the entire browser page. This makes the application faster and more responsive to user actions. Graphics on the web Modern web sites and applications often need to present graphics of varying sophistication. Guide to web APIs A list of all web APIs and what they do. JavaScript JavaScript is the powerful scripting language used to create applications for the Web. Localizations and character encodings Browsers process text as Unicode internally. However, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. The HTML specification recommends the use of the UTF-8 encoding (which can represent all of Unicode), and regardless of the encoding used requires Web content to declare that encoding.
<input type="month"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › month
elect> </span> </div> </div> </form> The <div> with the ID nativeDatePicker uses the month input type to request the month and year, while the <div> with the ID fallbackDatePicker instead uses a pair of <select> elements. The first requests the month, and the second the year. The <select> for choosing the month is hardcoded with the names of the months, as they don't change (leaving localization out of things). The list of available year values is dynamically generated depending on the current year (see the code comments below for detailed explanations of how these functions work). div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '?'; pad...
<input type="range"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › range
vertical; } orient attribute In Firefox only, there is a non-standard orient property. HTML Use similar HTML as in the previous examples, we add the attribute with a value of vertical: <input type="range" min="0" max="11" value="7" step="1" orient="vertical"> writing-mode: bt-lr; The writing-mode property should generally not be used to alter text direction for internationalization or localization purposes, but can be used for special effects. HTML We use the same HTML as in the previous examples: <input type="range" min="0" max="11" value="7" step="1"> CSS We target just the inputs with a type of range, changing the writing mode from the default to bt-lr, or bottom-to-top and left-to-right: input[type="range"] { writing-mode: bt-lr; } Putting it all together As each of the a...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
ient side and server side. Constraint validation doesn't remove the need for validation on the server side. Invalid values can still be sent by older browsers or by bad actors. Note: Firefox supported a proprietary error attribute -- x-moz-errormessage -- for many versions, which allowed you set custom error messages in a similar way. This has been removed as of version 66 (see bug 1513890). Localization The allowed inputs for certain <input> types depend on the locale. In some locales, 1,000.00 is a valid number, while in other locales the valid way to enter this number is 1.000,00. Firefox uses the following heuristics to determine the locale to validate the user's input (at least for type="number"): Try the language specified by a lang/xml:lang attribute on the element or any of its paren...
Microdata - HTML: Hypertext Markup Language
Offer Review, AggregateRating Action Thing Intangible Major search engine operators like Google, Microsoft, and Yahoo! rely on the schema.org vocabulary to improve search results. For some purposes, an ad-hoc vocabulary is adequate. For others, a vocabulary will need to be designed. Where possible, authors are encouraged to re-use existing vocabularies, as this makes content re-use easier. Localization In some cases, search engines covering specific regions may provide locally-specific extensions of microdata. For example, Yandex, a major search engine in Russia, supports microformats such as hCard (company contact information), hRecipe (food recipe), hReview (market reviews) and hProduct (product data) and provides its own format for the definition of the terms and encyclopedic articles. This...
Destructuring assignment - JavaScript
nt form, you can simply call drawChart() without supplying any parameters. The current design is useful if you want to be able to call the function without supplying any parameters, the other can be useful when you want to ensure an object is passed to the function. ...
lang - XPath
Web › XPath › Functions › lang
Returns true if the context node matches the given languages. Otherwise, false. Notes A node's language is determined by its xml:lang attribute. ...