Can translation string parameters have fallbacks? #705
Closed
leo-mangold
started this conversation in
General
Replies: 2 comments
-
No, there are no fallbacks for parameters. $LL.preview({ title: myCoolTitle ?? $LL.titleFallback() }) Hope this helps :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Okey thats a bummer but thanks anyway
…On 24 Jul 2023 at 16:52 +0200, Hofer Ivan ***@***.***>, wrote:
No, there are no fallbacks for parameters.
You can edit your example above like this to also have translated fallbacks:
$LL.preview({ title: myCoolTitle ?? $LL.titleFallback() })
Hope this helps :)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have this in my translation:
This is great because then i can do something like
$LL.preview({title: "Session"})
.But I was wondering if there is a possibility to add a fallback to the parameters, so if I don't have a title yet I could show "Preview Document" or whatever, so my translation object would look something like this:
I know I can do
$LL.preview({title: myCoolTitle ?? "Document"})
, but that would kinda defeat the use of translations.Are there any workarounds for this?
Beta Was this translation helpful? Give feedback.
All reactions