tolgee-platform icon indicating copy to clipboard operation
tolgee-platform copied to clipboard

ICU select messages should be editable like plural in Web UI

Open amowu opened this issue 4 months ago • 2 comments

Is your feature request related to a problem? Please describe.

I’m currently using ICU message formatting in Tolgee, and while the plural format is well supported and easy to use in the Web UI, the select format is not as clearly displayed or editable. It’s difficult to work with select messages (e.g., for gender or status variations) because the UI doesn’t provide structured input or a visual distinction between options. This makes the editing experience error-prone and harder for translators to understand.

Describe the solution you'd like

I would love to see the Web UI support select messages in a structured way — similar to how plural messages are rendered. Ideally, each option inside the select could be displayed in its own field or block, making it easier to read, edit, and understand the logic.

Describe alternatives you've considered

Currently, I’m editing the raw ICU string manually, but this is not ideal. It’s easy to make mistakes, and translators without technical background may find it confusing or intimidating.

Additional context

Here’s an example of a select message that’s hard to manage in the UI:

{formType, select, learningMap {Submit the form to agree to provide the above information to Hahow for Business for contact, analysis, and to receive updates based on your needs. Rest assured, your information will be protected by our <0>privacy policy</0>.} other {By clicking apply for trial, you agree to provide the above information to Hahow for Business for contact and analysis, and to receive updates based on your needs. Rest assured, your information will be protected by our <0>privacy policy</0>.}}

Image

Unlike plural, this shows up as a single long string without visual separation, making it hard to scan and edit. A more visual editor would improve the usability significantly.

Image

amowu avatar Aug 18 '25 03:08 amowu

Hi! Thank you for your well-written feature request. Sorry for the delay in getting back to you.

It could be a useful feature to add, but I cannot make any promises.

It's usually better to avoid adding logic within translations because it makes them harder to maintain. It's generally clearer to include if statements in your code and select between multiple keys instead of embedding such logic directly in translation files. Because of that, I wouldn't prioritize this right now.

I'm curious, though: What's your stance on this? Would replacing ICU selects with if statements lead to a worse experience for your use case?

Anty0 avatar Sep 02 '25 16:09 Anty0

@Anty0 thank you for your response!

However, your official documentation recommends using ICU's select format: https://docs.tolgee.io/platform/translation_process/icu_message_format#selecting-value

While if could be used as an alternative, considering that we are migrating a large amount of content from i18next's context format to Tolgee's ICU select format, this would involve a considerable cost for changes. Therefore, I suggest that this could be considered for future support.

amowu avatar Sep 10 '25 03:09 amowu