Hi, while testing the CVS LyX (anoncvs, Thu Dec 21 19:04:47 2000), I noticed that some strings didn't get translated in the preferences dialog. The patch attached fixes these bugs in current LyX CVS: - Some long "tooltip" strings in the preferences dialog didn't get translated because the function "formatted" alters them before gettext is called. - Sometimes gettext is called with empty string, which returns the po-file header. - Copyright dialog also doesn't call gettext on its strings before displaying them. BTW. If I run LyX with LC_ALL and LC_NUMERIC environment variables set to "fi_FI", some of the font size settings in preferences dialog will contain a comma. And when I click the "Save" button they will be reseted to zero. If I set these environ variables to "C" before running LyX then no problems arise. Otherwise the LyX in CVS seems to work rather well. Pauli Virtanen
diff -ru lyx-orig/src/frontends/xforms/FormCopyright.C lyx/src/frontends/xforms/FormCopyright.C --- lyx-orig/src/frontends/xforms/FormCopyright.C Fri Dec 22 23:16:35 2000 +++ lyx/src/frontends/xforms/FormCopyright.C Fri Dec 22 22:59:15 2000 @@ -49,17 +49,17 @@ minh_ = form()->h; string str = N_("LyX is Copyright (C) 1995 by Matthias Ettrich, 1995-2000 LyX Team"); - str = formatted(str, dialog_->text_copyright->w-10, + str = formatted(_(str), dialog_->text_copyright->w-10, FL_NORMAL_SIZE, FL_NORMAL_STYLE); fl_set_object_label(dialog_->text_copyright, str.c_str()); str = N_("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version."); - str = formatted(str, dialog_->text_licence->w-10, + str = formatted(_(str), dialog_->text_licence->w-10, FL_NORMAL_SIZE, FL_NORMAL_STYLE); fl_set_object_label(dialog_->text_licence, str.c_str()); str = N_("LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA."); - str = formatted(str, dialog_->text_disclaimer->w-10, + str = formatted(_(str), dialog_->text_disclaimer->w-10, FL_NORMAL_SIZE, FL_NORMAL_STYLE); fl_set_object_label(dialog_->text_disclaimer, str.c_str()); diff -ru lyx-orig/src/frontends/xforms/FormPreferences.C lyx/src/frontends/xforms/FormPreferences.C --- lyx-orig/src/frontends/xforms/FormPreferences.C Fri Dec 22 23:16:35 2000 +++ lyx/src/frontends/xforms/FormPreferences.C Fri Dec 22 23:08:51 2000 @@ -342,10 +342,14 @@ str = spellchecker_.feedback(ob); } - str = formatted(str, dialog_->text_warning->w-10, - FL_SMALL_SIZE, FL_NORMAL_STYLE); + // We don't want to call gettext with empty string, because + // that returns the po-file header. + if (!str.empty()) { + str = formatted(_(str), dialog_->text_warning->w-10, + FL_SMALL_SIZE, FL_NORMAL_STYLE); + } - fl_set_object_label(dialog_->text_warning, _(str.c_str())); + fl_set_object_label(dialog_->text_warning, str.c_str()); fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE); } @@ -3006,10 +3010,10 @@ warningPosted = true; string str = N_("WARNING!") + string(" ") + warning; - str = formatted(str, dialog_->text_warning->w-10, + str = formatted(_(str), dialog_->text_warning->w-10, FL_SMALL_SIZE, FL_NORMAL_STYLE); - fl_set_object_label(dialog_->text_warning, _(str.c_str())); + fl_set_object_label(dialog_->text_warning, str.c_str()); fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE); }