Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only use selected attributes #317

Open
117649 opened this issue Nov 20, 2020 · 3 comments
Open

only use selected attributes #317

117649 opened this issue Nov 20, 2020 · 3 comments

Comments

@117649
Copy link

117649 commented Nov 20, 2020

Lets say that there is 2 attributes under 1 id : .label and .acceskey and for the obvious reason I only want .label on the html element. How could this be done?

@macabeus
Copy link

Well... But why would you have an .accesskey attribute? It looks like isn't a translatable phrase, so it should not be a Fluent message.

@zbraniecki
Copy link
Collaborator

The way Fluent thinks about it is that you have two "shapes" of localization messages:

Shape 1 has label+attribute and is used to localize UI Element 1
Shape 2 has only label and is used to localize UI Element 2

Those are two different shape and hence two different messages. You can abstract out a message and use it in multiple places via references:

my-key1 = 
    .label = Foo
    .accesskey F

my-key1-title =
    .label = { my-key1.label }

@117649
Copy link
Author

117649 commented Nov 23, 2020

The way Fluent thinks about it is that you have two "shapes" of localization messages:

Shape 1 has label+attribute and is used to localize UI Element 1
Shape 2 has only label and is used to localize UI Element 2

Those are two different shape and hence two different messages. You can abstract out a message and use it in multiple places via references:

my-key1 = 
    .label = Foo
    .accesskey F

my-key1-title =
    .label = { my-key1.label }

I actually want to filter out unwanted attributes at the receive end without touch .ftl is this possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants