mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-23 08:44:01 +00:00
Do the translation the right way.
By the way, has anyone noticed that _() returns empty if you call it on a string we don't know how to translate? Might it be better if it returned the original string? git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33925 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
808ff6650c
commit
bc6ee8d251
@ -18,6 +18,7 @@
|
|||||||
#include "buffer_funcs.h"
|
#include "buffer_funcs.h"
|
||||||
#include "Encoding.h"
|
#include "Encoding.h"
|
||||||
#include "InsetIterator.h"
|
#include "InsetIterator.h"
|
||||||
|
#include "Language.h"
|
||||||
#include "Paragraph.h"
|
#include "Paragraph.h"
|
||||||
#include "TextClass.h"
|
#include "TextClass.h"
|
||||||
#include "TocBackend.h"
|
#include "TocBackend.h"
|
||||||
@ -433,7 +434,9 @@ docstring BibTeXInfo::expandFormat(string const & format,
|
|||||||
// a translatable bit
|
// a translatable bit
|
||||||
string const val =
|
string const val =
|
||||||
buf.params().documentClass().getCiteMacro(key);
|
buf.params().documentClass().getCiteMacro(key);
|
||||||
ret += _(val);
|
docstring const trans =
|
||||||
|
translateIfPossible(from_utf8(val), buf.params().language->code());
|
||||||
|
ret += trans;
|
||||||
} else {
|
} else {
|
||||||
docstring const val = getValueForKey(key, xref);
|
docstring const val = getValueForKey(key, xref);
|
||||||
ret += val;
|
ret += val;
|
||||||
|
@ -117,6 +117,10 @@ private:
|
|||||||
/// material intended only for rich text (HTML) output should be
|
/// material intended only for rich text (HTML) output should be
|
||||||
/// wrapped in "{!" and "!}". it will be removed if richtext is
|
/// wrapped in "{!" and "!}". it will be removed if richtext is
|
||||||
/// false.
|
/// false.
|
||||||
|
/// a simple macro facility is also available. keys that look like
|
||||||
|
/// "%!key%" are substituted with their definition.
|
||||||
|
/// moreover, keys that look like "%_key%" are treated as translatable
|
||||||
|
/// so that things like "pp." and "vol." can be translated.
|
||||||
docstring expandFormat(std::string const & fmt,
|
docstring expandFormat(std::string const & fmt,
|
||||||
BibTeXInfo const * const xref,
|
BibTeXInfo const * const xref,
|
||||||
Buffer const & buf, bool richtext) const;
|
Buffer const & buf, bool richtext) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user