diff --git a/patacrep/data/templates/styles/patacrep.sty b/patacrep/data/templates/styles/patacrep.sty index 4413b996..7e5dcb5e 100644 --- a/patacrep/data/templates/styles/patacrep.sty +++ b/patacrep/data/templates/styles/patacrep.sty @@ -401,7 +401,9 @@ \renewcommand{\textnote}[2][]{% \vspace{.1cm} \IfStrEq{}{#1}{\@textnoteold{#2}}{ - \iflanguage{#1}{\@textnoteold{#2}}{} + \IfStrEq{\mainlanguage}{#1}{ + \@textnoteold{#2} + }{} } } @@ -409,7 +411,9 @@ \renewcommand{\musicnote}[2][]{% \vspace{.1cm} \IfStrEq{}{#1}{\@musicnoteold{#2}}{ - \iflanguage{#1}{\@musicnoteold{#2}}{} + \IfStrEq{\mainlanguage}{#1}{ + \@musicnoteold{#2} + }{} } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/patacrep/latex/__init__.py b/patacrep/latex/__init__.py index d2a57fc8..34954a15 100644 --- a/patacrep/latex/__init__.py +++ b/patacrep/latex/__init__.py @@ -16,7 +16,7 @@ LOGGER = logging.getLogger(__name__) DEFAULT_LANGUAGE = "en_us" BABEL_LANGUAGES = OrderedDict(( - ('de_de', 'german'), + ('de_de', 'ngerman'), # german (old), germanb (like german) ('de_at', 'austrian'), ('eo_uy', 'esperanto'), ('en_us', 'english'), # USenglish, american @@ -53,8 +53,6 @@ BABEL_LANGUAGES = OrderedDict(( # ('??_??', 'finnish'), # ('??_??', 'acadian'), # ('??_??', 'galician'), - # ('??_??', 'germanb'), - # ('??_??', 'ngerman'), # ('??_??', 'naustrian'), # ('??_??', 'greek'), # ('??_??', 'polutonikogreek'), diff --git a/test/test_book/lang_de.tex.control b/test/test_book/lang_de.tex.control new file mode 100644 index 00000000..5ed6126b --- /dev/null +++ b/test/test_book/lang_de.tex.control @@ -0,0 +1,131 @@ + + + + + + +%% Automatically generated document. +%% You may edit this file but all changes will be overwritten. +%% If you want to change this document, have a look at +%% the templating system. +%% +%% Generated using Songbook + +\makeatletter +\def\input@path{ % + {@TEST_FOLDER@/templates/styles/} % + {@DATA_FOLDER@/templates/styles/} % +} +\makeatother + +\documentclass[ + ]{article} + +\usepackage[ +chorded, +pictures, +repeatchords, +importantdiagramonly, +diagrampage, +guitar, + ]{crepbook} + +\usepackage[ + a4paper % paper size + ,includeheadfoot % include header and footer into text size + ,hmarginratio=1:1 % ratio between inner and outer margin (default) + ,outer=1.8cm % outer margin (right) + ,vmarginratio=1:1 % ratio between top and bottom margin + ,bmargin=1.3cm % bottom margin + ]{geometry} + +\usepackage{lmodern} + + +\usepackage[ngerman]{babel} +\lang{ngerman} + +\usepackage{graphicx} +\graphicspath{ % + {@TEST_FOLDER@/} % + {@DATA_FOLDER@/} % +} + + +\makeatletter +\@ifpackageloaded{hyperref}{}{ + \usepackage{url} + \newcommand{\phantomsection}{} + \newcommand{\hyperlink}[2]{#2} + \newcommand{\href}[2]{\expandafter\url\expandafter{#1}} +} +\makeatother + + +\usepackage{chords} + +\title{Guitar songbook} +\author{The Patacrep Team} + +\newindex{titleidx}{lang_de_title} +\newauthorindex{authidx}{lang_de_auth} + +\authignoreword{unknown} +\authbyword{by} +\authsepword{and} + +\notenamesout{A}{B}{C}{D}{E}{F}{G} + + +\pagestyle{empty}\definecolor{SongNumberBgColor}{HTML}{D1E4AE} +\definecolor{NoteBgColor}{HTML}{D1E4AE} +\definecolor{IndexBgColor}{HTML}{D1E4AE} + +\renewcommand{\snumbgcolor}{SongNumberBgColor} +\renewcommand{\notebgcolor}{NoteBgColor} +\renewcommand{\idxbgcolor}{IndexBgColor} + +\definecolor{tango-green-3}{HTML}{4e9a06} +\definecolor{tango-blue-3}{HTML}{204a87} +\usepackage[ + bookmarks, + bookmarksopen, + hyperfigures=true, + colorlinks=true, + linkcolor=tango-green-3, + urlcolor=tango-blue-3 + ]{hyperref} + + +\subtitle{} +\mail{crep@team-on-fire.com} +\web{http://www.patacrep.com} +\picture{img/treble_a} +\picturecopyright{Dbolton \url{http://commons.wikimedia.org/wiki/User:Dbolton}} +\footer{Generated using Songbook (\url{http://www.patacrep.com})} + + +\begin{document} + +\maketitle + + +\showindex{\songindexname}{titleidx} +\showindex{\authorindexname}{authidx} + +% list of chords +\ifdiagrampage + \phantomsection + \addcontentsline{toc}{section}{\chordlistname} + \chords +\fi +\setcounter{songnum}{1}% + +\phantomsection +\addcontentsline{toc}{section}{\songlistname} + + + + + +\end{document} diff --git a/test/test_book/lang_de.yaml b/test/test_book/lang_de.yaml new file mode 100644 index 00000000..12ba0364 --- /dev/null +++ b/test/test_book/lang_de.yaml @@ -0,0 +1,5 @@ +book: + lang: de + +content: + - sort: \ No newline at end of file