-
Notifications
You must be signed in to change notification settings - Fork 5
Place holder IDs aren't always starting from 0 #2
Description
Hi, I found a problem that is actually the opposite of a problem fixed in lingui/js-lingui. After a closer look that bug is extraction, I'm seeing an issue with compilation.
I'll look into building a simple test case, it'll take me awhile, but this really seems like a case of pouring milk into a bowl of cornflakes and getting fire as a result.
Hi, I think a fix in lingui/js-lingui#2204 likely needs to be applied to here
Line 9: import { useLingui } from "@lingui-solid/solid/macro";
Line 53: const { t } = useLingui();
Note: I think that means they're using this package/repository
placeholder={
props.channel.type === "SavedMessages"
? t`Save to your notes`
: props.channel.type === "DirectMessage"
? t`Message ${props.channel.recipient?.username}`
: t`Message ${props.channel.name}`
}Gets compiled to
get placeholder() {
return Re( () => e.channel.type === "SavedMessages")() ? t({
id: "JW8mxK"
}) : Re( () => e.channel.type === "DirectMessage")() ? t({
id: "pqr+oY",
values: {
0: e.channel.recipient?.username
}
}) : t({
id: "1BJjUw",
values: {
1: e.channel.name
}
})
},For extraction the strings are correctly extracted as "Message {0}" but for the compiled program the second translated string is being treated like "Message {1}"
$ echo -en "Message {0}\x1f" | sha256sum | perl -nle 'print pack "H*", $_' | base64 | cut -b -6
pqr+oY
$ echo -en "Message {1}\x1f" | sha256sum | perl -nle 'print pack "H*", $_' | base64 | cut -b -6
1BJjUw