This release introduced a number of web-compatibility changes to accommodate older browsers.
- Bug 1117170 - Use document.createTextNode for better web compat
- Bug 942594 - Introduce a way for devs to provide 'template' shims.
(Full changelog: 1.0.1...1.0.2)
This is the first of the maintenance releases of the 1.0.x API. This API will not be compatible with 2.x and 3.x versions of L20n but will receive small updates and fixes until early 2015. See the post in tools-l10n for more information.
Detailed changes:
- Bug 942183 - Fix error when localizeNode is done quickly after requestLocales.
(Full changelog: 1.0.0rc...1.0.1)
This is the Release Candidate for 1.0.0. Below is the summary of the most important changes.
ctx.get
is nowctx.getSync
,ctx.getEntity
is nowctx.getEntitySync
,- the
maybeComplex
optimization has beed removed from strings, - all expressions are now compiled lazily,
- a subset of HTML is now allowed in translations; the
data-l10n-overlay
attribute is now obsolete, - L20n now uses Grunt to automate the build tasks,
- L20n successfully passed a security review.
Detailed changes:
- Core lib
- Bug 929909 - Rename Context::get to getSync
- Bug 918655 - Get rid of getComplexString
- Bug 921740 - Compile ComplexStrings lazily
- Bug 923547 - Delay array/objects initialization in compiler
- Bug 924071 - Resource's source is null when the resource can't be downloaded
- Bug 912469 - Use Object.keys or hasOwnProperty for safer iteration
- Bug 908777 - Allow locale negotiator to be asynchronous
- Bug 916545 - Simplify the client IO, use onreadystatechange
- Bug 913638 - Don't throw when context has no resources
- HTML bindings
- Bug 921169 - Implement secure DOM localization
- Bug 922576 - Allow reordering HTML elements in translations
- Bug 935017 - Sanitize attributes before appending the element.
- Bug 923461 - Clean up the start-up logic
- Bug 923048 - Use document.createDocumentFragment
- Bug 868852 - Support Phonegap's/iOS pseudo-absolute paths in src and href
- Bug 911715 - Support attributes with dashes in names
- Infrastructure
(Full changelog: 1.0.0b4...1.0.0rc)
Based on the previous beta feedback, this version introduces a few important API changes intended to make working with language negotiation easier:
ctx.registerLocales
now takes two arguments: the default locale for the context and a list of all available locales,ctx.requestLocales
is a new method which triggers language negotiation between the available locales, inluding the default locale (as defined viactx.registerLocales
), and the locales passed as arguments.ctx.freeze
has been removed; usectx.requestLocales
instead,ctx.supportedLocales
is a new read-only property which holds the result of the language negotiation (i.e. the current fallback chain of locales),ctx.data
property has been removed, usectx.updateData
method instead.
Additionally, the error reporting strategy has been revisited as described in the API documentation.
Detailed changes:
- Core lib
- Bug 897862 - Context::registerLocales should take the default language as the first argument (added Context::requestLocales)
- Bug 904618 - Remove Contex::freeze in favor of requestLocales
- Bug 897865 - Ctxdata should have an API for setting and unsetting values
- Bug 904207 - Add ctx.supportedLocales
- Bug 802850 - Debug, error and warning strategy
- Bug 869016 - Remove promises
- Bug 900559 - Compiler should not use a shared env object
- Bug 896997 - Implement .stop method to localize wrapper
- Bug 897026 - Locale file inclusion not working over file://
- HTML bindings
- Infrastructure
(Full changelog: 1.0.0b3...1.0.0b4)
-
Core lib
- Bug 886253 - l10n.reason may be undefined
- Bug 886051 - Add a polyfill for String.startsWith in intl.js for WebKit
- Bug 884201 - Macros should have strict arity rules
- Bug 816887 - Macros should always return a String or a Literal
- Bug 884228 - Referencing a macro (not calling it) should fail gracefully
- Bug 884734 - Missing attributes should fail gracefully
- Bug 883270 - Compiler should handle globals and ctxdata which are not strings
- Bug 883664 - Missing members of strings, hashes, globals and variables
- Bug 884229 - Detect cyclic references in indexes
- Bug 886750 - Change how HashLiterals store content
- Bug 803931 - Compiler is vulnerable to the billion laughs attack
-
Infrastructure
(Full changelog: 1.0.0b2...1.0.0b3)