diff --git a/songbook_core/data/latex/chords.sty b/songbook_core/data/latex/chords.sty index 8fa01843..d4a30c13 100644 --- a/songbook_core/data/latex/chords.sty +++ b/songbook_core/data/latex/chords.sty @@ -4,7 +4,71 @@ \newcommand*{\Sharp}{\nolinebreak\hspace{-.05em}\raisebox{.6ex}{\,\small\bf \#}} \newcommand*{\Flat}{\nolinebreak\hspace{-.05em}\raisebox{.6ex}{\,\small$\mathbf{\flat}$}} \newcommand*{\chordrule}{\mbox{\hspace{1cm}\rule[0.5cm]{15cm}{0.02cm}}\vspace{-.4cm}} -\newcommand*{\chordname}[2]{\makebox[3cm]{\raisebox{.5cm}{\large \textbf{\iflanguage{english}{#1}{#2}}}}} +\newcommand*{\chordname}[1]{\makebox[3cm]{\raisebox{.5cm}{\large \textbf{#1}}}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Multilanguage management + +\newcommand{\guitarchordsname}{ + \IfStrEq{\mainlanguage}{english}{Guitar chords}{} + \IfStrEq{\mainlanguage}{french}{Accords de guitare}{} +} +\newcommand{\ukulelechordsname}{ + \IfStrEq{\mainlanguage}{english}{Ukulele chords}{} + \IfStrEq{\mainlanguage}{french}{Accords de ukulélé}{} +} +\newcommand{\chordnameAsharp}{ + \IfStrEq{\mainlanguage}{english}{A\Sharp = B\Flat}{} + \IfStrEq{\mainlanguage}{french}{La\Sharp = Si\Flat}{} +} +\newcommand{\chordnameA}{ + \IfStrEq{\mainlanguage}{english}{A}{} + \IfStrEq{\mainlanguage}{french}{La}{} +} +\newcommand{\chordnameB}{ + \IfStrEq{\mainlanguage}{english}{B}{} + \IfStrEq{\mainlanguage}{french}{Si}{} +} +\newcommand{\chordnameCsharp}{ + \IfStrEq{\mainlanguage}{english}{C\Sharp = D\Flat}{} + \IfStrEq{\mainlanguage}{french}{Do\Sharp = Ré\Flat}{} +} +\newcommand{\chordnameC}{ + \IfStrEq{\mainlanguage}{english}{C}{} + \IfStrEq{\mainlanguage}{french}{Do}{} +} +\newcommand{\chordnameDsharp}{ + \IfStrEq{\mainlanguage}{english}{D\Sharp = E\Flat}{} + \IfStrEq{\mainlanguage}{french}{Ré\Sharp = Mi\Flat}{} +} +\newcommand{\chordnameD}{ + \IfStrEq{\mainlanguage}{english}{D}{} + \IfStrEq{\mainlanguage}{french}{Ré}{} +} +\newcommand{\chordnameE}{ + \IfStrEq{\mainlanguage}{english}{E}{} + \IfStrEq{\mainlanguage}{french}{Mi}{} +} +\newcommand{\chordnameFsharp}{ + \IfStrEq{\mainlanguage}{english}{F\Sharp = G\Flat}{} + \IfStrEq{\mainlanguage}{french}{Fa\Sharp = Sol\Flat}{} +} +\newcommand{\chordnameF}{ + \IfStrEq{\mainlanguage}{english}{F}{} + \IfStrEq{\mainlanguage}{french}{Fa}{} +} +\newcommand{\chordnameGsharp}{ + \IfStrEq{\mainlanguage}{english}{G\Sharp = A\Flat}{} + \IfStrEq{\mainlanguage}{french}{Sol\Sharp = La\Flat}{} +} +\newcommand{\chordnameG}{ + \IfStrEq{\mainlanguage}{english}{G}{} + \IfStrEq{\mainlanguage}{french}{Sol}{} +} + +% End of multilanguage management +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \newcommand{\chords}{ \begin{songs}{} @@ -16,8 +80,8 @@ \songcolumns{1} \ifguitar - \iflanguage{english}{\beginsong{Guitar chords}}{\beginsong{Accords de guitare}} - \chordname{C}{Do} + \beginsong{\guitarchordsname} + \chordname{\chordnameC} \gtab{C}{~:X32010} \gtab{C7}{~:X32310} \gtab{Cm}{3:X02210} @@ -29,7 +93,7 @@ \gtab*{C6}{~:XX2213} \chordrule - \chordname{C\Sharp = D\Flat}{Do\Sharp = Ré\Flat} + \chordname{\chordnameCsharp} \gtab{C\#}{4:X02220} \gtab{C\#7}{4:X02020} \gtab{C\#m}{4:X02210} @@ -41,7 +105,7 @@ \gtab*{C\#6}{1:X02010} \chordrule - \chordname{D}{Ré} + \chordname{\chordnameD} \gtab{D}{~:XX0232} \gtab{D7}{~:XX0212} \gtab{Dm}{~:XX0231} @@ -53,7 +117,7 @@ \gtab*{D6}{~:X00202} \chordrule - \chordname{D\Sharp = E\Flat}{Ré\Sharp = Mi\Flat} + \chordname{\chordnameDsharp} \gtab{D\#}{6:X02220} \gtab{D\#7}{6:X02020} \gtab{D\#m}{6:X02210} @@ -65,7 +129,7 @@ \gtab*{D\#6}{1:X00202} \chordrule - \chordname{E}{Mi} + \chordname{\chordnameE} \gtab{E}{~:022100} \gtab{E7}{~:020100} \gtab{Em}{~:022000} @@ -77,7 +141,7 @@ \gtab*{E6}{~:022120} \chordrule - \chordname{F}{Fa} + \chordname{\chordnameF} \gtab{F}{1:022100} \gtab{F7}{1:020100} \gtab{Fm}{1:022000} @@ -89,7 +153,7 @@ \gtab*{F6}{~:XX0211} \chordrule - \chordname{F\Sharp = G\Flat}{Fa\Sharp = Sol\Flat} + \chordname{\chordnameFsharp} \gtab{F\#}{2:022100} \gtab{F\#7}{2:020100} \gtab{F\#m}{2:022000} @@ -101,7 +165,7 @@ \gtab*{F\#6}{~:XX1322} \chordrule - \chordname{G}{Sol} + \chordname{\chordnameG} \gtab{G}{~:320003} \gtab{G7}{~:320001} \gtab{Gm}{3:022000} @@ -113,7 +177,7 @@ \gtab*{G6}{~:320000} \chordrule - \chordname{G\Sharp = A\Flat}{Sol\Sharp = La\Flat} + \chordname{\chordnameGsharp} \gtab{G\#}{4:022100} \gtab{G\#7}{4:020100} \gtab{G\#m}{4:022000} @@ -125,7 +189,7 @@ \gtab*{G\#6}{~:XX1111} \chordrule - \chordname{A}{La} + \chordname{\chordnameA} \gtab{A}{~:X02220} \gtab{A7}{~:X02020} \gtab{Am}{~:X02210} @@ -137,7 +201,7 @@ \gtab*{A6}{~:XX2222} \chordrule - \chordname{A\Sharp = B\Flat}{La\Sharp = Si\Flat} + \chordname{\chordnameAsharp} \gtab{A\#}{1:X02220} \gtab{A\#7}{1:X02020} \gtab{A\#m}{1:X02210} @@ -149,7 +213,7 @@ \gtab*{A\#6}{~:XX3333} \chordrule - \chordname{B}{Si} + \chordname{\chordnameB} \gtab{B}{2:X02220} \gtab{B7}{X21202} \gtab{Bm}{2:X02210} @@ -169,9 +233,9 @@ \fi \ifukulele - \iflanguage{english}{\beginsong{Ukulele chords}}{\beginsong{Accords de ukulélé}} + \beginsong{\ukulelechordsname} - \chordname{C}{Do} + \chordname{\chordnameC} \utab{C}{~:0003} \utab{C7}{~:0001} \utab{Cm}{~:0333} @@ -183,7 +247,7 @@ \utab*{Cdim}{2:3101} \chordrule - \chordname{C\Sharp = D\Flat}{Do\Sharp = Ré\Flat} + \chordname{\chordnameCsharp} \utab{C\#}{1:0003} \utab{C\#7}{1:0001} \utab{C\#m}{~:1104} @@ -195,7 +259,7 @@ \utab*{C\#dim}{~:0104} \chordrule - \chordname{D}{Ré} + \chordname{\chordnameD} \utab{D}{~:2220} \utab{D7}{2:0001} \utab{Dm}{~:2210} @@ -207,7 +271,7 @@ \utab*{Ddim}{1:0104} \chordrule - \chordname{D\Sharp = E\Flat}{Ré\Sharp = Mi\Flat} + \chordname{\chordnameDsharp} \utab{D\#}{1:2220} \utab{D\#7}{3:0001} \utab{D\#m}{1:2210} @@ -219,7 +283,7 @@ \utab*{D\#dim}{~:2320} \chordrule - \chordname{E}{Mi} + \chordname{\chordnameE} \utab{E}{2:2220} \utab{E7}{~:1202} \utab{Em}{~:0432} @@ -231,7 +295,7 @@ \utab*{Edim}{1:2320} \chordrule - \chordname{F}{Fa} + \chordname{\chordnameF} \utab{F}{~:2010} \utab{F7}{~:2310} \utab{Fm}{~:1013} @@ -243,7 +307,7 @@ \utab*{Fdim}{2:2320} \chordrule - \chordname{F\Sharp = G\Flat}{Fa\Sharp = Sol\Flat} + \chordname{\chordnameFsharp} \utab{F\#}{1:2010} \utab{F\#7}{1:2310} \utab{F\#m}{~:2120} @@ -255,7 +319,7 @@ \utab*{F\#dim}{~:2020} \chordrule - \chordname{G}{Sol} + \chordname{\chordnameG} \utab{G}{~:0232} \utab{G7}{~:0212} \utab{Gm}{~:0231} @@ -267,7 +331,7 @@ \utab*{Gdim}{~:0131} \chordrule - \chordname{G\Sharp = A\Flat}{Sol\Sharp = La\Flat} + \chordname{\chordnameGsharp} \utab{G\#}{3:2010} \utab{G\#7}{1:0212} \utab{G\#m}{1:0231} @@ -279,7 +343,7 @@ \utab*{G\#dim}{1:0131} \chordrule - \chordname{A}{La} + \chordname{\chordnameA} \utab{A}{~:2100} \utab{A7}{~:0100} \utab{Am}{~:2000} @@ -291,7 +355,7 @@ \utab*{Adim}{2:0131} \chordrule - \chordname{A\Sharp = B\Flat}{La\Sharp = Si\Flat} + \chordname{\chordnameAsharp} \utab{A\#}{1:2100} \utab{A\#7}{1:0100} \utab{A\#m}{1:2000} @@ -303,7 +367,7 @@ \utab*{A\#dim}{~:3101} \chordrule - \chordname{B}{Si} + \chordname{\chordnameB} \utab{B}{2:2100} \utab{B7}{2:0100} \utab{Bm}{2:2000} diff --git a/songbook_core/data/latex/crepbook.cls b/songbook_core/data/latex/crepbook.cls index 07f19783..cb9b0e1d 100644 --- a/songbook_core/data/latex/crepbook.cls +++ b/songbook_core/data/latex/crepbook.cls @@ -84,6 +84,91 @@ \fi % Start + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Multilanguage management + +\newcommand{\labelversionname}{% + \IfStrEq{\mainlanguage}{english}{version:}{}% + \IfStrEq{\mainlanguage}{french}{version :}{}% +} +\newcommand{\labeldatename}{% + \IfStrEq{\mainlanguage}{english}{date:}{}% + \IfStrEq{\mainlanguage}{french}{date :}{}% +} +\newcommand{\labelauthorname}{% + \IfStrEq{\mainlanguage}{english}{authors:}{}% + \IfStrEq{\mainlanguage}{french}{auteurs :}{}% +} +\newcommand{\labelwebname}{% + \IfStrEq{\mainlanguage}{english}{web:}{}% + \IfStrEq{\mainlanguage}{french}{web :}{}% +} +\newcommand{\labelmailname}{% + \IfStrEq{\mainlanguage}{english}{mail:}{}% + \IfStrEq{\mainlanguage}{french}{mail :}{}% +} +\newcommand{\originalsongname}{% + \IfStrEq{\mainlanguage}{english}{Original song:}{}% + \IfStrEq{\mainlanguage}{french}{Chanson originale :}{}% +} +\newcommand{\introname}{% + \IfStrEq{\mainlanguage}{english}{intro}{}% + \IfStrEq{\mainlanguage}{french}{intro}{}% +} +\newcommand{\outroname}{% + \IfStrEq{\mainlanguage}{english}{outro}{}% + \IfStrEq{\mainlanguage}{french}{outro}{}% +} +\newcommand{\bridgename}{% + \IfStrEq{\mainlanguage}{english}{bridge}{}% + \IfStrEq{\mainlanguage}{french}{pont}{}% +} +\newcommand{\chorusname}{% + \IfStrEq{\mainlanguage}{english}{chorus}{}% + \IfStrEq{\mainlanguage}{french}{refrain}{}% +} +\newcommand{\versename}{% + \IfStrEq{\mainlanguage}{english}{verse}{}% + \IfStrEq{\mainlanguage}{french}{couple}{}% +} +\newcommand{\soloname}{% + \IfStrEq{\mainlanguage}{english}{solo}{}% + \IfStrEq{\mainlanguage}{french}{solo}{}% +} +\newcommand{\patternname}{% + \IfStrEq{\mainlanguage}{english}{pattern}{}% + \IfStrEq{\mainlanguage}{french}{motif}{}% +} +\newcommand{\rythmname}{% + \IfStrEq{\mainlanguage}{english}{rythm}{}% + \IfStrEq{\mainlanguage}{french}{rythme}{}% +} +\newcommand{\transpositionname}{% + \IfStrEq{\mainlanguage}{english}{transposition:}{}% + \IfStrEq{\mainlanguage}{french}{transposition :}{}% +} +\newcommand{\songindexname}{% + \IfStrEq{\mainlanguage}{english}{Songs Index}{}% + \IfStrEq{\mainlanguage}{french}{Index des chansons}{}% +} +\newcommand{\authorindexname}{% + \IfStrEq{\mainlanguage}{english}{Authors Index}{}% + \IfStrEq{\mainlanguage}{french}{Index des auteurs}{}% +} +\newcommand{\songlistname}{% + \IfStrEq{\mainlanguage}{english}{Songs list}{}% + \IfStrEq{\mainlanguage}{french}{Liste des chansons}{}% +} +\newcommand{\chordlistname}{% + \IfStrEq{\mainlanguage}{english}{Chords list}{}% + \IfStrEq{\mainlanguage}{french}{Liste des accords}{}% +} + +% End of multilanguage management +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \def\andname{and} \def\lastandname{\unskip, and} @@ -111,29 +196,9 @@ \def\picture#1{\gdef\@picture{#1}} \def\picturecopyright#1{\gdef\@picturecopyright{#1}} \def\footer#1{\gdef\@footer{#1}} +\def\lang#1{\gdef\mainlanguage{#1}} \clearheadinfo -\newcommand{\l@belVersion}{ - \iflanguage{english}{\bf version:}{} - \iflanguage{french}{\bf version :}{} -} -\newcommand{\l@belDate}{ - \iflanguage{english}{\bf date:}{} - \iflanguage{french}{\bf date :}{} -} -\newcommand{\l@belAuthor}{ - \iflanguage{english}{\bf authors:}{} - \iflanguage{french}{\bf auteurs :}{} -} -\newcommand{\l@belWeb}{ - \iflanguage{english}{\bf web:}{} - \iflanguage{french}{\bf web :}{} -} -\newcommand{\l@belMail}{ - \iflanguage{english}{\bf mail:}{} - \iflanguage{french}{\bf mail :}{} -} - \renewcommand\maketitle{ \@maketitle @@ -171,11 +236,11 @@ \begin{flushleft} \begin{tabular}{l l} - \if!\@version!\else{\l@belVersion} & \@version \\ \fi - \if!\@date!\else{\l@belDate} & \@date \\ \fi - \if!\@author!\else{\l@belAuthor} & \@author \\ \fi - \if!\@web!\else{\l@belWeb} & \url{\@web} \\ \fi - \if!\@mail!\else{\l@belMail} & \url{\@mail} \\ \fi + \if!\@version!\else{\textbf{\labelversionname}} & \@version \\ \fi + \if!\@date!\else{\textbf{\labeldatename}} & \@date \\ \fi + \if!\@author!\else{\textbf{\labelauthorname}} & \@author \\ \fi + \if!\@web!\else{\textbf{\labelwebname}} & \url{\@web} \\ \fi + \if!\@mail!\else{\textbf{\labelmailname}} & \url{\@mail} \\ \fi \end{tabular} \end{flushleft} @@ -193,8 +258,6 @@ \thispagestyle{empty} } -\makeatletter - \newlength{\coverheight} \setlength{\coverheight}{2cm} \newlength{\coverspace} @@ -228,7 +291,7 @@ \renewcommand{\extendpostlude}{ {\footnotesize% \IfStrEq{\songoriginal}{}{}{ - \iflanguage{english}{Original song:}{Chanson originale :} + \originalsongname \songoriginal } } @@ -445,36 +508,28 @@ %% End of tabs.sty file \newcommand*{\Intro}{% - \iflanguage{english}{intro}{}% - \iflanguage{french}{intro}{}% + \introname% }% \newcommand*{\Outro}{% - \iflanguage{english}{outro}{}% - \iflanguage{french}{outro}{}% + \outroname% }% \newcommand*{\Bridge}{% - \iflanguage{english}{bridge}{}% - \iflanguage{french}{pont}{}% + \bridgename% }% \newcommand*{\Chorus}{% - \iflanguage{english}{chorus}{}% - \iflanguage{french}{refrain}{}% + \chorusname% }% \newcommand*{\Verse}{% - \iflanguage{english}{verse}{}% - \iflanguage{french}{couplet}{}% + \versename% }% \newcommand*{\Solo}{% - \iflanguage{english}{solo}{}% - \iflanguage{french}{solo}{}% + \soloname% }% \newcommand*{\Pattern}{% - \iflanguage{english}{pattern}{}% - \iflanguage{french}{motif}{}% + \patternname% }% \newcommand*{\Rythm}{% - \iflanguage{english}{rythm}{}% - \iflanguage{french}{rythme}{}% + \rythmname% }% \newcommand*{\Adlib}{% \emph{ad~lib.}% @@ -558,8 +613,7 @@ \newcommand{\transposition}[1]{% \ifnorepeatchords% \musicnote{% - \iflanguage{english}{transposition:~}{}% - \iflanguage{french}{transposition~:~}{}% + \transpositionname~ \ifthenelse{#1>0}{#1$\Uparrow$}{\removefirstch@r#1$\Downarrow$}% }% \else% diff --git a/songbook_core/data/templates/default.tex b/songbook_core/data/templates/default.tex index c9d782be..712f7f4b 100644 --- a/songbook_core/data/templates/default.tex +++ b/songbook_core/data/templates/default.tex @@ -41,14 +41,9 @@ (* endblock *) (* block index *) - (* if mainlang==english *) - \showindex{Songs Index}{titleidx} - \showindex{Authors Index}{authidx} - (* else *) - \showindex{Index des chansons}{titleidx} - \showindex{Index des auteurs}{authidx} - (* endif *) - (* if mainlang==french *) + \showindex{TODOsongindexname}{titleidx} + \showindex{TODOauthorindexname}{authidx} + (* if lang==french *) \notenamesin{A}{B}{C}{D}{E}{F}{G} \notenamesout{La}{Si}{Do}{Ré}{Mi}{Fa}{Sol} (* endif *) @@ -58,11 +53,7 @@ % list of chords \ifchorded \phantomsection - (* if mainlang==english *) - \addcontentsline{toc}{section}{Chords list} - (* else *) - \addcontentsline{toc}{section}{Liste des accords} - (* endif *) + \addcontentsline{toc}{section}{TODOchordlistname} \chords \fi (* endblock *) diff --git a/songbook_core/data/templates/songs.tex b/songbook_core/data/templates/songs.tex index e80e3e3e..97578a0b 100644 --- a/songbook_core/data/templates/songs.tex +++ b/songbook_core/data/templates/songs.tex @@ -3,21 +3,19 @@ (* block songbookpreambule *) (( super() )) + (* for lang in songlist.languages() *) \PassOptionsToPackage{((lang))}{babel} (* endfor *) \usepackage[((lang))]{babel} + \lang{((lang))} \graphicspath{{((datadir))/img/}} (* endblock *) (* block songs *) \phantomsection - (* if mainlang==english *) - \addcontentsline{toc}{section}{Songs list} - (* else *) - \addcontentsline{toc}{section}{Liste des chansons} - (* endif *) + \addcontentsline{toc}{section}{TODOsonglistname} \begin{songs}{((indexes|default('')))} (* for song in songlist.songs *)