{"json_modified": "2016-03-28T08:31:49.881867", "uuid": "1c3a1c5d-eafa-4bae-a51f-6dd9843b639e", "title": "L20n Javascript API", "url": "/en-US/docs/Mozilla/Projects/L20n/L20n_Javascript_API", "tags": ["L20n"], "translations": [], "modified": "2015-08-04T13:17:47", "label": "L20n Javascript API", "localization_tags": [], "locale": "en-US", "id": 87223, "last_edit": "2015-08-04T13:17:45", "summary": "When you freeze the context by calling requestLocales
, the resource files will be retrieved, parsed and compiled. You can listen to the ready
event (emitted by the Context
instance when all the resources have been compiled) and use ctx.getSync
and ctx.getEntitySync
to get translations synchronously.", "sections": [{"id": "L20n_JavaScript_API", "title": "L20n JavaScript API"}, {"id": "ctx.registerLocales(defaultLocale_String_availableLocales_Array)", "title": "ctx.registerLocales(defaultLocale: String?, availableLocales: Array?)"}, {"id": "ctx.registerLocaleNegotiator(negotiator_Function)", "title": "ctx.registerLocaleNegotiator(negotiator: Function)"}, {"id": "ctx.requestLocales(...requestedLocales_String)", "title": "ctx.requestLocales(...requestedLocales: String?)"}, {"id": "ctx.supportedLocales", "title": "ctx.supportedLocales"}, {"id": "ctx.addResource(text_String)", "title": "ctx.addResource(text: String)"}, {"id": "ctx.linkResource(uri_String)", "title": "ctx.linkResource(uri: String)"}, {"id": "ctx.linkResource(template_Function)", "title": "ctx.linkResource(template: Function)"}, {"id": "ctx.addEventListener(event_String_callback_Function)", "title": "ctx.addEventListener(event: String, callback: Function)"}, {"id": "ctx.removeEventListener(event_String_callback_Function)", "title": "ctx.removeEventListener(event: String, callback: Function)"}, {"id": "ctx.updateData(ctxdata_Object)", "title": "ctx.updateData(ctxdata: Object)"}, {"id": "ctx.getSync(id_String_ctxdata_Object)", "title": "ctx.getSync(id: String, ctxdata: Object?)"}, {"id": "ctx.getEntitySync(id_String_ctxdata_Object)", "title": "ctx.getEntitySync(id: String, ctxdata: Object?)"}, {"id": "ctx.localize(ids_Array_callback_Function)", "title": "ctx.localize(ids: Array, callback: Function)"}, {"id": "ctx.ready(callback_Function)", "title": "ctx.ready(callback: Function)"}, {"id": "Subnav", "title": "Subnav"}], "slug": "Mozilla/Projects/L20n/L20n_Javascript_API", "review_tags": []}