Untranslateable strings e.g. in flooddetach #847

Open
opened 2026-10-05 04:48:23 +02:00 by adam · 5 comments
Owner
        AddCommand("Silent", t_d("[yes|no]"), t_d("blahblah: description"),
                   [=](const CString& sLine) { SilentCommand(sLine); });

If I translate [yes|no] into German, we get [Ja|Nein]. However, SilentCommand uses CString::ToBool for the conversion and thus does not accept the German words. So, my only option is to translate [yes|no] into [yes|no], but that's not really a translation.

There are also lots of other places like this. From the top of my head: Module types cannot be translated either.

``` AddCommand("Silent", t_d("[yes|no]"), t_d("blahblah: description"), [=](const CString& sLine) { SilentCommand(sLine); }); ``` If I translate `[yes|no]` into German, we get `[Ja|Nein]`. However, `SilentCommand` uses `CString::ToBool` for the conversion and thus does not accept the German words. So, my only option is to translate `[yes|no]` into `[yes|no]`, but that's not really a translation. There are also lots of other places like this. From the top of my head: Module types cannot be translated either. <!-- github-sync-id:328821227 -->
Author
Owner

I don't know what t_d does, but wouldn't it make more sense to write "[" + t_s("yes") + "|" + t_s("no") + "]" for reusability?

I don't know what t_d does, but wouldn't it make more sense to write `"[" + t_s("yes") + "|" + t_s("no") + "]"` for reusability? <!-- github-comment-id:395118390 -->
Author
Owner

t_d means "delayed translation" - the string is marked for translation
here, but is translated later during /msg *module help

No, it won't, for the same reason as psychon described:
CString("no").ToBool() != CString("Nein").ToBool()
It can make sense to describe in the description what this word "yes"
means, but I don't know how to better represent this.

2018-06-06 16:50 GMT+01:00 Jos Ahrens notifications@github.com:

I don't know what t_d does, but wouldn't it make more sense to write "["

  • t_s("yes") + "|" + t_s("no") + "]" for reusability?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/znc/znc/issues/1549#issuecomment-395118390, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAT15Jvmn290u1lKv7eOksJpA6TSm1aHks5t5_o_gaJpZM4UYDAE
.

t_d means "delayed translation" - the string is marked for translation here, but is translated later during /msg *module help No, it won't, for the same reason as psychon described: CString("no").ToBool() != CString("Nein").ToBool() It can make sense to describe in the description what this word "yes" means, but I don't know how to better represent this. 2018-06-06 16:50 GMT+01:00 Jos Ahrens <notifications@github.com>: > I don't know what t_d does, but wouldn't it make more sense to write "[" > + t_s("yes") + "|" + t_s("no") + "]" for reusability? > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/znc/znc/issues/1549#issuecomment-395118390>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AAT15Jvmn290u1lKv7eOksJpA6TSm1aHks5t5_o_gaJpZM4UYDAE> > . > <!-- github-comment-id:395131339 -->
Author
Owner

you could implement your own tobool function and have languages declare what their names for 'yes' and 'no' are.

you could implement your own tobool function and have languages declare what their names for 'yes' and 'no' are. <!-- github-comment-id:541478967 -->
Author
Owner

There could be a separate function for display vs for all uses not displayed to user, with carefully calling one or the other, or both in every case. The existing ToBool function is already our own.

Also note that in some languages there is no word for "yes", but it depends on context. Roughly speaking, the answer to "Is grass green?" would be not "Yes", but "It is".

There could be a separate function for display vs for all uses not displayed to user, with carefully calling one or the other, or both in every case. The existing ToBool function is already our own. Also note that in some languages there is no word for "yes", but it depends on context. Roughly speaking, the answer to "Is grass green?" would be not "Yes", but "It is". <!-- github-comment-id:541524720 -->
Author
Owner

i probably should have thought about that before commenting. those languages would probably end up using numbers, or the english, or you could translate "affirm" and "negate" if the language has words for that.

i probably should have thought about that before commenting. those languages would probably end up using numbers, or the english, or you could translate "affirm" and "negate" if the language has words for that. <!-- github-comment-id:541875045 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#847