Thank you very much! Best wishes, Wei-Wei Taco Hoekwater 写道:
The long answer: although you cannot make it depend on the language of the citation, you can make it change depending on an explicit language switch. This takes a bit of work, but it is better than nothing, I guess.
Here is how:
* first, edit the bibl-my file so that it contains calls to \labeltext{} instead of literal tests, for example:
\setupcite [authoryears] [andtext={ \labeltext{and} }, otherstext={ \labeltext{etal}}, .... % many more are needed, of course
you can invent wnatever you like in the argument of \labeltext, because you will define them in the next step.
* second, define all the label texts you used in the previous step for the all languages you need. Short example:
\setuplabeltext[en][etal={et al.}, and={and}] \setuplabeltext[cn][etal={等},and={和}]
* third, you now need to do a \mainlanguage switch before every \cite that does not use the main language of your paper. So assuming your paper is uses \mainlanguage[cn], then you need to create a definition like this for the english citations:
\def\encite[#1]{{\mainlanguage[en]\cite[#1]}}
and you have to use \encite[article=full] in your paper.
that takes care of the citations in the running text of your paper. For the publication list:
* first, you have to redefine one of the t-bib macros. The new definition of \lang (to be put in your setup) should become
\unprotect \def\lang#1% {\def\biblanguage{#1}% \ifcsname \??pb @lang@#1\endcsname \expanded{\mainlanguage[\getvalue{\??pb @lang@#1}]}% \expanded{\language[\getvalue{\??pb @lang@#1}]}% \fi \ignorespaces} \protect
* two, you have to a language field to each bibtex data item.
* three, you need a \setbiblanguage command for every language name that appears in your bib file. This will connect \lang arguments to context language keys.
For example:
\setbiblanguage{chinese}{cn} \setbiblanguage{english}{en}
you may need a few of those, depending on how consistent your bibtex data is.
After all of that, it will probably work, in most cases. Incidentally, one of the reasons why the bib modules doesn't do this is because all of that mucking about with \mainlanguage not very nice. Another is that a simple string replacement is usually not sufficient to have proper localization. A third reason is that many publishers want to have citation data in the language of the paper, regardless of the language of the cited publications.
For completeness' I have attached my example again, with all these points applied.
Best wishes, Taco