Search completed in 1.29 seconds.
Intl.Locale - JavaScript
the intl.
locale object is a standard built-in property of the intl object that represents a unicode
locale identifier.
... description the intl.
locale object was created to allow for easier manipulation of unicode
locales.
... unicode represents
locales with a string, called a
locale identifier.
...And 22 more matches
nsILocaleService
intl/
locale/idl/nsi
localeservice.idlscriptable the
locale service interface.
... 1.0 66 introduced gecko 1.6 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/intl/ns
localeservice;1.
... to use this service, use: var
localeservice = components.classes["@mozilla.org/intl/ns
localeservice;1"] .getservice(components.interfaces.nsi
localeservice); method overview nsi
locale getapplication
locale(); astring get
localecomponentforuseragent(); nsi
locale get
localefromacceptlanguage(in string acceptlanguage); nsi
locale getsystem
locale(); nsi
locale new
locale(in astring a
locale); nsi
locale new
localeobject(in nsi
localedefinition
localedefinition); obsolete since gecko 1.9 methods getapplication
locale() gets the user preference for
locale from the operating system.
...And 20 more matches
How to enable locale switching in a XULRunner application - Archive of obsolete content
this article is for developers who have localised their xul application using dtd entity files and want to provide their users with a mechanism to switch the
locale in the application itself.
... normally the application
locale is inherited from the os environment of the host system, however there are situations when you might want to give users the option to override the default setting and choose a different
locale.
...modify the application preferences first, you need to tell xulrunner that your application wishes to ignore the default os
locale and that it will do its own choosing instead.
...And 18 more matches
Array.prototype.toLocaleString() - JavaScript
the to
localestring() method returns a string representing the elements of the array.
... the elements are converted to strings using their to
localestring methods and these strings are separated by a
locale-specific string (such as a comma “,”).
... syntax arr.to
localestring([
locales[, options]]); parameters
locales optional a string with a bcp 47 language tag, or an array of such strings.
...And 12 more matches
Date.prototype.toLocaleString() - JavaScript
the to
localestring() method returns a string with a language sensitive representation of this date.
... the new
locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function.
... in older implementations, which ignore the
locales and options arguments, the
locale used and the form of the string returned are entirely implementation-dependent.
...And 12 more matches
Bootstrapping a new locale
to learn how to bootstrap a new
locale for mozilla projects, please see those documents.
...when a localization team is registered and your hg repository is set up for a
locale, you can then clone the existing mozilla release branch (i.e.
... install the compare-
locales utility the next step is to install compare-
locales.
...And 10 more matches
Date.prototype.toLocaleDateString() - JavaScript
the to
localedatestring() method returns a string with a language sensitive representation of the date portion of this date.
... the new
locales and options arguments let applications specify the language whose formatting conventions should be used and allow to customize the behavior of the function.
... in older implementations, which ignore the
locales and options arguments, the
locale used and the form of the string returned are entirely implementation dependent.
...And 10 more matches
Number.prototype.toLocaleString() - JavaScript
the to
localestring() method returns a string with a language-sensitive representation of this number.
... syntax numobj.to
localestring([
locales [, options]]) parameters the
locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
... in implementations, which ignore the
locales and options arguments, the
locale used and the form of the string returned are entirely implementation dependent.
...And 10 more matches
String.prototype.localeCompare() - JavaScript
the
localecompare() method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order.
... the new
locales and options arguments let applications specify the language whose sort order should be used and customize the behavior of the function.
... in older implementations, which ignore the
locales and options arguments, the
locale and sort order used are entirely implementation-dependent.
...And 10 more matches
String.prototype.toLocaleUpperCase() - JavaScript
the to
localeuppercase() method returns the calling string value converted to upper case, according to any
locale-specific case mappings.
... syntax str.to
localeuppercase() str.to
localeuppercase(
locale) str.to
localeuppercase([
locale,
locale, ...]) parameters
locale optional the
locale parameter indicates the
locale to be used to convert to upper case according to any
locale-specific case mappings.
... if multiple
locales are given in an array, the best available
locale is used.
...And 10 more matches
Date.prototype.toLocaleFormat() - Archive of obsolete content
the non-standard to
localeformat() method converts a date to a string using the specified formatting.
...see also the newer version of date.prototype.to
localedatestring().
...see warning: date.prototype.to
localeformat is deprecated for more information and migration help.
...And 9 more matches
nsILocale
intl/
locale/idl/nsi
locale.idlscriptable represents one
locale, which can be used for things like sorting text strings and formatting numbers, dates and times.
... inherits from: nsisupports last changed in gecko 1.0 method overview astring getcategory(in astring category); methods getcategory() retrieves a string with the current
locale name.
... astring getcategory( in astring category ); parameters category a string representing the category to retrieve the
locale for.
...And 9 more matches
Date.prototype.toLocaleTimeString() - JavaScript
the to
localetimestring() method returns a string with a language sensitive representation of the time portion of this date.
... the new
locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function.
... in older implementations, which ignore the
locales and options arguments, the
locale used and the form of the string returned are entirely implementation dependent.
...And 9 more matches
String.prototype.toLocaleLowerCase() - JavaScript
the to
localelowercase() method returns the calling string value converted to lower case, according to any
locale-specific case mappings.
... syntax str.to
localelowercase() str.to
localelowercase(
locale) str.to
localelowercase([
locale,
locale, ...]) parameters
locale optional the
locale parameter indicates the
locale to be used to convert to lower case according to any
locale-specific case mappings.
... if multiple
locales are given in an array, the best available
locale is used.
...And 9 more matches
JS_GetLocaleCallbacks
get and set
locale specific string conversion and error message callbacks.
... syntax js
localecallbacks * js_get
localecallbacks(jsruntime *rt); void js_set
localecallbacks(jsruntime *rt, js
localecallbacks *callbacks); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... callbacks js
localecallbacks * pointer to a js
localecallbacks struct.
...And 8 more matches
BigInt.prototype.toLocaleString() - JavaScript
the to
localestring() method returns a string with a language-sensitive representation of this bigint.
... syntax bigintobj.to
localestring([
locales [, options]]) parameters the
locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
... in implementations that ignore the
locales and options arguments, the
locale used and the form of the string returned are entirely implementation-dependent.
...And 7 more matches
Intl.Locale.prototype.caseFirst - JavaScript
the intl.
locale.prototype.casefirst property is an accessor property that returns whether case is taken into account for the
locale's collation rules.
... description a
locale's collation rules are used to determine how strings are ordered in that
locale.
... certain
locales use a character's case (uppercase or lowercase) in the collation process.
...And 7 more matches
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
the javascript warning "date.prototype.to
localeformat is deprecated; consider using intl.datetimeformat instead" occurs when the non-standard date.prototype.to
localeformat method is used.
... message warning: date.prototype.to
localeformat is deprecated; consider using intl.datetimeformat instead error type warning.
... the non-standard date.prototype.to
localeformat method is deprecated and shouldn't be used anymore.
...And 6 more matches
Intl.Collator.supportedLocalesOf() - JavaScript
the intl.collator.supported
localesof() method returns an array containing those of the provided
locales that are supported in collation without having to fall back to the runtime's default
locale.
... syntax intl.collator.supported
localesof(
locales[, options]) parameters
locales a string with a bcp 47 language tag, or an array of such strings.
... for the general form of the
locales argument, see the intl page.
...And 6 more matches
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
the intl.datetimeformat.supported
localesof() method returns an array containing those of the provided
locales that are supported in date and time formatting without having to fall back to the runtime's default
locale.
... syntax intl.datetimeformat.supported
localesof(
locales[, options]) parameters
locales a string with a bcp 47 language tag, or an array of such strings.
... for the general form of the
locales argument, see the intl page.
...And 6 more matches
Intl.DisplayNames.supportedLocalesOf() - JavaScript
the intl.displaynames.supported
localesof() method returns an array containing those of the provided
locales that are supported in date and time formatting without having to fall back to the runtime's default
locale.
... syntax intl.displaynames.supported
localesof(
locales[, options]) parameters
locales a string with a bcp 47 language tag, or an array of such strings.
... for the general form of the
locales argument, see the intl page.
...And 6 more matches
Intl.ListFormat.supportedLocalesOf() - JavaScript
the intl.listformat.supported
localesof() method returns an array containing those of the provided
locales that are supported in date and time formatting without having to fall back to the runtime's default
locale.
... syntax intl.listformat.supported
localesof(
locales[, options]) parameters
locales a string with a bcp 47 language tag, or an array of such strings.
... for the general form of the
locales argument, see the intl page.
...And 6 more matches
Intl.Locale.prototype.hourCycle - JavaScript
the intl.
locale.prototype.hourcycle property is an accessor property that returns the time keeping format convention used by the
locale.
...the hourcycle property makes it easier for javascript programmers to access the clock type used by a particular
locale.
... like other additional
locale data, hour cycle type is an extension subtag, which extends the data contained in a
locale string.
...And 6 more matches
Intl.Locale.prototype.numeric - JavaScript
the intl.
locale.prototype.numeric property is an accessor property that returns whether the
locale has special collation handling for numeric characters.
... description like intl.
locale.casefirst, numeric represents a modification to the collation rules utilized by the
locale.
...if numeric is set to true, then the
locale will take numeric characters into account when collating strings.
...And 6 more matches
Intl.NumberFormat.supportedLocalesOf() - JavaScript
the intl.numberformat.supported
localesof() method returns an array containing those of the provided
locales that are supported in number formatting without having to fall back to the runtime's default
locale.
... syntax intl.numberformat.supported
localesof(
locales[, options]) parameters
locales a string with a bcp 47 language tag, or an array of such strings.
... for the general form of the
locales argument, see the intl page.
...And 6 more matches
Intl.PluralRules.supportedLocalesOf() - JavaScript
the intl.pluralrules.supported
localesof() method returns an array containing those of the provided
locales that are supported in plural formatting without having to fall back to the runtime's default
locale.
... syntax intl.pluralrules.supported
localesof(
locales[, options]) parameters
locales a string with a bcp 47 language tag, or an array of such strings.
... for the general form of the
locales argument, see the intl page.
...And 6 more matches
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
the intl.relativetimeformat.supported
localesof() method returns an array containing those of the provided
locales that are supported in date and time formatting without having to fall back to the runtime's default
locale.
... syntax intl.relativetimeformat.supported
localesof(
locales[, options]) parameters
locales a string with a bcp 47 language tag, or an array of such strings.
... for the general form of the
locales argument, see the intl page.
...And 6 more matches
compare-locales
compare-
locales is a python script that helps localizers to check their work without running firefox or another application.
... if you want to run compare-
locales on windows, be sure to first install mozillabuild.
... installation compare-
locales needs to be installed, and it requires that you have python 2.7 or 3.5+ installed on your machine.
...And 5 more matches
Intl.Locale.prototype.collation - JavaScript
the intl.
locale.prototype.collation property is an accessor property that returns the collation type for the
locale, which is used to order strings according to the
locale's rules.
...the collation property helps to make it easier for javascript programmers to access the collation type used by a particular
locale.
...nyin ordering for latin, stroke order for cjk characters (used in chinese) trad traditional style ordering (such as in spanish) unihan pinyin ordering for latin, unihan radical-stroke ordering for cjk characters (used in chinese) zhuyin pinyin ordering for latin, zhuyin order for bopomofo and cjk characters (used in chinese) examples like other
locale subtags, the collation type can be added to the intl.
locale object via the
locale string, or a configuration object argument to the constructor.
...And 5 more matches
Intl.Locale.prototype.language - JavaScript
the intl.
locale.prototype.language property is an accessor property that returns the language associated with the
locale.
... description language is one of the core features of a
locale.
... the unicode specification treats the language identifier of a
locale as the language and the region together (to make a distiction between dialects and variations, e.g.
...And 5 more matches
Intl.Locale.prototype.numberingSystem - JavaScript
the intl.
locale.prototype.numberingsystem property is an accessor property that returns the numeral system used by the
locale.
...as with most internationalization schemas, the numeral systems that can be represented in a
locale object by numberingsystem are standardized by unicode.
...orithmic tamldec modern tamil decimal digits telu telugu digits thai thai digits tirh tirhuta digits tibt tibetan digits traditio traditional numerals — may be algorithmic vaii vai digits wara warang citi digits wcho wancho digits examples setting the numberingsystem value via the
locale string in the unicode
locale string spec, the values that numberingsystem represents correspond to the key nu.
...And 5 more matches
Intl.Locale.prototype.toString() - JavaScript
the intl.
locale.prototype.tostring() returns the
locale's full
locale identifier string.
... syntax
locale.tostring() return value the
locale's unicode
locale identifier string.
... description the
locale object is a javascript representation of a concept unicode
locale identifier.
...And 5 more matches
Object.prototype.toLocaleString() - JavaScript
the to
localestring() method returns a string representing the object.
... this method is meant to be overridden by derived objects for
locale-specific purposes.
... syntax obj.to
localestring() return value a string representing the object.
...And 5 more matches
JS_SetDefaultLocale
this article covers features introduced in spidermonkey 24 set and reset the default
locale for the ecmascript internationalization api.
... syntax bool js_setdefault
locale(jsruntime *rt, const char *
locale); void js_resetdefault
locale(jsruntime *rt); name type description rt jsruntime * pointer to a js runtime
locale const char * string represents
locale.
... description js_setdefault
locale sets the default
locale for the ecmascript internationalization api (intl.collator, intl.numberformat, intl.datetimeformat).
...And 4 more matches
:-moz-locale-dir(ltr) - CSS: Cascading Style Sheets
the :-moz-
locale-dir(ltr) css pseudo-class is a mozilla extension that matches an element if the user interface is being displayed left-to-right.
... this is determined by the preference intl.uidirection.
locale (where
locale is the current
locale) being set to "ltr".
... note: this selector is mainly used by extensions and themes to adapt the user interface based on the user's
locale.
...And 4 more matches
:-moz-locale-dir(rtl) - CSS: Cascading Style Sheets
the :-moz-
locale-dir(rtl) css pseudo-class is a mozilla extension that matches an element if the user interface is being displayed right-to-left.
... this is determined by the preference intl.uidirection.
locale (where
locale is the current
locale) being set to "rtl".
... note: this selector is mainly used by extensions and themes to adapt the user interface based on the user's
locale.
...And 4 more matches
Intl.Locale.prototype.calendar - JavaScript
the intl.
locale.prototype.calendar property is an accessor property which returns the type of calendar used in the
locale.
... description the calendar property returns the part of the
locale that indicates the
locale's calendar era.
... islamicc civil (algorithmic) arabic calendar examples adding a calendar in the
locale string calendar eras fall under the category of
locale key "extension keys".
...And 4 more matches
Intl.Locale.prototype.region - JavaScript
the intl.
locale.prototype.region property is an accessor property that returns the region of the world (usually a country) associated with the
locale.
... description the region is an essential part of the
locale identifier, as it places the
locale in a specific area of the world.
... knowing the
locale's region is vital to identifying differences between
locales.
...And 4 more matches
Making sure your theme works with RTL locales - Archive of obsolete content
the important thing to understand about these
locales, is that the entire interface is mirrored right-to-left.
...should i make a special theme for these
locales?" don't despair: making a theme rtl-compatible is fairly easy!
... gecko 1.9.2 and later gecko 1.9.2 introduced the :-moz-
locale-dir css pseudoclass, which matches based on whether the user interface is being rendered left-to-right or right-to-left: :-moz-
locale-dir(ltr) matches if the user interface is being rendered left to right.
...And 3 more matches
IDBLocaleAwareKeyRange - Web APIs
the idb
localeawarekeyrange interface of the indexeddb api is a firefox-specific version of idbkeyrange — it functions in exactly the same fashion, and has the same properties and methods, but it is intended for use with idbindex objects when the original index had a
locale value specified upon its creation (see createindex()'s optionalparameters) — that is, it has
locale aware sorting enabled.
... bear in mind however that idb
localeawarekeyrange has its own implementation of idbkeyrange.bound.
...with
locale-aware indexes, the meaning of < depends on the
locale, so for example in lithuanian y is sorted between i and k.
...And 3 more matches
Intl.Locale() constructor - JavaScript
the intl.
locale constructor is a standard built-in property of the intl object that represents a unicode
locale identifier.
... syntax new intl.
locale(tag [, options]) parameters tag the unicode
locale identifier string.
... options an object that contains configuration for the
locale.
...And 3 more matches
Intl.Locale.prototype.maximize() - JavaScript
the intl.
locale.prototype.maximize() method gets the most likely values for the language, script, and region of the
locale based on existing values.
... syntax
locale.maximize() return value a
locale instance whose basename property returns the result of the add likely subtags algorithm executed against
locale.basename.
... description sometimes, it is convenient to be able to identify the most likely
locale language identifier subtags based on an incomplete langauage id.
...And 3 more matches
Intl.Locale.prototype.minimize() - JavaScript
the intl.
locale.prototype.minimize() method attempts to remove information about the
locale that would be added by calling
locale.maximize().
... syntax
locale.minimize() return value a
locale instance whose basename property returns the result of the remove likely subtags algorithm executed against
locale.basename.
... description this method carries out the reverse of maximize(), removing any language, script, or region subtags from the
locale language identifier (essentially the contents of basename).
...And 3 more matches
Intl.Locale.prototype.script - JavaScript
the intl.
locale.prototype.script property is an accessor property which returns the script used for writing the particular language used in the
locale.
... description a script, sometimes called writing system, is one of the core attributes of a
locale.
... examples setting the script in the
locale identifer string argument the script is the second part of a valid unicode language identifier string, and can be set by adding it to the
locale identifier string that is passed into the
locale constructor.
...And 3 more matches
TypedArray.prototype.toLocaleString() - JavaScript
the to
localestring() method returns a string representing the elements of the typed array.
... the elements are converted to strings and are separated by a
locale-specific string (such as a comma “,”).
... this method has the same algorithm as array.prototype.to
localestring() and, as the typed array elements are numbers, the same algorithm as number.prototype.to
localestring() applies for each element.
...And 3 more matches
Intl.Locale.prototype.baseName - JavaScript
the intl.
locale.prototype.basename property returns a substring of the
locale's string representation, containing core information about the
locale.
... description an intl.
locale object represents a parsed local and options for that
locale.
... the basename property returns basic, core information about the
locale in the form of a substring of the complete data string.
...And 2 more matches
Make your xulrunner app match the system locale - Archive of obsolete content
the first step is to get the code we're about to write to run before any of the
locale specific resources are loaded.
...the second step is to figure out the system
locale.
...then set the
locale preference.
... from xpcom import components ps_cls = components.classes["@mozilla.org/preferences-service;1"] ps = ps_cls.getservice(components.interfaces.nsiprefservice) branch = ps.getbranch("general.useragent.") branch.setcharpref("
locale", lang) i also set the language environment variable to match the system
locale so that python's gettext functionality will work (it pulls straight from language instead of using set
locale): os.environ["language"] = lang ...
Locale - MDN Web Docs Glossary: Definitions of Web-related terms
locale is a set of language- or country-based preferences for a user interface.
... a program draws its
locale settings from the language of the host system.
... among other things,
locales represent paper format, currency, date format, and numbers according to the protocols in the given region.
... learn more general knowledge
locale on wikipedia ...
IDBIndex.locale - Web APIs
the
locale read-only property of the idbindex interface returns the
locale of the index (for example en-us, or pl) if it had a
locale value specified upon its creation (see createindex()'s optionalparameters.) note that this property always returns the current
locale being used in this index, in other words, it never returns "auto".
... syntax var myindex = objectstore.index('index'); console.log(myindex.
locale); value a domstring.
... the
locale value is logged to the console.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); console.log(myindex.
locale); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</td>' + '<td>' + cursor.value.fname + '</td>' + '<td>' + cursor.value.jtitle + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.
Intl.getCanonicalLocales() - JavaScript
the intl.getcanonical
locales() method returns an array containing the canonical
locale names.
... syntax intl.getcanonical
locales(
locales) parameters
locales a list of string values for which to get the canonical
locale names.
... return value an array containing the canonical
locale names.
... examples using getcanonical
locales intl.getcanonical
locales('en-us'); // ["en-us"] intl.getcanonical
locales(['en-us', 'fr']); // ["en-us", "fr"] intl.getcanonical
locales('en_us'); // rangeerror:'en_us' is not a structurally valid language tag specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.getcanonical
locales' in that specification.
IDBIndex.isAutoLocale - Web APIs
the isauto
locale read-only property of the idbindex interface returns a boolean indicating whether the index had a
locale value of auto specified upon its creation (see createindex()'s optionalparameters.) syntax var myindex = objectstore.index('index'); console.log(myindex.isauto
locale); value a boolean.
... the isauto
locale value is logged to the console.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); console.log(myindex.isauto
locale); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</td>' + '<td>' + cursor.value.fname + '</td>' + '<td>' + cursor.value.jtitle + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + c...
appLocale - Archive of obsolete content
« xul reference app
locale obsolete since gecko 1.9.1 type: nsi
locale returns the xpcom object which holds information about the user's
locale.
... this is an object which implements nsi
locale.
CompositionEvent.locale - Web APIs
the
locale read-only property of the compositionevent interface returns the
locale of current input method (for example, the keyboard layout
locale if the composition is associated with ime).
... syntax my
locale = compositionevent.
locale value a domstring representing the
locale of current input method.
Creating localizable web applications
don't forget about right-to-left
locales.
... app logic detect the
locale correctly be smart about detecting the user's
locale correctly.
... always give the user a possibility to change the
locale (e.g.
...And 32 more matches
L20n Javascript API
l20n javascript api var ctx = l20n.getcontext(); ctx.linkresource('./
locales/strings.l20n'); ctx.request
locales(); when you freeze the context by calling request
locales, the resource files will be retrieved, parsed and compiled.
... ctx.localize(['hello', 'new'], function(l10n) { var node = document.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.classlist.remove('hidden'); }); ctx.register
locales(default
locale: string?, available
locales: array<string>?) register the default
locale of the context instance, as well as all other
locales available to the context instance before the language negotiation.
...
locales are referenced by their bcp 47 language codes.
...And 30 more matches
Localizing with Koala
for the purposes of this tutorial, the
locale code that we will use will be called "x-testing".
...included
locale: en-us (this is the original
locale you're translating from).
...zilla\l10n\application\firefox> rmdir 3.6 c:\mozilla\l10n\application\firefox> hg clone http://hg.mozilla.org/releases/mozilla-1.9.2 3.6 requesting all changes adding changesets adding manifests adding file changes added 33099 changesets with 158636 changes to 50664 files (+9 heads) 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...
...And 22 more matches
Localization - Archive of obsolete content
localized strings translated strings are kept in a directory called "
locale" under your main add-on directory, one file for each
locale.
... the files: use the .properties format are named "xx-yy.properties", where "xx-yy" is the name of the
locale in question contain one entry for each 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!
...And 20 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
most extensions consist of a single content package2 the
locale package this package is used to contain language data that can be translated.
... to make an extension’s gui support multiple languages, you can include multiple
locale packages, one for each language.
... extension/ chrome manifest chrome/ #registered in the chrome content package #run with privileges
locale package skin package figure 1: chrome packages and chrome registration (fixme: not really explicit and not a figure) cross-package overlays the “overlay” technique introduced in chapter 3 required the use of the xul-overlay instruction in the xul document that is the overlay target.
...And 19 more matches
Complete - Archive of obsolete content
js installation script for seamonkey chrome directory containing the extension code chrome/allcustom.jar the extension jar defaults/preferences directory containing a preferences file inside the jar there are three directories: content xul, javascript and other content that does not depend on the
locale or theme
locale files for each
locale skin files for each theme version checks firefox etc.
...for more information about version checks, see: extension versioning, update and compatibility the installed jar to use disk space efficiently on the end user's computer, the three directories (content,
locale, skin) are packed in a jar file.
...a combination of language and regional preferences is known as a
locale.
...And 18 more matches
The Essentials of an Extension - Archive of obsolete content
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).
... as we saw in the directory structure of the unpacked extension, the chrome is composed of 3 sections: content,
locale and skin.
...if we open the chrome.manifest file (again, any text editor will do), we see that the same 3 sections are mentioned: content xulschoolhello content/ skin xulschoolhello classic/1.0 skin/
locale xulschoolhello en-us
locale/ the chrome.manifest file tells firefox where to look for chrome files.
...And 15 more matches
Creating a Language Pack
re-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).
... creating a langpack we will now merge the localized files from x-testing
locale with the en-us files from the original source.
... every time you want to create a langpack, you need to be in the directory obj-firefox-build/browser/
locales.
...And 15 more matches
Localizations and character encodings - Developer guides
for most
locales, the fallback encoding is windows-1252 (often called iso-8859-1), which was the encoding emitted by most windows applications in the 1990s and a superset of the encoding emitted by most unix applications in the 1990s 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.
...And 15 more matches
L10n Checks
l10n checks is a python script and library similar to compare-
locales.
...un: $ hg clone http://hg.mozilla.org/users/akalla_aviary.pl/silme-patched/ $ cd silme-patched/ $ 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.
...And 13 more matches
Localizing without a specialized tool
next, again in your working dir, create a directory that will serve as localization base: $ mkdir l10n-mozilla-1.9.2 $ cd l10n-mozilla-1.9.2 inside this directory you will put all the localization files in a folder named after your
locale, e.g.
...getting started with compare-
locales you are going to need to create the structure of your localization, where, one-by-one, each of the files needing localization will be copied.
...you will use a tool called compare-
locales to do the comparison between your
locale's files and the en-us reference.
...And 13 more matches
Intl - JavaScript
intl.
locale() constructor for objects that represents a unicode
locale identifier.
... static methods intl.getcanonical
locales() returns canonical
locale names.
...
locale identification and negotiation the internationalization constructors as well as several language sensitive methods of other constructors (listed under see also) use a common pattern for identifying
locales and determining the one they will actually use: they all accept
locales and options arguments, and negotiate the requested
locale(s) against the
locales they support using an algorithm specified in the options.
localematcher property.
...And 13 more matches
Chrome registration
locale localizable applications keep all their localized information in
locale providers.
... this chrome registry is configurable and persistent, and thus a user can install different chrome providers, and select a preferred skin and
locale.
...
locale packagename
localename path/to/files skin packagename skinname path/to/files note: the characters @ # ; : ?
...And 11 more matches
Localizing an extension - Archive of obsolete content
download the sample localizing strings in xul files create the needed
locale files each xul file that comprises the user interface for your extension should have a
locale file in its
locale directory.
... each
locale file maps entity names referenced in the xul files to the strings themselves.
...file contains the mappings for the stockwatcher2.xul file: <!entity panel_loading "loading..."> <!entity menu_refresh_now.label "refresh now"> <!entity menu_apple.label "apple (aapl)"> <!entity menu_google.label "google (goog)"> <!entity menu_microsoft.label "microsoft (msft)"> <!entity menu_yahoo.label "yahoo (yhoo)"> update the xul files each xul file needs to reference its corresponding
locale file.
...And 9 more matches
Manifest Files - Archive of obsolete content
for themes, 'skin' is used while '
locale' is used for
locales.
...themes and
locales the themes and
locales, the syntax is similar as for content packages, but you also need to specify the content package you are providing a theme or
locale for.
... for example: skin browser classic/1.0 jar:classic.jar!/skin/classic/browser/
locale browser en-us jar:en-us.jar!/
locale/browser/ for these, the extra field has been added to indicate that the skin and
locale applies to the browser.
...And 9 more matches
Application Translation with Mercurial
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.
... file comparison program for the translation, it is recommend to use file comparison program to compare the english file (containing the new texts) with the file of your
locale (which is still missing the new strings).
... getting the current texts in english and your
locale obtaining the english texts with the source code get the source code by downloading the following file: firefox desktop or firefox for android: download the mozilla-<branch>.hg file (e.g.
...And 9 more matches
Repackaging Firefox - Archive of obsolete content
the pristine firefox 2 installer files (windows .exe, mac .dmg, or linux .tar.gz) for each of the
locales you need.
...this xpi has the following contents chrome.manifest components/partnerbookmarks.js defaults/preferences/partner.js install.rdf
locale/ar/partner.properties
locale/cs/partner.properties
locale/da/partner.properties
locale/de/partner.properties
locale/el/partner.properties
locale/en-gb/partner.properties
locale/partner.properties
locale/es-ar/partner.properties
locale/es-es/partner.properties
locale/fi/partner.properties
locale/fr/partner.properties
locale/he/partner.properties
locale/hu/partner.properties
locale/it/partner.prope...
...rties
locale/ja/partner.properties
locale/ja-jp-mac/partner.properties
locale/ko/partner.properties
locale/nb-no/partner.properties
locale/nl/partner.properties
locale/pl/partner.properties
locale/pt-br/partner.properties
locale/pt-pt/partner.properties
locale/ru/partner.properties
locale/sk/partner.properties
locale/sv-se/partner.properties
locale/tr/partner.properties
locale/zh-cn/partner.properties
locale/zh-tw/partner.properties partner-bookmarks.xml one by one, the files listed above are: chrome.manifest contains a specialized listing of the contents of the xpi.
...And 8 more matches
XUL Structure - Archive of obsolete content
mozilla also has one component for each installed theme and
locale.
...these three sets are the content, the skin, and the
locale, which are all described below.
... a particular package might provide one or more skins and
locales, but a user can replace them with their own.
...And 8 more matches
Localizing with Mozilla Translator
the directory structure will look like this: (ab-cd jar root)
locale |-- branding | |-- brand.dtd | `-- brand.properties |-- browser | |-- aboutdialog.dtd .
... but in the cvs and mozilla-central repositories the
locale part looks like this: toolkit |--
locales | |-- en-us | | |-- chrome | | | |-- alerts | | | | `-- notificationnames.properties | | | |-- autoconfig | | | | `-- autoconfig.properties | | | |-- cookie | | | | |-- cookieacceptdialog.dtd | | | | `-- cookieacceptdialog.properties | | | |-- global | | | | |...
... browser |--
locales | |-- en-us | | |-- readme.txt | | |-- chrome | | | |-- branding | | | | |-- brand.dtd | | | | `-- brand.properties | | | |-- browser | | | | |-- aboutdialog.dtd as you see, there is ''link'' point, usually at chrome (in cvs & mozilla-central), sometimes in a deeper point.
...And 7 more matches
Initial setup
you also need to determine if a localization effort already exists for your
locale.
... here's what you do: look through the existing localization community directory to see if one already exists for your
locale.
... if a community doesn't exist, send an email to the new-
locales newsgroup for additional guidance.
...And 7 more matches
Intl.DateTimeFormat - JavaScript
static methods intl.datetimeformat.supported
localesof() returns an array containing those of the provided
locales that are supported without having to fall back to the runtime's default
locale.
... instance methods intl.datetimeformat.prototype.format() getter function that formats a date according to the
locale and formatting options of this datetimeformat object.
... intl.datetimeformat.prototype.formattoparts() returns an array of objects representing the date string in parts that can be used for custom
locale-aware formatting.
...And 7 more matches
Index - Archive of obsolete content
so there may be still some reference to the xuldev website (we want to host source code on mdc, not on xuldev), and to japanese things (like some specific
locales, which have been translated to french since non-latin characters are not well supported).
... 1355 app
locale xul properties, xul reference no summary!
... 1965 how to enable
locale switching in a xulrunner application localization this article is for developers who have localised their xul application using dtd entity files and want to provide their users with a mechanism to switch the
locale in the application itself.
...And 6 more matches
Index - Web APIs
34 addresserrors.languagecode api, address, addresserrors, deprecated, language, languagecode,
locale, payment request, payment request api, property, reference, payment an object based on addresserrors includes a languagecode property when the address's languagecode property couldn't be validated.
... 653 compositionevent.
locale api, compositionevent, deprecated,
locale, property, reference the
locale read-only property of the compositionevent interface returns the
locale of current input method (for example, the keyboard layout
locale if the composition is associated with ime).
... 2042 idbindex.isauto
locale api, database, experimental, idbindex, indexeddb, property, reference, storage, isauto
locale the isauto
locale read-only property of the idbindex interface returns a boolean indicating whether the index had a
locale value of auto specified upon its creation (see createindex()'s optionalparameters.) 2043 idbindex.keypath api, database, idbindex, indexeddb, property, referen...
...And 6 more matches
Intl.DateTimeFormat() constructor - JavaScript
syntax new intl.datetimeformat([
locales[, options]]) parameters
locales optional a string with a bcp 47 language tag, or an array of such strings.
... to use the browser's default
locale, omit this argument or pass undefined.
...for the general form and interpretation of the
locales argument, see the intl page.
...And 6 more matches
Bootstrapped extensions - Archive of obsolete content
notes on modifying the application user interface chrome.manifest in bootstrapped add-ons you can use a chrome.manifest file in bootstrapped add-ons to: make your add-on's content available via a chrome:// url (using the content,
locale, and skin instructions in the manifest).
... the absolute minimum needed here is: file: install.rdf file: chrome.manifest file: bootstrap.js folder:
locale folder: valid_
locale_here file: anything.properties in the
locale folder you must have folders for each of the languages you want to provide; each folder must be named a valid
locale (ex: en-us).
...inside the chrome.manifest file these
locale must be defined.
...And 5 more matches
Localization - Archive of obsolete content
in the mozilla chrome system, you will find dtd files located in the
locales subdirectory.
...(en-us.jar is the default for english.) you might have
locale files in multiple languages, for example, us english (en-us) and french (fr).
...to do this, add a line of the following form somewhere near the top of the xul file: <!doctype window system "chrome://findfile/
locale/findfile.dtd"> this line specifies that the url indicated is to be used as a dtd for the file.
...And 5 more matches
Localization technical reviews
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 revision pushed to a new
locale's l10n aurora repo in mercurial.
... is only performed on the first revision a new
locale wants to have released to the public.
... compare-
locale we run the compare-
locales tool on the new
locale to get the statistics on translation of strings and report basic errors.
...And 5 more matches
Setting up the infrastructure
create a
locale directory in your website (usually something like docroot/
locale).
... copy the shell scripts from /addons/trunk/site/app/
locale/ to your
locale directory: extract-po.sh will be used to extract all english strings from your application's directories specified in source_dirs, merge the resulting template (*.pot) file with the existing (already containing translations) messages.po files for each
locale (if they exist) and merge the new messages.po files to messages.mo files.
... compile-mo.sh will only compile all
locales' messages.po files to message.mo files.
...And 5 more matches
Intl.NumberFormat - JavaScript
static methods intl.numberformat.supported
localesof() returns an array containing those of the provided
locales that are supported without having to fall back to the runtime's default
locale.
... instance methods intl.numberformat.prototype.format() getter function that formats a number according to the
locale and formatting options of this numberformat object.
... intl.numberformat.prototype.formattoparts() returns an array of objects representing the number string in parts that can be used for custom
locale-aware formatting.
...And 5 more matches
Install Manifests - Archive of obsolete content
2 extensions 4 themes 8
locale 32 multiple item package 64 spell check dictionary 128 telemetry experiment 256 webextension experiment examples <em:type>2</em:type> this property was added for firefox 1.5, and is only required for add-on types other than extensions and themes.
...the localized description must specify at least one em:
locale which indicates which
locales to use this information for.
... examples this declares a set of add-on metadata to be displayed when the application is running in the de-de
locale.
...And 4 more matches
The Chrome URL - Archive of obsolete content
another advantage over other url types is that they automatically handle multiple themes and
locales.
...the <part> is either 'content', 'skin' or '
locale' depending on which part you want.
...similarly, you can point to a file that is part of a
locale by using '
locale' instead of 'content'.
...And 4 more matches
Creating a spell check dictionary add-on
a
locale code to describe the language of the dictionary.
...it is important to choose the right
locale code, or the spell checker will not be able to match the language of your dictionary against the language of a web page in order to select the right dictionary to use.
... if you are creating a new dictionary, as opposed to updating an existing one, please make sure that there is not already a dictionary available for your
locale.
...And 4 more matches
Localization content best practices
create localizable strings don't assume grammar structures you need to consider the need for different grammar structures in different
locales, and add switching mechanisms to present them appropriately.
... you shouldn't make assumptions as to what those structures will be: instead, let
locales/localizers decide.
...some
locales use a space between the number and the % symbol, some don't, some use a non-breaking space.
...And 4 more matches
Localizing extension descriptions
each has at least one em:
locale property marking the
locale that the information should be used for and then all the various strings for the
locale.
... the following example demonstrates this (most normal manifest properties have been removed for brevity): <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>tabsidebar@blueprintit.co.uk</em:id> <em:localized> <description> <em:
locale>de-de</em:
locale> <em:name>tab sidebar</em:name> <em:description>zeigt in einer sidebar vorschaubilder der inhalte aller offenen tabs an.</em:description> </description> </em:localized> <em:localized> <description> <em:
locale>es-es</em:
locale> <em:name>tab sidebar</em:name> <em:description>muestra una vista previa de sus pestañas en su panel la...
...teral.</em:description> </description> </em:localized> <em:localized> <description> <em:
locale>nl-nl</em:
locale> <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.
...And 4 more matches
L20n HTML Bindings
<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.
... monolingual mode l20n can also operate in the so-called monolingual mode, when there is only one
locale available.
... it doesn't have any specific
locale code (internally, it's called i-default in compliance to rfc 2277).
...And 4 more matches
nsIDBFolderInfo
an getbooleanproperty(in string propertyname, in boolean defaultvalue); void getcharacterset(out acstring charset, out boolean overriden); void getcharactersetoverride(out boolean charactersetoverride); obsolete since gecko 1.8 string getcharptrcharacterset(); string getcharptrproperty(in string propertyname); void get
locale(in nsstring result); native code only!
...ring propertyname, in boolean apropertyvalue); void setcharacterset(in string charset); void setcharactersetoverride(in boolean charactersetoverride); obsolete since gecko 1.8 void setcharptrproperty(in string apropertyname, in string apropertyvalue); void sethighwater(in nsmsgkey highwater, in boolean force); void set
locale(in nsstring
locale); native code only!
... foldersize unsigned long highwater nsmsgkey imaphierarchyseparator wchar imaptotalpendingmessages long imapuidvalidity long imapunreadpendingmessages long knownartsset string
locale astring mailboxname astring nummessages long numunreadmessages long sortorder nsmsgviewsortordervalue sorttype nsmsgviewsorttypevalue version unsigned long viewflags nsmsgviewflagstypev...
...And 4 more matches
Date - JavaScript
(negative values are returned for prior times.) date.prototype.gettimezoneoffset() returns the time-zone offset in minutes for the current
locale.
... date.prototype.to
localedatestring() returns a string with a locality sensitive representation of the date portion of this date based on system settings.
... date.prototype.to
localeformat() converts a date to a string, using a format string.
...And 4 more matches
Intl.Collator() constructor - JavaScript
syntax new intl.collator([
locales[, options]]) parameters
locales optional.
...for the general form and interpretation of the
locales argument, see the intl page.
... the following unicode extension keys are allowed: co variant collations for certain
locales.
...And 4 more matches
Intl.DisplayNames - JavaScript
static methods intl.displaynames.supported
localesof() returns an array containing those of the provided
locales that are supported without having to fall back to the runtime's default
locale.
... instance methods intl.displaynames.prototype.of() this method receives a code and returns a string based on the
locale and options provided when instantiating intl.displaynames.
... intl.displaynames.prototype.resolvedoptions() returns a new object with properties reflecting the
locale and formatting options computed during initialization of the object.
...And 4 more matches
Intl.RelativeTimeFormat() constructor - JavaScript
syntax new intl.relativetimeformat([
locales[, options]]) parameters
locales optional.
...for the general form and interpretation of the
locales argument, see the intl page.
...an object with some or all of the following properties:
localematcher the
locale matching algorithm to use.
...And 4 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
the examples will also assume that you know how to properly add instructions to your add-on's chrome.manifest to add and remove resource, chrome,
locale, & etc.
...an old-style add-on installer is packaged something like this: myaddon.xpi file (glorified zip) └─ chrome.manifest └─ install.rdf └─ chrome folder └─ myaddon folder └─ content.jar file └─ content folder (most files go here) └─
locale folder (your
locale files go here) in versions of firefox prior to 4.0 (gecko 2.0), the xpi would be extracted into a folder in your profile's extensions folder.
...the big culprits are jsm files and
locale files (namely property files), though in some situations this is true for dynamically loaded image files too.
...And 3 more matches
Creating a Help Content Pack - Archive of obsolete content
for example, if your glossary, index, and table of contents rdf files are all located at chrome://myapp/
locale/help/*, then you could put chrome://myapp/
locale/help/ here and use only the actual file names without path when needed later.
... the location of each of the glossary, index, and table of contents data sources is stored in one rdf:description element contained within one rdf:li element, like so: <rdf:seq> <rdf:li> <rdf:description nc:panelid="glossary" nc:datasources="chrome://foo/
locale/help/glossary.rdf"/> </rdf:li> <rdf:li> <rdf:description nc:panelid="toc" nc:datasources="chrome://foo/
locale/help/glossary.rdf"/> </rdf:li> <rdf:li> <rdf:description nc:panelid="index" nc:datasources="chrome://foo/
locale...
... have the help viewer search through these additional data sources, define another rdf:li element like so: <rdf:li> <rdf:description nc:panelid="search" nc:datasources="" nc:emptysearchtext="[no matching items found.]" nc:emptysearchlink="chrome://foo/
locale/bar.html"/> </rdf:li> nc:panelid should be set to search.
...And 3 more matches
Localizing with Pontoon
next, simply select the project you want to work on and your
locale from the dropdown menus.
... pontoon will automatically open that
locale's project for you to get started.
...
locale selector (slovenian) switches between languages to localize.
...And 3 more matches
QA phase
preliminary instructions we will be using the following file directories for this example: your working directory (root)/ mozilla-aurora (en-us source, pulled from http://hg.mozilla.org/releases/mozilla-aurora )/ l10n-central (directory for l10n directories, one per l10n; often referred to as "l10n base")/ your-
locale-code (a directory with your l10n files, in this example we'll use x-testing) example: root/mozilla-aurora & root/l10n-central/x-testing additionally, you will need to copy and translate the toolkit/defines.inc file directly from en-us before you can build.
... enter the following commands: mkdir -p l10n-central/x-testing/toolkit/ cp mozilla-aurora/toolkit/
locales/defines.inc l10n-central/x-testing/toolkit/defines.inc tah-dah!
... enter the following command to perform the configuration: $ ./mach configure once your command-line finishes spitting out the config command's output, navigate to the newly created directory: $ cd ../firefox-build/browser/
locales now you're ready to build!
...And 3 more matches
Storage
return transaction.commit(); } collation (sorting) sqlite provides several collation methods (binary, nocase, and rtrim), but these are all very simple and have no support for various text encodings or the user's
locale.
... gecko 1.9.2 added support for several new collation methods:
locale case- and accent-insensitive collation.
...
locale_case_sensitive case-sensitive, accent-insensitive collation.
...And 3 more matches
Intl.Collator.prototype.resolvedOptions() - JavaScript
the intl.collator.prototype.resolvedoptions() method returns a new object with properties reflecting the
locale and collation options computed during initialization of this collator object.
... syntax collator.resolvedoptions() return value a new object with properties reflecting the
locale and collation options computed during the initialization of the given collator object.
... description the resulting object has the following properties:
locale the bcp 47 language tag for the
locale actually used.
...And 3 more matches
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.datetimeformat.prototype.resolvedoptions() method returns a new object with properties reflecting the
locale and date and time formatting options computed during initialization of this datetimeformat object.
... syntax datetimeformat.resolvedoptions() return value a new object with properties reflecting the
locale and date and time formatting options computed during the initialization of the given datetimeformat object.
... description the resulting object has the following properties:
locale the bcp 47 language tag for the
locale actually used.
...And 3 more matches
Intl.NumberFormat() constructor - JavaScript
syntax new intl.numberformat([
locales[, options]]) parameters
locales optional a string with a bcp 47 language tag, or an array of such strings.
... for the general form and interpretation of the
locales argument, see the intl page.
...possible values are: "symbol" to use a localized currency symbol such as €, this is the default value, "narrowsymbol" to use a narrow format symbol ("$100" rather than "us$100"), "code" to use the iso currency code, "name" to use a localized currency name such as "dollar", currencysign in many
locales, accounting format means to wrap the number with parentheses instead of appending a minus sign.
...And 3 more matches
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
the intl.pluralrules.prototype.resolvedoptions() method returns a new object with properties reflecting the
locale and plural formatting options computed during initialization of this pluralrules object.
... syntax pluralrule.resolvedoptions() return value a new object with properties reflecting the
locale and plural formatting options computed during the initialization of the given pluralrules object.
... description the resulting object has the following properties:
locale the bcp 47 language tag for the
locale actually used.
...And 3 more matches
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.relativetimeformat.prototype.resolvedoptions() method returns a new object with properties reflecting the
locale and relative time formatting options computed during initialization of this relativetimeformat object.
... syntax relativetimeformat.resolvedoptions() return value a new object with properties reflecting the
locale and number formatting options computed during the initialization of the given relativetimeformat object.
... description the resulting object has the following properties:
locale the bcp 47 language tag for the
locale actually used.
...And 3 more matches
Intl.RelativeTimeFormat - JavaScript
static methods intl.relativetimeformat.supported
localesof() returns an array containing those of the provided
locales that are supported without having to fall back to the runtime's default
locale.
... instance methods intl.relativetimeformat.prototype.format() formats a value and a unit according to the
locale and formatting options of the given intl.relativetimeformat object.
... intl.relativetimeformat.prototype.formattoparts() returns an array of objects representing the relative time format in parts that can be used for custom
locale-aware formatting.
...And 3 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
so now you need to create the normal content/,
locale/ and skin/ directories in which to place your chrome files.
...for our simple extension example, this file might look something like this: myextension.jar: % content myextension %content/ %
locale myextension en-us %
locale/ % skin myextension classic/1.0 %skin/classic/ % overlay chrome://browser/content/browser.xul chrome://myextension/content/myextensionoverlay.xul content/myextensionoverlay.js (content/myextensionoverlay.js) content/myextensionoverlay.xul (content/myextensionoverlay.xul)
locale/myextension.dtd (
locale/myextens...
...ion.dtd)
locale/myextension.properties (
locale/myextension.properties) skin/classic/myextension.css (skin/classic/myextension.css) place this code in a file called jar.mn in the root directory of your extension, making sure that the paths in parentheses point to actual files (when interpreted relative to the root directory).
...And 2 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
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.
... 253
locale composing, glossary,
locale locale is a set of language- or country-based preferences for a user interface.
...And 2 more matches
Localization and Plurals
chrome://mozapps/
locale/downloads/do...tes,hours,days chrome://mozapps/
locale/downloads/do...dstitlepercent chrome://browser/
locale/browser.prop...auseddownloads version history 0.1: initial version with pluralrule check, properties input loading, table generation, sample output display 0.2: use pluralform.numforms() to get the number of forms instead of figuring out locally to better support future rules - requir...
...this module provides a couple methods for localizing to the browser's current
locale as well as getting methods to localize to a desired plural rule.
... the latter ability of specifying a plural rule is useful for extensions because the extension doesn't necessarily have to be localized to the browser's
locale.
...And 2 more matches
SVN for Localizers
inside mozilla.com/trunk/
locales, there are separate directories for each
locale that is localizing mozilla.com.
... in each of those
locale directories are other directories with files to be localized in .lang format.
... enter the following command in your command-line tool: svn checkout https://svn.mozilla.org/projects/mozilla.com/trunk/
locales/[your
locale code] mozilla-l10n-[your-
localecode] this command creates the mozilla-l10n-[your-
localecode] directory on your computer and copies into it all of the files from https://svn.mozilla.org/projects/moz...om/trunk/
locales/[your
locale code].
...And 2 more matches
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.
...here's the basic process: file a bug under mozilla localizations>[your_
locale] to request updates to your
locale's productization preferences.
... global search the second position can be used for the next best local language provider, meaning coverage within the local language and/or
locale (indexing a smaller portion of the www but producing better local language results).
...And 2 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
e for the input by including a date and time inside the value attribute, like so: <label for="party">enter a date and time for your party booking:</label> <input id="party" type="datetime-local" name="partydate" value="2017-06-01t08:30"> one thing to note is that the displayed date and time formats differ from the actual value; the displayed date and time are formatted according to the user's
locale as reported by their operating system, whereas the date/time value is always formatted yyyy-mm-ddthh:mm.
... using datetime-local inputs date/time inputs sound convenient at first glance; they provide an easy ui for choosing dates and times, and they normalize the data format sent to the server, regardless of the user's
locale.
... setting timezones one thing the datetime-local input type doesn't provide is a way to set the time zone and/or
locale of the date/time control.
...And 2 more matches
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
the intl.displaynames.prototype.resolvedoptions() method returns a new object with properties reflecting the
locale and style formatting options computed during the construction of the current displaynames object.
... syntax displaynames.resolvedoptions() return value an object with properties reflecting the
locale and formatting options computed during the construction of the given displaynames object.
... description the object returned by resolvedoptions() has the following properties:
locale the bcp 47 language tag for the
locale actually used.
...And 2 more matches
Intl.ListFormat.prototype.resolvedOptions() - JavaScript
the intl.listformat.prototype.resolvedoptions() method returns a new object with properties reflecting the
locale and style formatting options computed during the construction of the current listformat object.
... syntax listformat.resolvedoptions() return value an object with properties reflecting the
locale and formatting options computed during the construction of the given listformat object.
... description the object returned by resolvedoptions() has the following properties:
locale the bcp 47 language tag for the
locale actually used.
...And 2 more matches
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
the intl.numberformat.prototype.resolvedoptions() method returns a new object with properties reflecting the
locale and number formatting options computed during initialization of this numberformat object.
... syntax numberformat.resolvedoptions() return value a new object with properties reflecting the
locale and number formatting options computed during the initialization of the given numberformat object.
... description the resulting object has the following properties:
locale the bcp 47 language tag for the
locale actually used.
...And 2 more matches
Intl.PluralRules() constructor - JavaScript
syntax new intl.pluralrules([
locales[, options]]) parameters
locales optional.
...for the general form and interpretation of the
locales argument, see the intl page.
...an object with some or all of the following properties:
localematcher the
locale matching algorithm to use.
...And 2 more matches
Intl.PluralRules - JavaScript
static methods intl.pluralrules.supported
localesof() returns an array containing those of the provided
locales that are supported without having to fall back to the runtime's default
locale.
... instance methods intl.pluralrules.prototype.resolvedoptions() returns a new object with properties reflecting the
locale and collation options computed during initialization of the object.
... intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for
locale-aware formatting.
...And 2 more matches
Intl.RelativeTimeFormat.prototype.format() - JavaScript
the intl.relativetimeformat.prototype.format() method formats a value and unit according to the
locale and formatting options of this relativetimeformat object.
... description the function returned by the format getter formats a value and a unit into a string according to the
locale and formatting options of this intl.relativetimeformat object.
... // create a relative time formatter in your
locale // with default values explicitly passed in.
...And 2 more matches
l10n - Archive of obsolete content
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.
... localized strings are supplied by the add-on developer in .properties files stored in the add-ons "
locale" directory.
...for compatibility with tools that expect this syntax, you can assign this function to "_": var _ = require("sdk/l10n").get; given a .properties file for the current
locale containing an entry like: hello_string= hello!
... parameters identifier : string a identifier for the localization of a particular string in the current
locale.
Install Scripts - Archive of obsolete content
it takes two arguments, the first is the type of chrome to register (content, skin or
locale).
...because the find files dialog contains content, a skin file and a
locale file, registerchrome() will need to be called three times.
... registerchrome(install.content | install.delayed_chrome, getfolder(finddir, "content")); registerchrome(install.skin | install.delayed_chrome, getfolder(finddir, "skin")); registerchrome(install.
locale | install.delayed_chrome, getfolder(finddir, "
locale")); the delayed_chrome flag is used to indicate that the chrome should be installed the next time mozilla is run.
...d files component is shown below: source initinstall("find files","/xulplanet/find files","0.5.0.0"); finddir = getfolder("chrome","findfile"); setpackagefolder(finddir); adddirectory("findfile"); registerchrome(install.content | install.delayed_chrome, getfolder(finddir, "content")); registerchrome(install.skin | install.delayed_chrome, getfolder(finddir, "skin")); registerchrome(install.
locale | install.delayed_chrome, getfolder(finddir, "
locale")); performinstall(); next, we'll look at some additional install functions.
XULRunner tips - Archive of obsolete content
ager-extensions"); pref("extensions.update.enabled", true); pref("extensions.update.interval", 86400); pref("extensions.dss.enabled", false); pref("extensions.dss.switchpending", false); pref("extensions.ignoremtimechanges", false); pref("extensions.logging.enabled", false); pref("general.skins.selectedskin", "classic/1.0"); // nb these point at amo pref("extensions.update.url", "chrome://mozapps/
locale/extensions/extensions.properties"); pref("extensions.getmoreextensionsurl", "chrome://mozapps/
locale/extensions/extensions.properties"); pref("extensions.getmorethemesurl", "chrome://mozapps/
locale/extensions/extensions.properties"); if your application is based on gecko 2.0, you need to register a component through the new component registration because the extension manager uses fuel, namely ...
...the package copy the following files: chrome/inspector.jar to the chrome directory of your xulrunner application components/inspector-cmdline.js to your components directory defaults/preferences/inspector.js to your preferences directory open your chrome.manifest file and add these lines: content inspector jar:inspector.jar!/content/inspector/ xpcnativewrappers=no
locale inspector en-us jar:inspector.jar!/
locale/inspector/ skin inspector modern/1.0 jar:inspector.jar!/skin/modern/inspector/ skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/ overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/viewers/dom/popupoverlay.xul overlay chrome://inspector/content/commandoverla...
...some xulrunner components (in particular, the extension manager) depend on branding, in the sense that they expect to find certain strings in chrome://branding/
locale/brand.dtd and chrome://branding/
locale/brand.properties.
... in order to satisfy these dependencies, you can save firefox's brand.dtd/brand.properties to chrome/
locale/branding folder, modify them appropriately, and register a
locale provider for branding by adding the following line to your chrome manifest:
locale branding en-us chrome/
locale/branding/ the location you put the branding files in doesn't matter, as long as you register it appropriately in the manifest.
Index
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 script and library similar to compare-
locales.
...you also need to determine if a localization effort already exists for your
locale.
...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.
Localizing XLIFF files for iOS
enter the command git clone https://github.com/mozilla-l10n/firefoxios-l10n/your-
locale-code/ you should now see the firefox-ios project in your selected directoy with the firefox-ios.xliff file in it.
... in the <file> tag, add the target-language attribute with your
locale code as the value (e.g., target-language="xx-xx").
...each <file> tag requires the target-language attribute with your
locale code as the value (e.g., target-language="xx-xx").
... commiting your xliff file using this command, commit your translated xliff file into your
locale's directory: git commit -m "commit message here" .
Localizing with Mercurial
cloning and updating repositories there are a couple of repostiories that contain en-us source files that most
locales will want to deal with.
...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 from mozilla-central and apply those changes in your working copy.
...to do this, update your
locale, as per the section above.
... to push to mozilla-hosted repositories, you have to have committer access, and you must edit the file (your-local-hg-root aka the directory you pulled your
locale into)/.hg/hgrc (note, this is not your ~/.hgrc) to add these lines (replacing ab-cd with your
locale code): [paths] default = https://hg.mozilla.org/l10n-central/ab-cd/ default-push = ssh://hg.mozilla.org/l10n-central/ab-cd/ you’ll also need to tell ssh which account to use for your pushes, too, by editing ~/.ssh/config and adding these lines, where user@host.domain is your account: hos...
nsIAccessibleText
getselectionbounds() void getselectionbounds( in long selectionnum, out long startoffset, out long endoffset ); parameters selectionnum startoffset endoffset gettext() string methods may need to return multibyte-encoded strings, since some
locales can not be encoded using 16-bit chars.
...astring gettext( in long startoffset, in long endoffset ); parameters startoffset endoffset return value gettextafteroffset() string methods may need to return multibyte-encoded strings, since some
locales can't be encoded using 16-bit chars.
...astring gettextafteroffset( in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset ); parameters offset boundarytype startoffset endoffset return value gettextatoffset() string methods may need to return multibyte-encoded strings, since some
locales can't be encoded using 16-bit chars.
... return value exceptions thrown missing exception gettextbeforeoffset() string methods may need to return multibyte-encoded strings, since some
locales can't be encoded using 16-bit chars.
<input type="time"> - HTML: Hypertext Markup Language
appearance chrome and opera in chrome/opera the time control is simple, with slots to enter hours and minutes in 12 or 24-hour format depending on operating system
locale, and up and down arrows to increment and decrement the currently selected component.
...it also uses a 12- or 24-hour format for inputting times, based on system
locale.
...it, like chrome, uses a 12- or 24-hour format for inputting times, based on system
locale: 12-hour 24-hour value a domstring representing a time, or empty.
... you can also get and set the date value in javascript using the htmlinputelement.value property, for example: var timecontrol = document.queryselector('input[type="time"]'); timecontrol.value = '15:30'; time value format the value of the time input is always in 24-hour format that includes leading zeros: hh:mm, regardless of the input format, which is likely to be selected based on the user's
locale (or by the user agent).
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
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 parents.
...or, if none specified, use the browser's
locale.
Intl.Collator - JavaScript
static methods intl.collator.supported
localesof() returns an array containing those of the provided
locales that are supported without having to fall back to the runtime's default
locale.
... intl.collator.prototype.resolvedoptions() returns a new object with properties reflecting the
locale and collation options computed during initialization of the object.
... using
locales the results provided by collator.prototype.compare() vary between languages.
... in order to get the sort order of the language used in the user interface of your application, make sure to specify that language (and possibly some fallback languages) using the
locales argument: // in german, ä sorts with a console.log(new intl.collator('de').compare('ä', 'z')); // → a negative value // in swedish, ä sorts after z console.log(new intl.collator('sv').compare('ä', 'z')); // → a positive value using options the results provided by collator.prototype.compare() can be customized using the options argument: // in german, ä has a as the base letter console.log(new intl.collator('de', { sensitivity: 'base' }).compare('ä', 'a')); // → 0 // in swedish, ä and a are separate base letters console.log(new intl.collator('sv', { sensitivity: 'base' }).compare('ä', 'a'));...
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
the intl.datetimeformat.prototype.formattoparts() method allows
locale-aware formatting of strings produced by datetimeformat formatters.
...it returns an array of objects containing the
locale-specific tokens from which it possible to build custom strings while preserving the
locale-specific parts.
...the formattoparts method enables
locale-aware formatting of strings produced by datetimeformat formatters by providing you the string in parts: formatter.formattoparts(date); // return value: [ { type: 'weekday', value: 'monday' }, { type: 'literal', value: ', ' }, { type: 'month', value: '12' }, { type: 'literal', value: '/' }, { type: 'day', value: '17' }, { type: 'literal', value: '/'...
...' }, { type: 'literal', value: '年' }, { type: 'month', value: '十一月' }, { type: 'day', value: '4' } ] in cases where the year would be output, .format() may commonly present these side-by-side: let df = new intl.datetimeformat("zh-u-ca-chinese", {year: "numeric"}); df.format(date.utc(2012, 11, 17, 3, 0, 42)); // return value 2012壬辰年 this also makes it possible to mix
locale and calendar in both format: let df = new intl.datetimeformat("en-u-ca-chinese", {year: "numeric"}); let date = date.utc(2012, 11, 17, 3, 0, 42); df.format(date); // return value 2012(ren-chen) and formattoparts: let opts = {month: 'numeric', day: 'numeric', year: "numeric"}; let df = new intl.datetimeformat("en-u-ca-chinese", opts); let date = date.utc(2012, 11, 17, 3); df.formattoparts...
Intl.DisplayNames() constructor - JavaScript
syntax new intl.displaynames([
locales[, options]]) parameters
locales optional a string with a bcp 47 language tag, or an array of such strings.
... for the general form and interpretation of the
locales argument, see the intl page.
... options optional an object with some or all of the following properties:
localematcher the
locale matching algorithm to use.
... "code" "none" examples basic usage in basic use without specifying a
locale, a formatted string in the default
locale and with default options is returned.
Intl.ListFormat.prototype.formatToParts() - JavaScript
the intl.listformat.prototype.formattoparts() method returns an array of objects representing the different components that can be used to format a list of values in a
locale-aware fashion.
... syntax intl.listformat.prototype.formattoparts(list) parameters list an array of values to be formatted according to a
locale.
... description whereas intl.listformat.prototype.format() returns a string being the formated version of the list (according to the given
locale and style options), formattoparts() returns an array of the different components of the formated string.
... the
locale and style options used for formatting are given when constructing the intl.listformat instance.
String - JavaScript
in javascript, you just use the less-than and greater-than operators: let a = 'a' let b = 'b' if (a < b) { // true console.log(a + ' is less than ' + b) } else if (a > b) { console.log(a + ' is greater than ' + b) } else { console.log(a + ' and ' + b + ' are equal.') } a similar result can be achieved using the
localecompare() method inherited by string instances.
... string.prototype.
localecompare(comparestring [,
locales [, options]]) returns a number indicating whether the reference string comparestring comes before, after, or is equivalent to the given string in sort order.
... string.prototype.to
localelowercase( [
locale, ...
locales]) the characters within a string are converted to lowercase while respecting the current
locale.
... string.prototype.to
localeuppercase( [
locale, ...
locales]) the characters within a string are converted to uppercase while respecting the current
locale.
XUL Migration Guide - Archive of obsolete content
my-addon/ chrome/ content/
locale/ skin/ chrome.manifest data/ lib/ package.json there are limitations on what you can do in this manifest file: for example, you can't register overlays, resource: uris, or components.
... however, you can register a chrome: uri, with a skin and
locale, and this means you can include xul windows in an sdk-based add-on.
...in that directory you can keep your "content", "
locale", and "skin" subdirectories: this allows you to refer to objects in these directories from "chrome.manifest" using a relative path, like "chrome/content".
Preferences - Archive of obsolete content
it is similar to nsisupportsstring, except that when there is no user value, getcomplexvalue() gets the default value from a
locale file (thus making the default value localizable).
...you should do the following: add this line to some .properties file (for all of your
locales), say to chrome://myext/
locale/defaults.properties: extensions.myext.welcomemessage=localized default value add the default value for extensions.myext.welcomemessage, pointing to that properties file, by adding the following line to your file with default preferences (see below).
... pref("extensions.myext.welcomemessage", "chrome://myext/
locale/defaults.properties"); read the preference with getcomplexvalue, passing nsipreflocalizedstring as atype: var prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); var branch = prefs.getbranch("extensions.myext."); var value = branch.getcomplexvalue("welcomemessage", components.interfaces.nsipreflocalizedstring).data; the code in step 3 will read the default value from chrome://myext/
locale/defaults.properties when no user value is set, and will behave exactly the same as if nsisupportsstring was passed as atype otherwise.
Install.js - Archive of obsolete content
it assumes the following structure of your xpi file: sampleext.xpi chrome\ sampleext.jar content\ sampleext\
locale\ (optional) en-us\ sampleext\ ...
...nstall.js // xpiinstaller // by pike (heavily inspired by code from henrik gemal and stephen clavering) var xpiinstaller = { // --- editable items begin --- extfullname: 'sample extension', // the name displayed to the user (don't include the version) extshortname: 'sampleext', // the leafname of the jar file (without the .jar part) extversion: '1.0', extauthor: 'insert-your-name-here', ext
localenames: null, // e.g.
...install.profile_chrome : install.delayed_chrome; // register content install.registerchrome(install.content | installtype, jarpath, 'content/' + this.extshortname + '/'); // register
locales for (var
locale in this.ext
localenames) { var regpath = '
locale/' + this.ext
localenames[
locale] + '/' + this.extshortname + '/'; install.registerchrome(install.
locale | installtype, jarpath, regpath); } // register skins for (var skin in this.extskinnames) { var regpath = 'skin/' + this.extskinnames[skin] + '/' + this.extshortname + '/'; install.registerchrome(install.
registerChrome - Archive of obsolete content
skin is used to register skins,
locale is used to register language packs.
... package, a third possibility is the equivalent of skin and/or
locale, and ensures that everything in the xpi is registered.
...for example, "
locale/my
locale/aim," points to the
locale/my
locale/aim subdirectory of the same xpi file in which the installation script is located.
A XUL Bestiary - Archive of obsolete content
each package directory typically has three subdirectories, content, skin, and
locale, in which the xul, css, and localization information are defined, respectively: navigator/ content/ default/ navigator.xul ...
...
locale/ us-en/ navigator.dtd the default directory underneath each of these main package subdirectories is assumed in the chrome url (i.e.
...
locale/ us-en/ navigator.dtd to load chrome information stored in a new package directory like this, you can use the following chrome url, chrome://navigator/skin/mynewskin/newskin.css which in turn loads the graphics in that subdirectory as needed.
Introduction to XUL - Archive of obsolete content
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.
...a xul file can be made localizeable very easily by substituting entities for any content which may change as the
locale changes.
...the whole system is then configured with different
locale-specific dtds, and the correct dtd will be chosen for a given xml file at runtime, depending on the current
locale settings.
stringbundle - Archive of obsolete content
the "src" attribute accepts only absolute chrome:// urls (see bugs 133698, 26291) attributes src properties app
locale , src, stringbundle, strings methods getformattedstring, getstring examples (example needed) attributes src type: uri the uri of the property file that contains the localized strings.
...size, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties app
locale obsolete since gecko 1.9.1 type: nsi
locale returns the xpcom object which holds information about the user's
locale.
... this is an object which implements nsi
locale.
Release phase
your official release repository now that your
locale has been registered, the localization files will live on mozilla mercurial server at hg.mozilla.org.
... technical review sign-off review performed as a qa measure on a revision pushed to a new
locale's l10n aurora repo in mercurial.
... only performed on the first revision a new
locale wants to have released to the public.
Localization formats
will the content differ per
locale?
...rtl or wider display) gives the possibility to customize content per
locale simple workflow, just put the file on svn and it can appear on the staging server disadvantages to html very hard for qa if localizer changes something incorrectly (i.e.
... but, in the download day example, when changes were made to en-us, the web-developer had to push those changes to all the repositories of all the
locales.
What every Mozilla translator should know
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, on the former revision control system, cvs: cvs trunk (the default branch) -> firefox/thunderbird 3.0.x branch mozilla_1_8_branch -> firefox/thunderbird 2.0 branch mozilla cross-reference mozilla cross-reference is a web site mirroring the content of the hg server.
... bugzilla, the bug-tracking system you do need an account in bugzilla you should configure the account to watch the following addresses: firefoxl10n@hotmail.com calendar-l10n@mozilla.bugs (specific for calendar related bugs) this way you will receive mail for bugs affecting many or even all
locales.
Localization Use Cases
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.
...hared/branding/official/branding, we can define browserbrandshortname as: <browserbrandshortname{ nominative: "firefox", genitive: "firefoxa", dative: "firefoxu", accusative: "firefox", locative: "firefoxu", instrumental:"firefoxom" }> and in shared/branding/unofficial/branding, we can define browserbrandshortname as follows, to mean web browser: now, coming back to apps/browser/
locales/browser, we can take advantage of the grammatical cases.
... slovenian uses the locative case with its about preposition: <aboutbrowser "o {{ browserbrandshortname.locative }}"> for the official branding, we get: o firefoxu and for the unofficial branding, we end up with: o brskalniku genders in the system app's apps/system/
locales/system, there's a string called crash-banner-os2.
IAccessible2
tr extendedrole ); [propget] hresult extendedstates([in] long maxextendedstates, [out, size_is(,maxextendedstates), length_is(, nextendedstates)] bstr extendedstates, [out] long nextendedstates ); [propget] hresult groupposition([out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); [propget] hresult indexinparent([out] long indexinparent ); [propget] hresult
locale([out] ia2
locale locale ); [propget] hresult localizedextendedrole([out] bstr localizedextendedrole ); [propget] hresult localizedextendedstates([in] long maxlocalizedextendedstates, [out, size_is(,maxlocalizedextendedstates), length_is(, nlocalizedextendedstates)] bstr localizedextendedstates, [out] long nlocalizedextendedstates ); [propget] hresult nextendedstates([out] long nextendedstate...
...
locale() returns the ia2
locale of the accessible object.
... [propget] hresult
locale( [out] ia2
locale locale ); parameters
locale return value s_ok.
nsIDOMWindowUtils
void removesheet(in nsiuri sheeturi, in unsigned long type); void resumetimeouts(); void sendcompositionevent(in astring atype); obsolete since gecko 9 void sendcompositionevent(in astring atype, in astring adata, in astring a
locale); obsolete since gecko 38.0 void sendcontentcommandevent(in astring atype, [optional] in nsitransferable atransferable); void getclassname(in object aobj); boolean sendkeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); obsolete since gecko 15.0 boolean sendkeyevent(in astring atype, in ...
... void sendcompositionevent( in astring atype, in astring adata, in astring a
locale ); obsolete since gecko 38 parameters atype the event type: "compositionstart" or "compositionend" obsolete since gecko 36.
... a
locale the
locale value of dispatching composition event.
nsIStringBundleService
this is typically a
locale url, e.g.
... chrome://global/
locale/global.properties return value a string bundle corresponding to the properties file.
... flushbundles() flushes the string bundle cache - useful when the
locale changes or when we need to get some extra memory back.
IDBIndex - Web APIs
properties idbindex.isauto
locale read only returns a boolean indicating whether the index had a
locale value of auto specified upon its creation (see createindex()'s optionalparameters.) idbindex.
locale read only returns the
locale of the index (for example en-us, or pl) if it had a
locale value specified upon its creation (see createindex()'s optionalparameters.) idbindex.name the name of this index.
...refix: webkitchrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5isauto
locale experimentalnon-standardchrome no support noedge no support nofirefox full support 43ie no support noopera no support nosafari no support ...
...ndor prefix: webkitchrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5
locale experimentalnon-standardchrome no support noedge no support nofirefox full support 43ie no support noopera no support nosafari no support ...
IDBObjectStore.createIndex() - Web APIs
locale currently firefox-only (43+), this allows you to specify a
locale for the index.
... any sorting operations performed on the data via key ranges will then obey sorting rules of that
locale (see
locale-aware sorting.) you can specify its value in one of three ways: string: a string containing a specific
locale code, e.g.
... auto: the platform default
locale will be used (may be changed by user agent settings.) null or undefined: if no
locale is specified, normal javascript sorting will be used — not
locale-aware.
Using IndexedDB - Web APIs
locale-aware sorting mozilla has implemented the ability to perform
locale-aware sorting of indexeddb data in firefox 43+.
... this new functionality enables developers to specify a
locale when creating an index using idbobjectstore.createindex() (check out its parameters.) in such cases, when a cursor is then used to iterate through the dataset, and you want to specify
locale-aware sorting, you can use a specialized idb
localeawarekeyrange.
... idbindex has also had new properties added to it to specify if it has a
locale specified, and what it is:
locale (returns the
locale if any, or null if none is specified) and isauto
locale (returns true if the index was created with an auto
locale, meaning that the platform's default
locale is used, false otherwise.) note: this feature is currently hidden behind a flag — to enable it and experiment, go to about:config and enable dom.indexeddb.experimental.
KeyboardEvent - Web APIs
keyboardevent.
locale read only returns a domstring representing a
locale string indicating the
locale the keyboard is configured for.
... this may be the empty string if the browser or device doesn't know the keyboard's
locale.
... note: this does not describe the
locale of the data being entered.
Accept-Language - HTTP
the accept-language request http header advertises which languages the client is able to understand, and which
locale variant is preferred.
...the content of the accept-language is often out of the control of the user (like when traveling and using an internet cafe in a different country); the user may also want to visit a page in another language than the
locale of their user interface.
... syntax accept-language: <language> accept-language: * // multiple types, weighted with the quality value syntax: accept-language: fr-ch, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5 directives <language> a language tag (which is sometimes referred to as a "
locale identifier").
Inheritance and the prototype chain - JavaScript
{ constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), to
localestring: ƒ to
localestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } we can add properties to the prototype of dosomething(), as shown below.
... function dosomething(){} dosomething.prototype.foo = "bar"; console.log( dosomething.prototype ); this results in: { foo: "bar", constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), to
localestring: ƒ to
localestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } we can now use the new operator to create an instance of dosomething() based on this prototype.
...instancing ); this results in an output similar to the following: { prop: "some value", __proto__: { foo: "bar", constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), to
localestring: ƒ to
localestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } } as seen above, the __proto__ of dosomeinstancing is dosomething.prototype.
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
warning: string.endswith is deprecated; use string.prototype.endswith instead warning: string.includes is deprecated; use string.prototype.includes instead warning: string.indexof is deprecated; use string.prototype.indexof instead warning: string.lastindexof is deprecated; use string.prototype.lastindexof instead warning: string.
localecompare is deprecated; use string.prototype.
localecompare instead warning: string.match is deprecated; use string.prototype.match instead warning: string.normalize is deprecated; use string.prototype.normalize instead warning: string.replace is deprecated; use string.prototype.replace instead warning: string.search is d...
...rning: string.split is deprecated; use string.prototype.split instead warning: string.startswith is deprecated; use string.prototype.startswith instead warning: string.substr is deprecated; use string.prototype.substr instead warning: string.substring is deprecated; use string.prototype.substring instead warning: string.to
localelowercase is deprecated; use string.prototype.to
localelowercase instead warning: string.to
localeuppercase is deprecated; use string.prototype.to
localeuppercase instead warning: string.tolowercase is deprecated; use string.prototype.tolowercase instead warning: string.touppercase is deprecated; use string.prototype.touppercase instead warning: string.trim is dep...
...he // getownpropertynames() method is non-shimable: // object.getownpropertynames(string).filter(function(methodname) { // return typeof string[methodname] === 'function'; // }); methods = [ 'contains', 'substring', 'tolowercase', 'touppercase', 'charat', 'charcodeat', 'indexof', 'lastindexof', 'startswith', 'endswith', 'trim', 'trimleft', 'trimright', 'to
localelowercase', 'normalize', 'to
localeuppercase', '
localecompare', 'match', 'search', 'slice', 'replace', 'split', 'substr', 'concat', '
localecompare' ], methodcount = methods.length, assignstringgeneric = function(methodname) { var method = string.prototype[methodname]; string[methodname] = function(arg1) { return method.apply(arg1, array.prototype.slice.ca...
Intl.ListFormat() constructor - JavaScript
syntax new intl.listformat([
locales[, options]]) parameters
locales optional.
...for the general form and interpretation of the
locales argument, see the intl page.
...an object with some or all of the following properties:
localematcher the
locale matching algorithm to use.
Intl.NumberFormat.prototype.formatToParts() - JavaScript
the intl.numberformat.prototype.formattoparts() method allows
locale-aware formatting of strings produced by numberformat formatters.
...it returns an array of objects containing the
locale-specific tokens from which it possible to build custom strings while preserving the
locale-specific parts.
...the formattoparts method enables
locale-aware formatting of strings produced by numberformat formatters by providing you the string in parts: formatter.formattoparts(number); // return value: [ { type: "integer", value: "3" }, { type: "group", value: "." }, { type: "integer", value: "500" }, { type: "decimal", value: "," }, { type: "fraction", value: "00" }, { type: "literal", value: " " }, { type: "curr...
preferences/service - Archive of obsolete content
example: var prefs = require("sdk/preferences/service"); var name = "general.useragent.
locale"; prefs.get(name); // is equal to "chrome://global/
locale/intl.properties" prefs.getlocalized(name) // is equal to "en-us" setlocalized(name, value) sets the localized application preference name to value.
... value : string preference value, a url to a properties file example: require("sdk/preferences/service").set("general.useragent.
locale", "chrome://global/
locale/intl.properties"); example: setting global preferences var { get, set } = require("sdk/preferences/service"); var { when: unload } = require("sdk/system/unload"); var oldvalue = get("browser.urlbar.autofill"); set("browser.urlbar.autofill", true); // by amo policy global preferences must be changed back to their original value unload(function() { set("browser.urlbar.autofill", oldvalue); }); ...
jpmignore - Archive of obsolete content
for example: .* * !/data/** !/lib/** !/
locale/** !/node_modules/** !/package.json !/icon.png !/icon64.png !/copying !/bootstrap.js !/install.rdf this would include all editor backup files and similar in the whitelisted subdirectories, to avoid that you can append another blacklist after the whitelist.
... this one would work for xemacs: .* * !/data/** !/lib/** !/
locale/** !/node_modules/** !/package.json !/icon.png !/icon64.png !/copying !/bootstrap.js !/install.rdf *~ \#* ...
File I/O - Archive of obsolete content
profdef d the profile defaults of the "current"
locale.
... profdefnoloc d %installation%/defaults/profile - the profile defaults of the "default" installed
locale.
Miscellaneous - Archive of obsolete content
these properties can be accessed from javascript in the following manner: var common = { _bundle: components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/
locale/myext.properties"), getlocalizedmessage: function(msg) { return this._bundle.getstringfromname(msg); } }; alert(common.getlocalizedmessage("invalid.url")) another similar alternative (using both getstringfromname and formatstringfromname), is: var fcbundle = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfa...
...ces.nsistringbundleservice) .createbundle("chrome://myext/
locale/myext.properties"); function getstr(msg, args){ //get localised message if (args){ args = array.prototype.slice.call(arguments, 1); return fcbundle.formatstringfromname(msg,args,args.length); } else { return fcbundle.getstringfromname(msg); } } /* usage */ alert(getstr("invalid.url", "http://bad/url/", "3")); //for message with parameters alert(getstr("invalid.url")); //for message without parameters getting postdata of a webpage first, you need to get the browser you want, and its historysession.
The Box Model - Archive of obsolete content
never cut text lines into separate
locale strings in order to bypass wrapping difficulties.
...one possibility is to use special markup in a
locale property so that the link can be easily recognized: xulschoolhello.linkedtext.label = go to <a>our site</a> for more information the syntax is similar to html because it's easier to read this way, but string bundles won't do anything special with it.
Index of archived content - Archive of obsolete content
andline components creating xulrunner apps with the mozilla build system creating a windows inno setup installer for xulrunner applications custom app bundles for mac os x debugging a xulrunner application deploying xulrunner dialogs in xulrunner getting started with xulrunner how to enable
locale switching in a xulrunner application macfaq make your xulrunner app match the system
locale opening a link in the default browser specifying startup chrome window using crash reporting in a xulrunner application using ldap xpcom with xulrunner using soap in xulrunner 1.9 what xulrunner provides ...
...ternals tamarin tracing build documentation the basics of web services themes building a theme common firefox theme issues and solutions creating a skin for firefox uuid contents.rdf install.rdf making sure your theme works with rtl
locales theme changes in firefox 2 theme changes in firefox 3 theme changes in firefox 3.5 theme changes in firefox 4 updating an extension to support multiple mozilla applications using firebug and jquery (screencast) using io timeout and interrupt on nt using ssh to connect to cvs using web sta...
Makefile.mozextension.2 - Archive of obsolete content
either remove (clean it), or choose individual targets to build."; exit 1; } @echo $(mkdir) $(project) $(mkdir) $(project)/content $(project)/
locale $(project)/
locale/en-us $(project)/components/ $(project)/defaults/ $(project)/defaults/preferences/ $(project)/
locale/de-de $(project)/skin make_xpi: $(mkdir) $(project)/chrome && \ cd $(project) && \ $(zipprog) -r chrome/$(project).jar content
locale skin && \ $(zipprog) -r $(project).xpi chrome.manifest install.rdf components defaults chrome && cd ..
...real_install: $(cp) chrome/$(project).jar ~/.mozilla/default/32p27fdr.slt/chrome/ #################################### ###### define chrome_manifest content $(project) content/ overlay chrome://browser/content/browser.xul chrome://$(project)/content/overlay.xul
locale $(project) en-us
locale/ skin $(project) classic/1.0 skin/ style chrome://global/content/customizetoolbar.xul chrome://$(project)/skin/overlay.css endef export chrome_manifest chrome.manifest: @echo generating $(project)/chrome.manifest @echo "$$chrome_manifest" > $(project)/chrome.manifest ###### #firefox {ec8030f7-c20a-464f-9b0e-13a3a9e97384} #thunderbird {3550f703-e582-4d05-9a08-453d09...
crop - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
resizer.dir - Archive of obsolete content
bottomstart resized down and toward the start of the line (toward the left for left-to-right
locales, toward the right for right-to-left
locales).
... bottomend resized down and toward the end of the line (toward the right for left-to-right
locales, toward the left for right-to-left
locales).
Positioning - Archive of obsolete content
however, the submenu will appear to the left instead for right to left
locales.
... for popups attached using the popup or context attributes, the default position to appear is with the upper left corner (or upper right corner in right to left
locales) at the position where the mouse was clicked.
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
s:chrome="http://www.mozilla.org/rdf/chrome#"> <rdf:seq rdf:about="urn:mozilla:package:root"> <rdf:li rdf:resource="urn:mozilla:package:custombutton"/> </rdf:seq> <rdf:description rdf:about="urn:mozilla:package:custombutton" chrome:displayname="custom button" chrome:description="my custom toolbar button" chrome:author="my name" chrome:name="custombutton" chrome:
localeversion="1.8" chrome:skinversion="1.5" chrome:extension="true"/> <rdf:seq about="urn:mozilla:overlays"> <!-- browser --> <rdf:li> <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- address book --> <rdf:li> <rdf:seq about="chrome://messenger/content...
... xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <rdf:seq rdf:about="urn:mozilla:package:root"> <rdf:li rdf:resource="urn:mozilla:package:myapp"/> </rdf:seq> <rdf:description rdf:about="urn:mozilla:package:myapp" chrome:displayname="myapp" chrome:description="my first xul app" chrome:author="yours truly" chrome:name="myapp" chrome:
localeversion="1.8" chrome:skinversion="1.5" chrome:extension="true"/> </rdf:rdf> replace the fields in bold with your xul file name and change the displayname, description, and author attributes as suits you.
Accesskey display rules - Archive of obsolete content
always appends accesskey text the basic rules are enough for western
locales.
... however, in some
locales, e.g., japanese localized build, its most ui labels don't have alphabets but alphabets are used to accesskey.
Property Files - Archive of obsolete content
the element has a number of functions which can be used to get strings from the property file and get other
locale information.
...use a chrome url to read a file from the
locale: <stringbundleset id="stringbundleset"> <stringbundle id="strings" src="chrome://myplugin/
locale/strings.properties"/> </stringbundleset> like other non-displayed elements, you should declare all your stringbundles inside a stringbundleset element so that they are all kept together.
Using multiple DTDs - Archive of obsolete content
single dtd to make strings in your xul file localizable, you normally add a dtd declaration at the beginning of the file like this: <!doctype window system "chrome://myextension/
locale/mainwindow.dtd"> where "window" is the local name of the document (root) element.
... assuming you have an entity called somebutton.label defined in mainwindow.dtd, you can access the entity like this: <button id="somebutton" label="&somebutton.label"> multiple dtds if you want to use multiple dtds with your xul file, you can simply list all of the dtds inside your dtd declaration: <!doctype window [ <!entity % commondtd system "chrome://myextensions/
locale/common.dtd"> %commondtd; <!entity % mainwindowdtd system "chrome://myextension/
locale/mainwindow.dtd"> %mainwindowdtd; ]> you can now access the entities declared in the dtds as shown above.
button - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
caption - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
checkbox - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
description - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
dialogheader - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
label - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
listcell - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
listitem - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
menu - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
menuitem - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
menulist - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
menuseparator - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
radio - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
resizer - Archive of obsolete content
bottomstart resized down and toward the start of the line (toward the left for left-to-right
locales, toward the right for right-to-left
locales).
... bottomend resized down and toward the end of the line (toward the right for left-to-right
locales, toward the left for right-to-left
locales).
<statusbarpanel> - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
tab - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
toolbarbutton - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
tooltip - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
treecol - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text
locales, and the right side in right-to-left
locales.
... end the text will be cropped on its right side in left-to-right text
locales, and the right side in right-to-left
locales.
Application Update - Archive of obsolete content
use what you need, %product%,%version%,%build_id%,%channel% for example pref("app.update.url", "https://yourserver.net/update/3/%product%/%version%/%build_id%/%build_target%/%
locale%/%channel%/%os_version%/%distribution%/%distribution_version%/update.xml"); // url user can browse to manually if for some reason all update installation // attempts fail.
... at the scheduled interval the application checks the update server for update.xml, search for the correct one using the software name, versions, build id's, channels, and other information like
locales.
Windows and menus in XULRunner - Archive of obsolete content
here is an example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/
locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> ...
... building on the simple window code, here is what xul menus and toolbars look like: <?xml version="1.0"?> <?xml-stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/
locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> <toolbox> <menubar id="menubar"> <menu id="file-menu" label="&file;"> <menupopup id="file-popup"> <menuitem label="&file.new;" oncommand="dofilenew();"/> <menuitem label="&file.open;" oncommand="dofileopen();...
2006-12-01 - Archive of obsolete content
discussions convert ooo .dic to .xpi convert ooo .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.
... from 50 to 100
locales discussion continues on finding a better tool for localization.
Archived JavaScript Reference - Archive of obsolete content
this operation leaves oldbuffer in a detached state.date.prototype.to
localeformat()the non-standard to
localeformat() method converts a date to a string using the specified formatting.
...see also the newer version of date.prototype.to
localedatestring().ecmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.for each...inthe for each...in statement iterates a specified variable over all values of object's properties.
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes no (unless it is the same one) no code example the following function creates a new date() object, extracts a time string out of it using to
localetimestring(), and then displays it in the ui.
... we then run it once per second using setinterval(), creating the effect of a digital clock that updates once per second (see this live, and also see the source): function displaytime() { let date = new date(); let time = date.to
localetimestring(); document.getelementbyid('demo').textcontent = time; } const createclock = setinterval(displaytime, 1000); pitfalls the frame rate isn't optimized for the system the animation is running on, and can be somewhat inefficient.
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
the following function creates a new date() object, extracts a time string out of it using to
localetimestring(), and then displays it in the ui.
... it then runs the function once per second using setinterval(), creating the effect of a digital clock that updates once per second (see this live, and also see the source): function displaytime() { let date = new date(); let time = date.to
localetimestring(); document.getelementbyid('demo').textcontent = time; } const createclock = setinterval(displaytime, 1000); just like settimeout(), setinterval() returns an identifying value you can use later when you need to clear the interval.
Configuring Build Options
localization mk_add_options moz_co_
locales=isocode tbd.
... ac_add_options --enable-ui-
locale=isocode tbd.
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.
... add style :: register, variants/slang, awkward, company style (branding guidelines), inconsistent style, third-party style, unidiomatic (steps to define your approach to culture-specific &
locale-specific references) ...
Patching a Localization
whenever you see gl in blue text, replace it with the
locale code for your language.
... cd ~/localization-workdir clone the localization repository for your
locale and for the version you want to patch: hg clone http://hg.mozilla.org/releases/l10n/mozilla-aurora/gl now that you have the code and your working directory, edit the dtd and properties files to make your necessary changes.
Translation phase
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.
...this is where you research and select the search plugins, content and protocol handlers, bookmarks, and links to recommended sites on the in-product pages that your
locale's users will find in their mozilla products.
Creating localizable web content
per-
locale customizations check if there are alternative links for localized pages (e.g., links to mdn, addons.mozilla.org, or other external resources, are there translated equivalents we can use).
... images check that images are not going to be a problem for the audience (cultural references, positionning, mirroring for rtl, text in images...) and spot what sizes/margins can be tweaked by css or have to be fixed for all
locales but english don't use text in icons images 1&2.
Writing localizable code
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.
...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.
Productization guide
for example, a search provider can deliver a very good quality of search results — but only in a specific country or language, and we have to take this into account when considering default search engines for a
locale.
... hence there is a need to customize the set of default web services on a per-
locale basis in order to ensure a good user experience across all
locales.
Index
315 js_get
localecallbacks jsapi reference, spidermonkey js_set
localecallbacks establishes
locale callbacks.
... 452 js_setdefault
locale jsapi reference, reference, référence(2), spidermonkey js_setdefault
locale sets the default
locale for the ecmascript internationalization api (intl.collator, intl.numberformat, intl.datetimeformat).
JSAPI reference
ents added in spidermonkey 17 js_setdestroycompartmentcallback added in spidermonkey 17 js_setcompartmentnamecallback added in spidermonkey 17 js_newcompartmentandglobalobject added in spidermonkey 1.8.1 obsolete since jsapi 16 js_entercrosscompartmentcall added in spidermonkey 1.8.1 obsolete since jsapi 18 js_leavecrosscompartmentcall added in spidermonkey 1.8.1 obsolete since jsapi 18
locale callbacks: struct js
localecallbacks js_get
localecallbacks js_set
localecallbacks
locale callback types: js
localetouppercase js
localetolowercase js
localecompare js
localetounicode scripts just running some javascript code is straightforward: class js::compileoptions added in spidermonkey 17 class js::owningcompileoptions added in spidermonkey 31 class js::readonlycompileoptions ...
...ifystandardprototype added in spidermonkey 31 js::identifystandardinstanceorprototype added in spidermonkey 31 js::identifystandardconstructor added in spidermonkey 38 date js_newdateobject added in spidermonkey 1.8.5 js_newdateobjectmsec added in spidermonkey 1.8.5 js_objectisdate added in spidermonkey 1.8.5 js_cleardatecaches added in spidermonkey 17 js_now intl api js_setdefault
locale added in spidermonkey 24 js_resetdefault
locale added in spidermonkey 24 properties these functions correspond directly to the ways scripts access object properties: js_getproperty js_getucproperty js_getpropertybyid added in spidermonkey 1.8.1 js_setproperty js_setucproperty js_setpropertybyid added in spidermonkey 1.8.1 js_hasproperty js_hasucproperty js_haspropertybyid added in s...
Index
716 nsi
locale interfaces, interfaces:scriptable, localization, xpcom, xpcom api reference, xpcom interface reference retrieves a string with the current
locale name.
... 717 nsi
localeservice interfaces, interfaces:scriptable, xpcom interface reference implemented by: @mozilla.org/intl/ns
localeservice;1.
nsICRLInfo
lastupdate
locale astring lastupdate formatted as a human readable string formatted according to the environment
locale.
... nextupdate
locale astring nextupdate formatted as a human readable string formatted according to the environment
locale.
Building a Thunderbird extension 2: extension file layout
rstext.xpi: //created in step 8 /install.rdf //created in step 3 /chrome.manifest //created in step 4 /chrome/ /content/ /content/myhelloworld.xul //created in step 5 /content/overlay.js //created in step 6 /chrome/
locale/* //building an extension# localization /chrome/skin/ /defaults/preferences/ //building an extension# defaults files the following tutorial pages will explain how to write each of these files (except
locale/ and defaults/) and package them into an xpi (zippy) file.
... you can find information about the
locale/ and defaults/ folders in the more general "building an extension" documentation.
Access StringBundle from Overlay
the most efficient way to append these strings is by attaching them to an existing stringbundleset as such: <stringbundleset id="stringbundleset"> <stringbundle src="chrome://your_extension/
locale/overlay.properties" id="your-extension-strings" /> </stringbundleset> now that your stringbundle is attached you can access it from javascript as follows: var str = document.getelementbyid("your-extension-strings"); //get the stringbundle object itself str.getstring("propertyname"); //get a string (and do something with it) alternative way let stringbundles...
...ervice = cc["@mozilla.org/intl/stringbundle;1"].getservice(ci.nsistringbundleservice); let bundle = stringbundleservice.createbundle("chrome://your_extension/
locale/overlay.properties"); let str = bundle.getstringfromname("propertyname"); see nsistringbundleservice ...
Mozilla
for example, a search provider can deliver a very good quality of search results — but only in a specific country or language, and we have to take this into account when considering default search engines for a
locale.
... hence there is a need to customize the set of default web services on a per-
locale basis in order to ensure a good user experience across all
locales.
CanvasRenderingContext2D.textAlign - Web APIs
"start" the text is aligned at the normal start of the line (left-aligned for left-to-right
locales, right-aligned for right-to-left
locales).
... "end" the text is aligned at the normal end of the line (right-aligned for left-to-right
locales, left-aligned for right-to-left
locales).
CompositionEvent.initCompositionEvent() - Web APIs
syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg, viewarg, dataarg,
localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend.
...
localearg a domstring representing the value of the
locale attribute.
installChrome - Web APIs
installchrome installs new skin or
locale packages in netscape 6 and mozilla.
... method of installtrigger object syntax int installchrome( type, url, name ) parameters the installchrome method has the following parameters: type type can be installtrigger.skin or installtrigger.
locale.
Keyboard API - Web APIs
the key value takes into account the keyboard's
locale (for example, 'en-us'), layout (for example, 'qwerty'), and modifier-key state (shift, control, etc.).
... “writing system keys” are defined in the writing system keys section of the ui events keyboardevent code values spec as the physical keys that change meaning based on the current
locale and keyboard layout.
PaymentAddress.toJSON() - Web APIs
requires the comma-delineated list in dom.payments.request.supportedregions to contain one or more of the supported 2-character iso
locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...requires the comma-delineated list in dom.payments.request.supportedregions to contain one or more of the supported 2-character iso
locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentCurrencyAmount.value - Web APIs
important note: the number given in this string is always specified using the period (".") as the decimal point, rather than the comma (","), even if the user's
locale normally uses the comma.
... for uniformity and consistency, the value is always given using the period (".") as the decimal character, regardless of the user's
locale.
<input type="date"> - HTML: Hypertext Markup Language
you can set a default value for the input with a date inside the value attribute, like so: <input type="date" value="2017-06-01"> the displayed date format will differ from the actual value — the displayed date is formatted based on the
locale of the user's browser, but the parsed value is always formatted yyyy-mm-dd.
... using date inputs date inputs sound convenient — they provide an easy interface for choosing dates, and they normalize the data format sent to the server regardless of the user's
locale.
<input type="month"> - HTML: Hypertext Markup Language
you can set a default value for the input control by including a month and year inside the value attribute, like so: <label for="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> one thing to note is that the displayed date format differs from the actual value; most user agents display the month and year in a
locale-appropriate form, based on the set
locale of the user's operating system, whereas the date value is always formatted yyyy-mm.
... using month inputs date-related inputs (including month) sound convenient at first glance; they promise an easy ui for choosing dates, and they normalize the data format sent to the server, regardless of the user's
locale.
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
<p>enter the following at the telnet command prompt: <code>set
localecho</code><br /> the telnet client should display: <tt>local echo is on</tt></p> result overriding the default font you can override the browser's default font—if the browser permits you to do so, which it isn't required to do—using css: css tt { font-family: "lucida console", "menlo", "monaco", "courier", monospace; } html <p>enter the following at the telnet comma...
...nd prompt: <code>set
localecho</code><br /> the telnet client should display: <tt>local echo is on</tt></p> result usage notes the <tt> element is, by default, rendered using the browser's default non-proportional font.
inputmode - HTML: Hypertext Markup Language
text (default value) standard input keyboard for the user's current
locale.
... decimal fractional numeric input keyboard containing the digits and decimal separator for the user's
locale (typically .
Array.prototype.sort() - JavaScript
strings with accented characters (e, é, è, a, ä, etc.), strings from languages other than english, use string.
localecompare.
... var items = ['réservé', 'premier', 'communiqué', 'café', 'adieu', 'éclair']; items.sort(function (a, b) { return a.
localecompare(b); }); // items is ['adieu', 'café', 'communiqué', 'éclair', 'premier', 'réservé'] sorting with map the comparefunction can be invoked multiple times per element within the array.
Array - JavaScript
array.prototype.to
localestring() returns a localized string representing the array and its elements.
... overrides the object.prototype.to
localestring() method.
BigInt - JavaScript
instance methods bigint.prototype.to
localestring() returns a string with a language-sensitive representation of this number.
... overrides the object.prototype.to
localestring() method.
BigInt64Array - JavaScript
bigint64array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
BigUint64Array - JavaScript
biguint64array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Date.prototype.getTimezoneOffset() - JavaScript
the gettimezoneoffset() method returns the time zone difference, in minutes, from current
locale (host system settings) to utc.
... current
locale utc-8 utc utc+3 return value 480 0 -180 the time zone offset returned is the one that applies for the date that it's called on.
Float32Array - JavaScript
float32array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Float64Array - JavaScript
float64array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Int16Array - JavaScript
int16array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Int32Array - JavaScript
int32array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Int8Array - JavaScript
int8array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Intl.DateTimeFormat.prototype.format() - JavaScript
the intl.datetimeformat.prototype.format() method formats a date according to the
locale and formatting options of this intl.datetimeformat object.
... description the format getter formats a date into a string according to the
locale and formatting options of this intl.datetimeformat object.
Intl.DateTimeFormat.prototype.formatRange() - JavaScript
the intl.datetimeformat.prototype.formatrange() formats a date range in the most concise way based on the
locale and options provided when instantiating intl.datetimeformat object.
... syntax intl.datetimeformat.prototype.formatrange(startdate, enddate) examples basic formatrange usage this method receives two dates and formats the date range in the most concise way based on the
locale and options provided when instantiating intl.datetimeformat.
Intl.DateTimeFormat.prototype.formatRangeToParts() - JavaScript
the intl.datetimeformat.prototype.formatrangetoparts() method allows
locale-specific tokens representing each part of the formatted date range produced by datetimeformat formatters.
... syntax intl.datetimeformat.prototype.formatrangetoparts(startdate, enddate) examples basic formatrangetoparts usage this method receives two dates and returns an array of objects containing the
locale-specific tokens representing each part of the formatted date range.
Intl.DisplayNames.prototype.of() - JavaScript
the of() method receives a code and returns a string based on the
locale and options provided when instantiating intl.displaynames.
... if the type is "language", code should be a languagecode ["-" scriptcode] ["-" regioncode ] *("-" variant ) subsequence of the unicode_language_id grammar in uts 35's unicode language and
locale identifiers grammar.
Intl.ListFormat - JavaScript
static methods intl.listformat.supported
localesof() returns an array containing those of the provided
locales that are supported without having to fall back to the runtime's default
locale.
... intl.listformat.prototype.formattoparts() returns an array of objects representing the different components that can be used to format a list of values in a
locale-aware fashion.
Intl.NumberFormat.prototype.format() - JavaScript
the intl.numberformat.prototype.format() method formats a number according to the
locale and formatting options of this numberformat object.
... description the format getter function formats a number into a string according to the
locale and formatting options of this numberformat object.
Intl.PluralRules.select() - JavaScript
the intl.pluralrules.prototype.select method returns a string indicating which plural rule to use for
locale-aware formatting.
... description this function selects a pluralization category according to the
locale and formatting options of a pluralrules object.
Number - JavaScript
number.prototype.to
localestring([
locales [, options]]) returns a string with a language sensitive representation of this number.
... overrides the object.prototype.to
localestring() method.
TypedArray - JavaScript
typedarray.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Uint16Array - JavaScript
uint16array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Uint32Array - JavaScript
uint32array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Uint8Array - JavaScript
uint8array.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Uint8ClampedArray - JavaScript
uint8clampedarray.prototype.to
localestring() returns a localized string representing the array and its elements.
... see also array.prototype.to
localestring().
Enhanced Extension Installation - Archive of obsolete content
the types at the time of writing include: 2 - extension 4 - theme 8 -
locale for backward compatibility the extension system will continue to assume an item is an extension by default, and a theme if the item has a <em:internalname> property, but extension and theme authors should be good citizens and upgrade their install manifests to include the type.
Extension Versioning, Update and Compatibility - Archive of obsolete content
the information page retrieved must currently be totally valid xhtml, including being delivered with the mime type application/xhtml+xml (important: see problems section) you may include %app_
locale% in your updateinfourl if you want to have
locale information included in the url -- this allows you to customize the text based on the user's
locale.
Inline options - Archive of obsolete content
here is an example of an options.xul file: <?xml version="1.0"?> <!doctype mydialog system "chrome://myaddon/
locale/mydialog.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="bool" pref="extensions.myaddon.bool" title="boolean" desc="stored as a boolean preference" /> </vbox> note that it's limited to <setting> tags.
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://global/skin/"?> <!doctype window system "chrome://testapp/
locale/testapp.dtd"> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button label="&button.1.label;"/> <button label="&button.2.label;"/> </window> listing 26: reading in external entities <!entity button.1.label "firefox"> <!entity button.2.label "thunderbird"> listing 27: testapp.dtd substituting css for attribute declarations the gecko rendering engine includ...
Adding sidebars - Archive of obsolete content
treerow> <treecell label="peter" /> <treecell label="hey, what's up?" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="john"/> <treecell label="good evening, how are you doing?" /> </treerow> </treeitem> </treechildren> </tree> the text in the rows of the tree is hardcoded because we wouldn't generally use text from
locale files.
Setting Up a Development Environment - Archive of obsolete content
adding: install.rdf (deflated 50%) adding: chrome.manifest (deflated 50%) adding: content/browseroverlay.js (deflated 42%) adding: content/browseroverlay.xul (deflated 69%) adding: skin/browseroverlay.css (stored 0%) adding:
locale/browseroverlay.dtd (deflated 52%) adding:
locale/browseroverlay.properties (stored 0%) creating xpi file.
Signing an XPI - Archive of obsolete content
/dev/fsb/build.bat /dev/fsb/install.rdf /dev/fsb/chrome.manifest /dev/fsb/chrome/ /dev/fsb/chrome/content/ /dev/fsb/chrome/
locale/ /dev/fsb/chrome/skin/ here it is with the code-signing steps included: @echo off set x=%cd% echo building %x%.xpi ...
Firefox addons developer guide - Archive of obsolete content
so there may be still some reference to the xuldev website (we want to host source code on mdc, not on xuldev), and to japanese things (like some specific
locales, which have been translated to french since non-latin characters are not well supported).
Add-ons - Archive of obsolete content
so there may be still some reference to the xuldev website (we want to host source code on mdc, not on xuldev), and to japanese things (like some specific
locales, which have been translated to french since non-latin characters are not well supported).
XUL user interfaces - Archive of obsolete content
tebox.focus(); } function showstatus(adate) { if (adate == null) { status.removeattribute("warning") status.setattribute("label", "") } else if (adate === false || isnan(adate.gettime())) { status.setattribute("warning", "true") status.setattribute("label", "date is not valid") } else { status.removeattribute("warning") status.setattribute("label", adate.to
localedatestring()) } } to see the result exactly as intended, use the default theme in your browser.
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
(rpm -i) then modified /usr/src/redhat/sources/thunderbird-mozconfig by adding: ac_add_options --enable-extensions=pref compile and install: $ rpmbuild -ba /usr/src/redhat/specs/thunderbird.spec $ rpm -uvh /usr/src/redhat/rpms/i386/thunderbird-1.0.2-1.3.3.i386.rpm after instillation, autoconfig is finally back here: $ rpm -ql thunderbird | grep autoconfig /usr/lib/thunderbird-1.0.2/chrome/
locale/autoconfig /usr/lib/thunderbird-1.0.2/components/autoconfig.xpt /usr/lib/thunderbird-1.0.2/components/libautoconfig.so /usr/lib/thunderbird-1.0.2/defaults/autoconfig /usr/lib/thunderbird-1.0.2/defaults/autoconfig/platform.js /usr/lib/thunderbird-1.0.2/defaults/autoconfig/prefcalls.js bugs reports related for the record, for old 1.0.x releases...
Monitoring downloads - Archive of obsolete content
l); cell = document.createelement('listcell'); cell.setattribute("label", (statement.getint64(1) / 1024).tofixed(1) + "kb"); // size cell.setattribute("style", "text-align:right"); row.appendchild(cell); var thedate = new date(statement.getint64(2) / 1000); // start time cell = document.createelement('listcell'); var datestr = thedate.to
localestring(); cell.setattribute("label", datestr); row.appendchild(cell); thedate = new date(statement.getint64(3)); // end time cell = document.createelement('listcell'); datestr = thedate.to
localestring(); cell.setattribute("label", datestr); row.appendchild(cell); var speed = statement.getdouble(4) / 1024.0; cell = document...
Mozilla Application Framework in Detail - Archive of obsolete content
ations the following snippet from an xpinstall installation gives you some idea about how easy it is to write cross-platform installations that use the mozilla browser: // register chrome registerchrome(package | delayed_chrome, getfolder("chrome","xmlterm.jar"), "content/xmlterm/"); registerchrome(skin | delayed_chrome, getfolder("chrome","xmlterm.jar"), "skin/modern/xmlterm/"); registerchrome(
locale | delayed_chrome, getfolder("chrome","xmlterm.jar"), "
locale/xmlterm/"); if (getlasterror() == success) performinstall(); else { alert("error detected: "+getlasterror()); cancelinstall(); } other features a resource description framework (rdf) parser with support for creating rdf graphs programmatically or by parsing files, compositing multiple sources into a single rdf graph, queryi...
When To Use ifdefs - Archive of obsolete content
the only time when they might be a problem is in cross-platform extension code and
locales: since this code is downloaded on multiple platforms, platform-specific ifdefs are generally out of the question.
Creating XPI Installer Modules - Archive of obsolete content
in the package you create in this tutorial, for example, all of the resources are located under the content/ subdirectory, but they could just as easily have been archived directly at the top--along with skin and
locale resources, if you wanted.
insertItemAt - Archive of obsolete content
tem or appends, then selects the newly created item --> <script language="javascript"> function insertitemtolist(){ var mylistbox = document.getelementbyid('mylistbox'); // create a date to get some labels and values var somedate = new date(); if(mylistbox.selectedindex == -1){ // no item was selected in list so append to the end mylistbox.appenditem( somedate.to
localetimestring(), somedate.gettime() ); var newindex = mylistbox.getrowcount() -1 }else{ // item was selected so insert at the selected item var newindex = mylistbox.selectedindex; mylistbox.insertitemat(newindex, somedate.to
localetimestring(), somedate.gettime()); } // select the newly created item mylistbox.selectedindex = newindex; } </script> <bu...
PopupEvents - Archive of obsolete content
<panel id="time-panel" onpopupshowing="this.lastchild.value = (new date()).to
localeformat('%t')"> <label value="time:"/> <label id="time"/> </panel> <toolbarbutton label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing listener.
Property - Archive of obsolete content
« xul reference accessible accessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator app
locale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi customto...
Sorting Results - Archive of obsolete content
this also has the advantage that the dates will be displayed according to the user's current
locale (meaning that the date is formatted so as to be suitable for the user's language).
The Joy of XUL - Archive of obsolete content
xul provides a clear separation among the client application definition and programmatic logic ("content" consisting of xul, xbl, and javascript), presentation ("skin" consisting of css and images), and language-specific text labels ("
locale" consisting of dtds and string bundles in .properties files).
Creating an Installer - Archive of obsolete content
our find files example for the find files dialog, we'll create a structure in the archive much like the following: install.js findfile content contents.rdf findfile.xul findfile.js skin contents.rdf findfile.css
locale contents.rdf findfile.dtd a directory has been added for each part of the package, the content, the skin and the
locale.
XUL Tutorial - Archive of obsolete content
observers document object model document object model modifying a xul interface manipulating lists box objects 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...
Using Visual Studio as your XUL IDE - Archive of obsolete content
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").
2006-09-29 - Archive of obsolete content
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.
2006-11-3 - Archive of obsolete content
discussions last check-ins on sun-calendar-event-dialog.* files last 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.
2006-11-03 - Archive of obsolete content
announcments mozilla scheduled downtime - 11/2/2006, 7pm - 11pm pdt (0300 - 0700 utc) mozilla scheduled downtime - 11/2/2006, 7pm - 11pm pdt (0300 - 0700 utc) opening l10n repository on mozilla_1_8_branch for approved check-ins opening l10n repository on mozilla_1_8_branch for approved check-ins discussion from 50 to 100
locales a discussion on how to make l10n easier and increase the number of locals with which mozilla products ship.
2006-11-17 - Archive of obsolete content
discussion from 50 to 100
locales continuation of the discussion of how to make l10n easier and increase the number of locals with which mozilla products ship.
Building a Theme - Archive of obsolete content
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.
Themes - Archive of obsolete content
building a themecommon firefox theme issues and solutionscreating a skin for firefoxuuidcontents.rdfinstall.rdfmaking sure your theme works with rtl
localestheme changes in firefox 2theme changes in firefox 3theme changes in firefox 3.5theme changes in firefox 4 ...
E4X for templating - Archive of obsolete content
createbundle('chrome://myeext/
locale/myext.properties'); if (args){ args = array.prototype.slice.call(arguments, 1); return strs.formatstringfromname(msg,args,args.length); } return strs.getstringfromname(msg); } for example, <toolbarbutton label={$s('mytoolbar.label')}/> conditionals function _if (cond, h, _else) { if (cond && cond != undefined) { // we need undefined condition for e4x retu...
MDN Web Docs Glossary: Definitions of Web-related terms
ipv4 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 exp...
Client-Server Overview - Learn web development
guage: en-us,en;q=0.8,es;q=0.6 cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; _gat=1; csrftoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _ga=ga1.2.1688886003.1471911953; ffo=true csrfmiddlewaretoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat&user-username=hamishwillee&user-fullname=hamish+willee&user-title=&user-organization=&user-location=australia&user-
locale=en-us&user-timezone=australia%2fmelbourne&user-irc_nickname=&user-interests=&user-expertise=&user-twitter_url=&user-stackoverflow_url=&user-linkedin_url=&user-mozillians_url=&user-facebook_url= the main difference is that the url doesn't have any parameters.
Learn web development
accessibility — make the web usable by everyone accessibility is the practice of making web content available to as many people as possible regardless of disability, device,
locale, or other differentiating factors.
Obsolete
creating a skin for firefox uuid contents.rdf install.rdf theme changes in firefox 2 theme changes in firefox 3 theme changes in firefox 3.5 theme changes in firefox 4 building a theme common theme issues and their solutions making sure your theme works with rtl
locales creating a skin for seamonkey 2 dom inspector inspectorwidget force rtl yet another theme tutorial ...
Adding a new word to the en-US dictionary
get into the dictionary sources directory using this command: cd extensions/spellcheck/
locales/hunspell/dictionary-sources there's a special script used for editing dictionaries.
Makefile - variables
l10nbasedir moz_chrome_multi
locale 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.
The Firefox codebase: CSS Guidelines
the rtl-aware equivalents of border-{top/bottom}-{left/right}-radius are border-{start/end}-{start/end}-radius when there is no special rtl-aware property available, use the pseudo :-moz-
locale-dir(ltr|rtl) (for xul files) or :dir(ltr|rtl) (for html files).
Reviewer Checklist
when making ui changes, be aware of the fact that strings will be different lengths in different
locales.
AddonManager
the existing add-on types are defined in xpiprovider.jsm and are, at this time, the following: extension, theme,
locale, multipackage, dictionary and experiment.
AddonType
built-in values: value category 2000
locale 4000 extension 5000 theme 6000 plugin viewtype integer the type of ui to use to display this type of add-on in the ui.
Interfacing with the Add-on Repository
nces-service;1"] .getservice(components.interfaces.nsiprefservice); var prefbranch = prefsservice.getbranch("extensions."); var recurl = ""; try { recurl = prefbranch.getcharpref("getaddons.recommended.url"); } catch(e) { recurl = ""; } if (recurl == "") { prefbranch.setcharpref("getaddons.recommended.url", "https://services.addons.mozilla.org/%
locale%/%app%/api/%api_version%/list/recommended/all/%max_results%/%os%/%version%?src=firefox"); prefsservice.savepreffile(null); } this fetches the value of the extensions.getaddons.recommended.url preference, and, if the preference doesn't exist or has no value, sets the value of the preference to the correct one for the amo site.
Services.jsm
ce downloads nsidownloadmanager download manager droppedlinkhandler nsidroppedlinkhandler dropped link handler service els nsieventlistenerservice event listener service etld nsieffectivetldservice effectivetld service focus nsifocusmanager focus manager io nsiioservice nsiioservice2 i/o service
locale nsi
localeservice
locale service logins nsiloginmanager password manager service metro nsiwinmetroutils 2 mm nsimessagebroadcaster nsiframescriptloader global frame message manager3 obs nsiobserverservice observer service perms nsipermissionmanager permission manager service ppmm nsimessagebroadcaster ...
Webapps.jsm
rs: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) popcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, a
localemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, anewapp) _getrequestchannel: function(afullpackagepath, aislocalfileins...
JavaScript code modules
pluralform.jsm supplies an easy way to get the correct plural forms for the current
locale, as well as ways to localize to a specific plural rule.
Localization sign-off reviews
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.
Localization at Mozilla
to learn how to bootstrap a new
locale for mozilla projects, please see those documents ...
Patches and pushes
note that if your team selects a local version of an already default plugin (e.g., wikipedia), the xml filename should include the
locale code (e.g., wikipedia-es).
Rhino overview
if other properties files with extensions corresponding to the current
locale exist, they will be used instead.
Mozilla Projects
compare-
locales compare-
locales is a python script that helps localizers to check their work without running firefox or another application.
Mozilla internal string guide
drag&drop) where it's necessary to call a system api with data encoded in the windows
locale-dependent legacy encoding instead of utf-16.
amIInstallTrigger
constant value description skin 1
locale 2 content 4 package 7 methods enabled() tests if installation is enabled.
nsIMsgAccountManagerExtension
an account manager extension with a "name" attribute of "devmo" and the "chromepackagename" attribute set to "extension@example.org" means, that the account manager expects to find a xul file in "chrome://extension@example.org/content/am-devmo.xul" and a property file in "chrome://extension@example.org/
locale/am-devmo.properties" containing a property named "prefpanel-devmo".
nsINavHistoryQueryOptions
this is because sorting by title requires us to sort after using
locale-sensetive sorting (as opposed to letting the database do it for us).
nsIProfile
langcode the
locale to use for the new profile.
nsIPromptService
constant value description button_title_ok 1 these flags are used to select standard labels from the user's current
locale.
nsIURLFormatter
mozilla applications linking to mozilla websites are strongly encouraged to use urls of the following format: http[s]://%service%.mozilla.[com|org]/%
locale%/ method overview astring formaturl(in astring aformat); astring formaturlpref(in astring apref); methods formaturl() formats a string url.
nsIUpdateItem
constant gecko version description 1.8 1.8.1 1.9 1.9.1 1.9.2 type_app 0x01 type_extension 0x02 type_theme 0x04 type_
locale 0x08 type_multi_xpi 0x20 type_addon type_extension + type_theme + type_
locale + type_plugin type_extension + type_theme + type_
locale type_any type_app + type_addon 0xff type_plugin 0x10 methods init() initializes the object.
XPCOM Interface Reference
ttpservernsihttpupgradelistenernsiidnservicensiiframeboxobjectnsiiniparsernsiiniparserfactorynsiiniparserwriternsiioservicensiidleservicensiinprocesscontentframemessagemanagernsiinputstreamnsiinputstreamcallbacknsiinstalllocationnsiinterfacerequestornsijscidnsijsidnsijsiidnsijsonnsijetpacknsijetpackservicensijumplistbuildernsijumplistitemnsilivemarkservicensiloadgroupnsilocalfilensilocalfilemacnsi
localensi
localeservicensilogininfonsiloginmanagernsiloginmanagercryptonsiloginmanageriemigrationhelpernsiloginmanagerprompternsiloginmanagerstoragensiloginmetainfonsimimeinputstreamnsimacdocksupportnsimarkupdocumentviewernsimemorynsimemorymultireporternsimemorymultireportercallbacknsimemoryreporternsimemoryreportermanagernsimenuboxobjectnsimessagebroadcasternsimessagelistenernsimessagelistenermanagernsi...
XPCOM Interface Reference by grouping
nsicommandline nsicommandlinehandler nsicommandlinerunner component nsicomponentmanager preferences nsicontentprefobserver nsicontentprefservice nsicomponentregistrar internationalization nsibidikeyboard nsi
locale io filesystem nsidirectoryenumerator nsidirectoryiterator nsidirectoryservice nsidirectoryserviceprovider nsidirectoryserviceprovider2 nsidirindex nsidirindexlistener nsidirindexparser nsifile nsilocalfile st...
Filter Incoming Mail
by example, setting it to lower case subject = subject.to
localelowercase(); // then we rebuild a subject objet by rencoding the string // and assign it to the message headers and we're done amsghdr.subject = mimeconvert.encodemimepartiistr_utf8(subject, false, "utf-8", 0, 72); } } }; function init() { var notificationservice = components.classes["@mozilla.org/messenger/msgnotificationservice;1"] .getservice(components.inter...
Accessibility Inspector - Firefox Developer Tools
this means trying your best to not lock anyone out of accessing information because of any disability they may have, or any other personal circumstances such as the device they are using, the speed of their network connection, or their geographic location or
locale.
DOM Inspector internals - Firefox Developer Tools
source code organization the contents of the top-level directory for the dom inspector repository should look like base/ js/ inspector-cmdline.js makefile.in build/ install.js makefile.in resources/ content/ …
locale/ … skin/ … makefile.in install.rdf jar.mn makefile.in makefiles.sh almost all the interesting stuff is in resources/content/.
DevTools API - Firefox Developer Tools
id: "inspector", icon: "chrome://browser/skin/devtools/inspector-icon.png", url: "chrome://browser/content/devtools/inspector/inspector.xul", get label() { let strings = services.strings.createbundle("chrome://browser/
locale/devtools/inspector.properties"); return strings.getstringfromname("inspector.label"); }, istargetsupported: function(target) { return !target.isremote; }, build: function(iframewindow, toolbox, node) { return new inspectorpanel(iframewindow, toolbox, node); } }); open a tool, or select it if the toolbox is already open: let target = targetfactory.fortab(gbrowser.selecte...
CompositionEvent - Web APIs
compositionevent.
locale read only returns the
locale of current input method (for example, the keyboard layout
locale if the composition is associated with ime).
Element.classList - Web APIs
nt = window.document, object = window.object, hasownprop = object.prototype.hasownproperty; var defineproperty = object.defineproperty, allowtokenlistconstruction = 0, skippropchange = 0; function domtokenlist(){ if (!allowtokenlistconstruction) throw typeerror("illegal constructor"); // internally let it through } domtokenlist.prototype.tostring = domtokenlist.prototype.to
localestring = function(){return this.value}; domtokenlist.prototype.add = function(){ a: for(var v=0, arglen=arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v!==arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("add", val); for (var i=0, len=proto.length, resstr=val; i !== len; ++i) if (this[i] === val) continue a; else r...
Element.innerHTML - Web APIs
javascript function log(msg) { var logelem = document.queryselector(".log"); var time = new date(); var timestr = time.to
localetimestring(); logelem.innerhtml += timestr + ": " + msg + "<br/>"; } log("logging mouse events inside this container..."); the log() function creates the log output by getting the current time from a date object using to
localetimestring(), and building a string with the timestamp and the message text.
HTMLFormElement.elements - Web APIs
var inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i < inputs.length; i++) { if (inputs[i].nodename === "input" && inputs[i].type === "text") { // update text input inputs[i].value.to
localeuppercase(); } } disabling form controls var inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i < inputs.length; i++) { // disable all form controls inputs[i].setattribute("disabled", ""); } specifications specification status comment html living standardthe definition of 'htmlformelement.elements' in that spec...
HTMLInputElement - Web APIs
possible values are: forward if selection was performed in the start-to-end direction of the current
locale backward for the opposite direction none if the direction is unknown size unsigned long: returns / sets the element's size attribute, containing visual size of the control.
HTMLTextAreaElement - Web APIs
this is "forward" if selection was performed in the start-to-end direction of the current
locale, or "backward" for the opposite direction.
Basic concepts - Web APIs
note, however, that
locale-aware sorting has been allowed with an experimental flag enabled (currently for firefox only) since firefox 43.
IndexedDB API - Web APIs
idb
localeawarekeyrange defines a key range that can be used to retrieve data from a database in a certain range, sorted according to the rules of the
locale specified for a certain index (see createindex()'s optionalparameters.).
KeyboardEvent.key - Web APIs
the keyboardevent interface's key read-only property returns the value of the key pressed by the user, taking into consideration the state of modifier keys such as shift as well as the keyboard
locale and layout.
NDEFRecord.lang - Web APIs
the record might be missing a language tag, for example, if the recorded information is not
locale-specific.
PaymentCurrencyAmount - Web APIs
this string must only contain an optional leading "-" to indicate a negative value, then one or more digits from 0 to 9, and an optional decimal point (".", regardless of
locale) followed by at least one more digit.
Writing WebSocket client applications - Web APIs
d types of data packets the client might receive, such as: login handshake message text user list updates the code that interprets these incoming messages might look like this: examplesocket.onmessage = function(event) { var f = document.getelementbyid("chatbox").contentdocument; var text = ""; var msg = json.parse(event.data); var time = new date(msg.date); var timestr = time.to
localetimestring(); switch(msg.type) { case "id": clientid = msg.id; setusername(); break; case "username": text = "<b>user <em>" + msg.name + "</em> signed in at " + timestr + "</b><br>"; break; case "message": text = "(" + timestr + ") <b>" + msg.name + "</b>: " + msg.text + "<br>"; break; case "rejectusername": text = "<b>your usernam...
Using XMLHttpRequest - Web APIs
*/ ifhaschanged("yourpage.html", function (nmodif, nvisit) { console.log("the page '" + this.filepath + "' has been changed on " + (new date(nmodif)).to
localestring() + "!"); }); if you want to know if the current page has changed, please read the article about document.lastmodified.
Web APIs
t htmltimeelement htmltitleelement htmltrackelement htmlulistelement htmlunknownelement htmlvideoelement hashchangeevent headers history hkdfparams hmacimportparams hmackeygenparams i idbcursor idbcursorsync idbcursorwithvalue idbdatabase idbdatabaseexception idbdatabasesync idbenvironment idbenvironmentsync idbfactory idbfactorysync idbindex idbindexsync idbkeyrange idb
localeawarekeyrange idbmutablefile idbobjectstore idbobjectstoresync idbopendbrequest idbrequest idbtransaction idbtransactionsync idbversionchangeevent idbversionchangerequest iirfilternode idledeadline imagebitmap imagebitmaprenderingcontext imagecapture imagedata index inputdevicecapabilities inputevent installevent installtrigger intersectionobserver intersectionobserverentry inter...
Mozilla CSS extensions - CSS: Cascading Style Sheets
:-moz-broken ::-moz-canvas ::-moz-color-swatch ::-moz-cell-content :-moz-drag-over f – i :-moz-first-node ::-moz-focus-inner ::-moz-focus-outer :-moz-focusring :-moz-full-screen :-moz-full-screen-ancestor :-moz-handler-blocked :-moz-handler-crashed :-moz-handler-disabled ::-moz-inline-table l :-moz-last-node :-moz-list-bullet :-moz-list-number :-moz-loading :-moz-
locale-dir(ltr) :-moz-
locale-dir(rtl) :-moz-lwtheme :-moz-lwtheme-brighttext :-moz-lwtheme-darktext n – r :-moz-native-anonymous :-moz-only-whitespace ::-moz-page ::-moz-page-sequence ::-moz-pagebreak ::-moz-pagecontent :-moz-placeholderobsolete since gecko 51 ::-moz-placeholderdeprecated since gecko 51 ::-moz-progress-bar ::-moz-range-progress ::-moz-range-thumb ::-moz-range-tra...
WebKit CSS extensions - CSS: Cascading Style Sheets
sion -webkit-cursor-visibility d-i -webkit-dashboard-region -webkit-font-size-delta -webkit-font-smoothing -webkit-highlight -webkit-hyphenate-character -webkit-hyphenate-limit-after -webkit-hyphenate-limit-before -webkit-hyphenate-limit-lines -webkit-initial-letter l -webkit-line-align -webkit-line-box-contain -webkit-line-clamp -webkit-line-grid -webkit-line-snap -webkit-
locale -webkit-logical-height -webkit-logical-width m -webkit-margin-after-collapse -webkit-margin-after -webkit-margin-before-collapse -webkit-margin-before -webkit-margin-bottom-collapse -webkit-margin-collapse -webkit-margin-end** -webkit-margin-start** -webkit-margin-top-collapse -webkit-marquee-direction -webkit-marquee-increment -webkit-marquee-repetition -webkit-marquee-speed ...
<input type="week"> - HTML: Hypertext Markup Language
using week inputs week inputs sound convenient at first glance, since they provide an easy ui for choosing weeks, and they normalize the data format sent to the server, regardless of the user's browser or
locale.
Resource URLs - HTTP
furthermore, some default values of preferences differ between build configurations, such as platform and
locale, which means web sites could identify individual users using this information.
Content negotiation - HTTP
traditionally, it was set to a different value for each
locale for the browser, like iso-8859-1,utf-8;q=0.7,*;q=0.7 for a western european
locale.
Index - HTTP
5 accept-language content negotiation, http, http header, reference, request header the accept-language request http header advertises which languages the client is able to understand, and which
locale variant is preferred.
HTTP Index - HTTP
52 accept-language accept-language, content negotiation, http, http header, reference, request header the accept-language request http header advertises which languages the client is able to understand, and which
locale variant is preferred.
JavaScript error reference - JavaScript
r: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.to
localeformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning: unreachable code after return statement ...
Object.entries() - JavaScript
if there is a need for certain ordering, then the array should be sorted first, like object.entries(obj).sort((a, b) => b[0].
localecompare(a[0]));.
Object.keys() - JavaScript
onments that do not natively support it, copy the following snippet: // from /docs/web/javascript/reference/global_objects/object/keys if (!object.keys) { object.keys = (function() { 'use strict'; var hasownproperty = object.prototype.hasownproperty, hasdontenumbug = !({ tostring: null }).propertyisenumerable('tostring'), dontenums = [ 'tostring', 'to
localestring', 'valueof', 'hasownproperty', 'isprototypeof', 'propertyisenumerable', 'constructor' ], dontenumslength = dontenums.length; return function(obj) { if (typeof obj !== 'function' && (typeof obj !== 'object' || obj === null)) { throw new typeerror('object.keys called on non-object'); } var result...