fluent icon indicating copy to clipboard operation
fluent copied to clipboard

only use selected attributes

Open 117649 opened this issue 5 years ago • 3 comments

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?

117649 avatar Nov 20 '20 09:11 117649

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.

macabeus avatar Nov 20 '20 10:11 macabeus

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 }

zbraniecki avatar Nov 20 '20 15:11 zbraniecki

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?

117649 avatar Nov 23 '20 01:11 117649