You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Request Feature: Support prefix identifier for message #624
So far it's all good. But in future, I would like to make a scope feature base on fluent file name. I was thinking it would be great if I can get fluent file name and turn it into prefix of every message. But FluentBundle doesn't seems to support it. I wonder if it's make sense (and ok) to you guys to have that feature in the lib?
Maybe an option in FluentResource would be cool:
newFluentResource('msg-id = a message ID',{namespace: 'prefix'})
The idea behind the bundle is that it can be composed of files from many sources.
In other words, a message with id foo can be provided by either file menus.ftl or common.ftl. Your request for prefixes would not work with that.
It may be useful for different models than we planned.
may I ask why we wrap a whole parse inside the FluentResource class constructor?
Intentional as well. You're not supposed to handle AST in runtime.
FluentResource was written a long time ago, when private methods didn't exist in JS. Today, moving the parsing logic to a private method would probably make sense.
FluentResource was written a long time ago, when private methods didn't exist in JS. Today, moving the parsing logic to a private method would probably make sense.
Activity
ngdangtu-vn commentedon Nov 28, 2023
Also, may I ask why we wrap a whole parse inside the
FluentResourceclass constructor? Can we use private method if we don't want it to get exposed?zbraniecki commentedon Nov 28, 2023
The idea behind the bundle is that it can be composed of files from many sources.
In other words, a message with id
foocan be provided by either filemenus.ftlorcommon.ftl. Your request for prefixes would not work with that.It may be useful for different models than we planned.
Intentional as well. You're not supposed to handle AST in runtime.
ngdangtu-vn commentedon Nov 29, 2023
Can we add prefix on FluentResource?
Ok, cool.
stasm commentedon Nov 29, 2023
FluentResourcewas written a long time ago, when private methods didn't exist in JS. Today, moving the parsing logic to a private method would probably make sense.ngdangtu-vn commentedon Nov 29, 2023
I think I can do that, if you don't mind.
stasm commentedon Nov 29, 2023
CC @eemeli, who leads the development of Fluent.
refactor(bundle): Clean up message parsing (#624)
refactor(bundle): Clean up message parsing (#624)
refactor(bundle): Clean up message parsing (#624)