Patch Changes
-
fix: The parameter config of loadCard needs to add updateData, otherwise some event binding will fail when enableJSDataProcessor is turned on. (#1077)
-
feat: add
_I18nResourceTranslation
api in mts &&init-i18n-resources
attr,i18nResourceMissed
event of lynx-view. (#1065)init-i18n-resource
is the complete set of i18nResources that need to be maintained on the container side. Note: You need to pass this value when lynx-view is initialized.You can use
_I18nResourceTranslation
in MTS to get the corresponding i18nResource frominit-i18n-resources
. If it is undefined, thei18nResourceMissed
event will be dispatched.// ui thread lynxView.initI18nResources = [ { options: { locale: 'en', channel: '1', fallback_url: '', }, resource: { hello: 'hello', lynx: 'lynx web platform1', }, }, ]; lynxView.addEventListener('i18nResourceMissed', (e) => { console.log(e); }); // mts _I18nResourceTranslation({ locale: 'en', channel: '1', fallback_url: '', });
-
feat: supports
lynx.getI18nResource()
andonI18nResourceReady
event in bts. (#1088)lynx.getI18nResource()
can be used to get i18nResource in bts, it has two data sources:- the result of
_I18nResourceTranslation()
- lynx-view
updateI18nResources(data: InitI18nResources, options: I18nResourceTranslationOptions)
, it will be matched to the correct i8nResource as a result oflynx.getI18nResource()
- the result of
onI18nResourceReady
event can be used to listen_I18nResourceTranslation
and lynx-viewupdateI18nResources
execution.
-
feat: add
updateI18nResources
method of lynx-view. (#1085)Now you can use
updateI18nResources
to update i18nResources, and then use _I18nResourceTranslation() to get the updated result. -
Updated dependencies [
25a04c9
,0dbb8b1
,f99de1e
,873a285
,afacb2c
,1861cbe
]:- @lynx-js/web-mainthread-apis@0.14.0
- @lynx-js/web-constants@0.14.0
- @lynx-js/offscreen-document@0.1.2
- @lynx-js/web-worker-rpc@0.14.0