From a9878d52ed6a34c5e82ab60c3a4dfe0d0568d507 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 20 Mar 2011 10:50:43 +0000 Subject: [PATCH] * LaTeXFeatures.cpp (getI18nPreamble): - do not propose translations for bultin floats (they are translated anyway) - only propose translations for floats if we have something different to the English source git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37974 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LaTeXFeatures.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 7ac0734ab6..3907632433 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -1197,26 +1197,31 @@ docstring const LaTeXFeatures::getTClassI18nPreamble(bool use_babel, bool use_po UsedFloats::const_iterator fend = usedFloats_.end(); for (; fit != fend; ++fit) { Floating const & fl = floats.getType(fit->first); + // we assume builtin floats are translated + if (fl.isPredefined()) + continue; docstring const type = from_ascii(fl.floattype()); docstring const flname = from_utf8(fl.name()); docstring name = translateIfPossible(flname, buffer().language()->code()); - if (use_polyglossia) + // only request translation if we have a real translation + // (that differs from the source) + if (use_polyglossia && flname != name) snippets.insert(getFloatI18nPreamble( type, name, from_ascii(buffer().language()->polyglossia()))); - else + else if (flname != name) snippets.insert(getFloatI18nPreamble( type, name, from_ascii(buffer().language()->babel()))); for (lang_it lit = lbeg; lit != lend; ++lit) { name = translateIfPossible(flname, (*lit)->code()); - if (use_polyglossia) + if (use_polyglossia && flname != name) snippets.insert(getFloatI18nPreamble( type, name, from_ascii((*lit)->polyglossia()))); - else + else if (flname != name) snippets.insert(getFloatI18nPreamble( type, name, from_ascii((*lit)->babel()))); -- 2.39.2