Skip to content

Feature request: allow sharing messages and terms between bundles #503

Closed
@Demivan

Description

@Demivan

I'm working on Vue.js library for fluent.js and wanted to add functionality to split localization into multiple bundles. But I want to be able to share commonly used messages and terms across bundles. Here is simple implementation of a bundle that has this functionality:
https://github.com/Demivan/fluent-vue/blob/7cdd3932130a76b7b270c1113860fb3a3fc8c30f/packages/fluent-vue/src/extendedFluentBundle.ts
This is pretty mush all of it:

getMessage(id: string): Message | undefined {
  return this._messages.get(id) || this.parent.getMessage(id)
}

Problem with it is that child bundle cannot reference parent terms or messages because resolver does not call getMessage method but is accessing _messages directly:

const message = scope.bundle._messages.get(name);

Can something like this e07d6f7 be added so it is possible to implement this functionality?
Or maybe there is other way of sharing messages and terms?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions