robisim74/qwik-speak

If/else - condition

Closed this issue · 3 comments

Hello, firstly, I would like to thank you for your contribution to the development of plugins for Qwik.
I did not find a description of the conditions in the documentation. Is it possible to support conditions?

Something like that

const message = "{isDay, select, true {Day} other {Night}}";

I assume you are reporting the feature from some other library/framework.

The syntax you propose does not make any sense relative to the current syntax of this library.

Please provide an example that can be understood by those who don't know what you want, and explain the use case.

I apologize for the bad example. I'm interested in the ability to create if/else conditions or selecting enum-based values in the translation text.
As I understand it, you are based on Intl standards, so the question is settled. Sorry for wasting your time.

It's not just a question of Intl syntax: I don't think further complicating message texts is a good thing, because they become incomprehensible to translators. While as programmers we can easily handle conditions in jsx.