Angus Leeming <[EMAIL PROTECTED]> writes:

| Thanks, Jean-Marc. Got it.
| 
| Am I right in saying that the important point here is "you cannot call 
| gettext() in a static initialization".
| 
| Ie,
| 
| string str = N_("some text");
| fl_set_object_label(obj, _(str));
| 
| is correct, because 
| 
| string str = _("some text")
| 
| fails to compile.

Does it?

A guideline should be _(...) as late as possible, prefferably just
before shown to the user. Otherwise use N_(...).

| This is also correct:
| 
| string const getDescription() {
|       string str = N_("some text");
|       str = _(str);
| }

no...

string str(_("some text"));

is certainly legal.

| 
| string str;
| 
| if (some choice) {
|       str = getDescription();
| }
| fl_set_object_label(obj, str);


I would actually prefere:

string str;
if (some choice) {
        str = getDescription();
}
fl_set_object(label(obj, _(str));


But I am not sure if everybody else agrees with me on that.

        Lgb

Reply via email to