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
I'm trying to use this compiler in my build process. With the demo ftl source in README.md, when trying to display the sync-dialog-title (which references another key), I get an exception ($.capitalization, can't access property capitalization of undefined). Seeing the generated ouput I feel that maybe in sync-dialog-title the call to value() should be value({}) so that the call does not throw, but not really sure.
Anyway great work, I would guess that messageformat is a more established tool, but fluent also looks promising as long as we can rely on build time tools like this one.
Thanks!
Germán
output:
import Runtime from "fluent-compiler/runtime"
const { bundle, isol, select } = Runtime("es")
const R = new Map([
["-sync-brand-name", { value: $ => [select($.capitalization, "uppercase", { uppercase: "Account Firefox", lowercase: "account Firefox" })] }],
["sync-dialog-title", { value: $ => [R.get("-sync-brand-name").value()] }],
["sync-headline-title", { value: $ => [isol(R.get("-sync-brand-name").value()), ": il modo migliore\nper avere i tuoi dati sempre con te"] }],
// Explicitly request the lowercase variant of the brand name.
["sync-signedout-account-title", { value: $ => ["Connetti il tuo ", isol(R.get("-sync-brand-name").value({ capitalization: "lowercase" }))] }],
["welcome", { value: $ => ["Hi how are you!!"] }],
])
export const resource = R
export default bundle(R)
input
-sync-brand-name = {$capitalization ->
*[uppercase] Account Firefox
[lowercase] account Firefox
}
sync-dialog-title = {-sync-brand-name}
sync-headline-title =
{-sync-brand-name}: il modo migliore
per avere i tuoi dati sempre con te
# Explicitly request the lowercase variant of the brand name.
sync-signedout-account-title =
Connetti il tuo {-sync-brand-name(capitalization: "lowercase")}
welcome =
Hi how are you!!
The text was updated successfully, but these errors were encountered:
Just calling.value({}) doesn't seem to really solve the issue here apart of silencing the error. How one could pass the correct capitalization value (uppercase/lowercase in this example) if the value used is always an empty object?
I'll dig a bit more into the compiler code to see if I can shed some light in this issue as well understand more how the compiled code with selectors is supposed to be used/generated.
Hi,
I'm trying to use this compiler in my build process. With the demo ftl source in README.md, when trying to display the
sync-dialog-title
(which references another key), I get an exception ($.capitalization, can't access property capitalization of undefined). Seeing the generated ouput I feel that maybe insync-dialog-title
the call tovalue()
should bevalue({})
so that the call does not throw, but not really sure.Anyway great work, I would guess that messageformat is a more established tool, but fluent also looks promising as long as we can rely on build time tools like this one.
Thanks!
Germán
output:
input
The text was updated successfully, but these errors were encountered: