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

119
songbook_core/data/latex/crepbook.cls

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

6
songbook_core/data/templates/default.tex

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

2
songbook_core/data/templates/songs.tex

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

Loading…
Cancel
Save