Browse Source

Amélioration de la gestion des langues

La langue par défaut est l'anglais.
pull/15/head
Louis 11 years ago
parent
commit
c07a3b6955
  1. 89
      songbook_core/data/latex/chords.sty
  2. 119
      songbook_core/data/latex/crepbook.cls
  3. 6
      songbook_core/data/templates/default.tex
  4. 2
      songbook_core/data/templates/songs.tex

89
songbook_core/data/latex/chords.sty

@ -9,61 +9,40 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Multilanguage management % Multilanguage management
\newcommand{\guitarchordsname}{ \AtBeginDocument{
\IfStrEq{\mainlanguage}{english}{Guitar chords}{} % Default names (english)
\IfStrEq{\mainlanguage}{french}{Accords de guitare}{} \newcommand{\guitarchordsname}{Guitar chords}
} \newcommand{\ukulelechordsname}{Ukulele chords}
\newcommand{\ukulelechordsname}{ \newcommand{\chordnameAsharp}{A\Sharp = B\Flat}
\IfStrEq{\mainlanguage}{english}{Ukulele chords}{} \newcommand{\chordnameA}{A}
\IfStrEq{\mainlanguage}{french}{Accords de ukulélé}{} \newcommand{\chordnameB}{B}
} \newcommand{\chordnameCsharp}{C\Sharp = D\Flat}
\newcommand{\chordnameAsharp}{ \newcommand{\chordnameC}{C}
\IfStrEq{\mainlanguage}{english}{A\Sharp = B\Flat}{} \newcommand{\chordnameDsharp}{D\Sharp = E\Flat}
\IfStrEq{\mainlanguage}{french}{La\Sharp = Si\Flat}{} \newcommand{\chordnameD}{D}
} \newcommand{\chordnameE}{E}
\newcommand{\chordnameA}{ \newcommand{\chordnameFsharp}{F\Sharp = G\Flat}
\IfStrEq{\mainlanguage}{english}{A}{} \newcommand{\chordnameF}{F}
\IfStrEq{\mainlanguage}{french}{La}{} \newcommand{\chordnameGsharp}{G\Sharp = A\Flat}
} \newcommand{\chordnameG}{G}
\newcommand{\chordnameB}{
\IfStrEq{\mainlanguage}{english}{B}{} \IfStrEq{\mainlanguage}{french}{
\IfStrEq{\mainlanguage}{french}{Si}{} % French names
} \renewcommand{\guitarchordsname}{Accords de guitare}
\newcommand{\chordnameCsharp}{ \renewcommand{\ukulelechordsname}{Accords de ukulélé}
\IfStrEq{\mainlanguage}{english}{C\Sharp = D\Flat}{} \renewcommand{\chordnameAsharp}{La\Sharp = Si\Flat}
\IfStrEq{\mainlanguage}{french}{Do\Sharp = Ré\Flat}{} \renewcommand{\chordnameA}{La}
} \renewcommand{\chordnameB}{Si}
\newcommand{\chordnameC}{ \renewcommand{\chordnameCsharp}{Do\Sharp = Ré\Flat}
\IfStrEq{\mainlanguage}{english}{C}{} \renewcommand{\chordnameC}{Do}
\IfStrEq{\mainlanguage}{french}{Do}{} \renewcommand{\chordnameDsharp}{Ré\Sharp = Mi\Flat}
} \renewcommand{\chordnameD}{Ré}
\newcommand{\chordnameDsharp}{ \renewcommand{\chordnameE}{Mi}
\IfStrEq{\mainlanguage}{english}{D\Sharp = E\Flat}{} \renewcommand{\chordnameFsharp}{Fa\Sharp = Sol\Flat}
\IfStrEq{\mainlanguage}{french}{Ré\Sharp = Mi\Flat}{} \renewcommand{\chordnameF}{Fa}
} \renewcommand{\chordnameGsharp}{Sol\Sharp = La\Flat}
\newcommand{\chordnameD}{ \renewcommand{\chordnameG}{Sol}
\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 % End of multilanguage management

119
songbook_core/data/latex/crepbook.cls

@ -89,81 +89,50 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Multilanguage management % Multilanguage management
\newcommand{\labelversionname}{% \AtBeginDocument{
\IfStrEq{\mainlanguage}{english}{version:}{}% % Default names (english)
\IfStrEq{\mainlanguage}{french}{version :}{}% \newcommand{\songlistname}{Songs list}
} \newcommand{\labelversionname}{version:}
\newcommand{\labeldatename}{% \newcommand{\labeldatename}{date:}
\IfStrEq{\mainlanguage}{english}{date:}{}% \newcommand{\labelauthorname}{authors:}
\IfStrEq{\mainlanguage}{french}{date :}{}% \newcommand{\labelwebname}{web:}
} \newcommand{\labelmailname}{mail:}
\newcommand{\labelauthorname}{% \newcommand{\originalsongname}{Original song:}
\IfStrEq{\mainlanguage}{english}{authors:}{}% \newcommand{\introname}{intro}
\IfStrEq{\mainlanguage}{french}{auteurs :}{}% \newcommand{\outroname}{outro}
} \newcommand{\bridgename}{bridge}
\newcommand{\labelwebname}{% \newcommand{\chorusname}{chorus}
\IfStrEq{\mainlanguage}{english}{web:}{}% \newcommand{\versename}{verse}
\IfStrEq{\mainlanguage}{french}{web :}{}% \newcommand{\soloname}{solo}
} \newcommand{\patternname}{pattern}
\newcommand{\labelmailname}{% \newcommand{\rythmname}{rythm}
\IfStrEq{\mainlanguage}{english}{mail:}{}% \newcommand{\transpositionname}{transposition:}
\IfStrEq{\mainlanguage}{french}{mail :}{}% \newcommand{\songindexname}{Songs Index}
} \newcommand{\authorindexname}{Authors Index}
\newcommand{\originalsongname}{% \newcommand{\chordlistname}{Chords list}
\IfStrEq{\mainlanguage}{english}{Original song:}{}%
\IfStrEq{\mainlanguage}{french}{Chanson originale :}{}% \IfStrEq{\mainlanguage}{french}{
} % French names
\newcommand{\introname}{% \renewcommand{\songlistname}{Liste des chansons}{}
\IfStrEq{\mainlanguage}{english}{intro}{}% \renewcommand{\labelversionname}{version :}
\IfStrEq{\mainlanguage}{french}{intro}{}% \renewcommand{\labeldatename}{date :}
} \renewcommand{\labelauthorname}{auteurs :}
\newcommand{\outroname}{% \renewcommand{\labelwebname}{web :}
\IfStrEq{\mainlanguage}{english}{outro}{}% \renewcommand{\labelmailname}{mail :}
\IfStrEq{\mainlanguage}{french}{outro}{}% \renewcommand{\originalsongname}{Chanson originale :}
} \renewcommand{\introname}{intro}
\newcommand{\bridgename}{% \renewcommand{\outroname}{outro}
\IfStrEq{\mainlanguage}{english}{bridge}{}% \renewcommand{\bridgename}{pont}
\IfStrEq{\mainlanguage}{french}{pont}{}% \renewcommand{\chorusname}{refrain}
} \renewcommand{\versename}{couplet}
\newcommand{\chorusname}{% \renewcommand{\soloname}{solo}
\IfStrEq{\mainlanguage}{english}{chorus}{}% \renewcommand{\patternname}{motif}
\IfStrEq{\mainlanguage}{french}{refrain}{}% \renewcommand{\rythmname}{rythme}
} \renewcommand{\transpositionname}{transposition :}
\newcommand{\versename}{% \renewcommand{\songindexname}{Index des chansons}
\IfStrEq{\mainlanguage}{english}{verse}{}% \renewcommand{\authorindexname}{Index des auteurs}
\IfStrEq{\mainlanguage}{french}{couple}{}% \renewcommand{\chordlistname}{Liste des accords}
} }{}
\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 % End of multilanguage management

6
songbook_core/data/templates/default.tex

@ -41,8 +41,8 @@
(* endblock *) (* endblock *)
(* block index *) (* block index *)
\showindex{TODOsongindexname}{titleidx} \showindex{\songindexname}{titleidx}
\showindex{TODOauthorindexname}{authidx} \showindex{\authorindexname}{authidx}
(* if lang==french *) (* if lang==french *)
\notenamesin{A}{B}{C}{D}{E}{F}{G} \notenamesin{A}{B}{C}{D}{E}{F}{G}
\notenamesout{La}{Si}{Do}{}{Mi}{Fa}{Sol} \notenamesout{La}{Si}{Do}{}{Mi}{Fa}{Sol}
@ -53,7 +53,7 @@
% list of chords % list of chords
\ifchorded \ifchorded
\phantomsection \phantomsection
\addcontentsline{toc}{section}{TODOchordlistname} \addcontentsline{toc}{section}{\chordlistname}
\chords \chords
\fi \fi
(* endblock *) (* endblock *)

2
songbook_core/data/templates/songs.tex

@ -15,7 +15,7 @@
(* block songs *) (* block songs *)
\phantomsection \phantomsection
\addcontentsline{toc}{section}{TODOsonglistname} \addcontentsline{toc}{section}{\songlistname}
\begin{songs}{((indexes|default('')))} \begin{songs}{((indexes|default('')))}
(* for song in songlist.songs *) (* for song in songlist.songs *)

Loading…
Cancel
Save