javascriptで翻訳された文字列をすばやく取得する方法はありますか?
たとえば、次のようになります。 var s = L20n.get("hello");
npm の 3.5 を使用しています。
以下は機能しません:
document.l10n.ready.then(function(context) {
document.l10n.formatValue('myItemKey').then(function(result){
console.log(result);
});
});
翻訳された値の代わりに項目キーが出力されます。