mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-09 11:45:36 +00:00
Update fluent
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { FluentBundle } from '@fluent/bundle';
|
||||
import { FluentBundle, FluentResource } from '@fluent/bundle';
|
||||
|
||||
function makeBundle(locale, ftl) {
|
||||
const bundle = new FluentBundle(locale, { useIsolating: false });
|
||||
bundle.addMessages(ftl);
|
||||
bundle.addResource(new FluentResource(ftl));
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function getTranslator(locale) {
|
||||
return function(id, data) {
|
||||
for (let bundle of bundles) {
|
||||
if (bundle.hasMessage(id)) {
|
||||
return bundle.format(bundle.getMessage(id), data);
|
||||
return bundle.formatPattern(bundle.getMessage(id).value, data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user