|
From: | Simon Albrecht |
Subject: | Re: Enhancement: automatically translate tagline |
Date: | Mon, 16 Mar 2015 12:13:31 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
Am 16.03.2015 um 10:22 schrieb David Kastrup:
Definitely. Or would a survey be useful on the relationship of “input and output language” in current use? After all, I have no idea on how many users actually change the defaults for both (i.e. use \language and define their own tagline and tocHeaderMarkup &c.).Simon Albrecht <address@hidden> writes:Thanks for elaborating, Harm. That’s some elegant coding with which I couldn’t have come up :-) Am 15.03.2015 um 19:22 schrieb Thomas Morley: [snip]\version "2.19.16" %% Please note, \language has to be declared before 'used-language' %% is done or included, (if stored elsewhere) \language "deutsch" %\language "english" %% if no tagline for a language is defined, default-english will be printed %\language "catalan" %% TODO: find better method to detect which language is actually used #(define used-language (car (find (lambda (e) (eq? (cdr e) (ly:parser-lookup parser 'pitchnames))) language-pitch-names)))I imagine that a generic solution worth being included in the code base would require this definition to be made through the \language command itself.I don't think it is a tenable solution to equate notename language with document language.
Alternative user syntax drafts: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% document-languages = #'((input-language . dutch) (output-language . english)) %% that would be the default%% output-language might be used for other things also, e.g. table of contents.
% Scenario 1: (my favourite) \language "deutsch" % sets both values to 'deutsch \language output "italiano" % sets only output-language and leaves input-language as default % two language commands would be used % in order to have different non-default settings for both % Scenario 2: \inputLanguage "catalan" \outputLanguage "english" % perhaps with \language still setting both – % or only input-language for backwards compatibility? % Shouldn’t be too difficult for convert-ly though. % mix both scenarios \language "deutsch" % sets only input-language for backward compatibility reasons \language output "espanol" % provide no command for setting both – may be easier understood then %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%On naming: perhaps input-language is too wide, because all the commands and identifiers are in English anyway. Then it would better be called notename-language.
I hope you agree that it’s worthwhile to make all these thoughts and that it would be good to have such functionality in an easy-to-use way.
Yours Simon
[Prev in Thread] | Current Thread | [Next in Thread] |