diff --git a/examples/example-all.sb b/examples/example-all.sb
index 7b94d020..8f5d80a6 100644
--- a/examples/example-all.sb
+++ b/examples/example-all.sb
@@ -8,7 +8,7 @@
"booktype" : "chorded",
"datadir": ["datadir2"],
"template" : "patacrep.tex",
-"lang" : "french",
+"lang" : "fr",
"encoding": "utf8",
"authwords" : {
"sep" : ["and", "et"]
diff --git a/examples/songs/greensleeves.sgc b/examples/songs/greensleeves.sgc
index e7a6d7cb..c1295968 100644
--- a/examples/songs/greensleeves.sgc
+++ b/examples/songs/greensleeves.sgc
@@ -1,4 +1,4 @@
-{language : english}
+{lang : en}
{columns : 2}
{ title : Greensleeves}
{subtitle: Test of the chordpro format}
diff --git a/examples/songs/tests/chords.sgc b/examples/songs/tests/chords.sgc
index 8779a140..1539387b 100644
--- a/examples/songs/tests/chords.sgc
+++ b/examples/songs/tests/chords.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{columns: 1}
{title: Chords testing}
{subtitle: Test of the chords specification and LaTeX translation}
diff --git a/examples/songs/tests/errors.sgc b/examples/songs/tests/errors.sgc
index 56cb61b7..3b682f4c 100644
--- a/examples/songs/tests/errors.sgc
+++ b/examples/songs/tests/errors.sgc
@@ -1,4 +1,4 @@
-{language : english}
+{lang : en}
{columns : 2}
{ title : Error}
{subtitle: A chordpro file with many errors}
diff --git a/patacrep/build.py b/patacrep/build.py
index 492f30fc..44023e65 100644
--- a/patacrep/build.py
+++ b/patacrep/build.py
@@ -29,7 +29,7 @@ GENERATED_EXTENSIONS = [
]
DEFAULT_CONFIG = {
'template': "default.tex",
- 'lang': 'english',
+ 'lang': 'en',
'content': [],
'titleprefixwords': [],
'encoding': None,
diff --git a/patacrep/content/song.py b/patacrep/content/song.py
index 42b4abba..c5455c92 100755
--- a/patacrep/content/song.py
+++ b/patacrep/content/song.py
@@ -60,8 +60,8 @@ def parse(keyword, argument, contentlist, config):
Return a list of Song() instances.
"""
plugins = config['_song_plugins']
- if '_languages' not in config:
- config['_languages'] = set()
+ if '_langs' not in config:
+ config['_langs'] = set()
songlist = []
for songdir in config['_songdir']:
if contentlist:
@@ -92,7 +92,7 @@ def parse(keyword, argument, contentlist, config):
datadir=songdir.datadir,
))
songlist.append(renderer)
- config["_languages"].add(renderer.song.language)
+ config["_langs"].add(renderer.song.lang)
if len(songlist) > before:
break
if len(songlist) == before:
diff --git a/patacrep/data/templates/songs.tex b/patacrep/data/templates/songs.tex
index bdfcf7bb..957e610e 100644
--- a/patacrep/data/templates/songs.tex
+++ b/patacrep/data/templates/songs.tex
@@ -52,7 +52,7 @@
"mandatory": true
},
"lang": {"description": {"english": "Language", "french": "Langue"},
- "default": {"english": "english", "french": "french"}
+ "default": {"english": "en", "french": "fr"}
},
"titleprefixwords": {"description": {"english": "Ignore some words in the beginning of song titles",
"french": "Ignore des mots dans le classement des chansons"},
@@ -80,11 +80,11 @@
(* block songbookpreambule *)
(( super() ))
-(* for lang in _languages -*)
- \PassOptionsToPackage{((lang))}{babel}
+(* for lang in _langs -*)
+ \PassOptionsToPackage{(( lang2babel(lang) ))}{babel}
(* endfor *)
-\usepackage[((lang))]{babel}
-\lang{((lang))}
+\usepackage[(( lang2babel(lang) ))]{babel}
+\lang{(( lang2babel(lang) ))}
\usepackage{graphicx}
\graphicspath{ %
diff --git a/patacrep/latex/__init__.py b/patacrep/latex/__init__.py
index 2c6db73a..d01cfbe5 100644
--- a/patacrep/latex/__init__.py
+++ b/patacrep/latex/__init__.py
@@ -5,4 +5,27 @@ This module uses an LALR parser to try to parse LaTeX code. LaTeX language
will work on simple cases, but not on complex ones.
"""
+import logging
+from collections import OrderedDict
+
from patacrep.latex.syntax import tex2plain, parse_song
+
+LOGGER = logging.getLogger(__name__)
+
+BABEL_LANGUAGES = OrderedDict((
+ ('fr', 'french'),
+ ('en', 'english'),
+ ('de', 'german'),
+ ('es', 'spanish'),
+ ('it', 'italian'),
+ ('pt', 'portuguese'),
+))
+
+def lang2babel(lang):
+ """Return the language used by babel, corresponding to the language code"""
+ try:
+ return BABEL_LANGUAGES[lang]
+ except KeyError:
+ available = ", ".join(BABEL_LANGUAGES.keys())
+ LOGGER.error('Unknown lang code: ' + lang + '. Supported: ' + available)
+ return 'english'
diff --git a/patacrep/songs/__init__.py b/patacrep/songs/__init__.py
index 5c6eb797..a9cef025 100644
--- a/patacrep/songs/__init__.py
+++ b/patacrep/songs/__init__.py
@@ -89,7 +89,7 @@ class Song:
"cached",
"data",
"subpath",
- "language",
+ "lang",
"authors",
"_filehash",
"_version",
@@ -131,6 +131,7 @@ class Song:
self.titles = []
self.data = {}
self.cached = None
+ self.lang = None
self._parse(config)
# Post processing of data
@@ -186,8 +187,7 @@ class Song:
- titles: the list of (raw) titles. This list will be processed to
remove prefixes.
- - language: the main language of the song, as language recognized by
- the LaTeX babel package.
+ - lang: the main language of the song, as language code..
- authors: the list of (raw) authors. This list will be processed to
'clean' it (see function :func:`patacrep.authors.processauthors`).
- data: song metadata. Used (among others) to sort the songs.
diff --git a/patacrep/songs/chordpro/__init__.py b/patacrep/songs/chordpro/__init__.py
index 52b926a8..cc0807bb 100644
--- a/patacrep/songs/chordpro/__init__.py
+++ b/patacrep/songs/chordpro/__init__.py
@@ -9,6 +9,7 @@ from patacrep import encoding, files
from patacrep.songs import Song
from patacrep.songs.chordpro.syntax import parse_song
from patacrep.templates import Renderer
+from patacrep.latex import lang2babel
class ChordproSong(Song):
"""Chordpros song parser."""
@@ -35,7 +36,7 @@ class ChordproSong(Song):
song = parse_song(song.read(), self.fullpath)
self.authors = song.authors
self.titles = song.titles
- self.language = song.get_data_argument('language', self.config['lang'])
+ self.lang = song.get_data_argument('lang', self.config['lang'])
self.data = song.meta
self.cached = {
'song': song,
@@ -46,7 +47,7 @@ class ChordproSong(Song):
templatedirs = []
context = {
- 'language': self.language,
+ 'lang': self.lang,
"titles": self.titles,
"authors": self.authors,
"metadata": self.data,
@@ -60,6 +61,7 @@ class ChordproSong(Song):
))
jinjaenv.filters['search_image'] = self.search_image
jinjaenv.filters['search_partition'] = self.search_partition
+ jinjaenv.filters['lang2babel'] = lang2babel
try:
return Renderer(
diff --git a/patacrep/songs/chordpro/ast.py b/patacrep/songs/chordpro/ast.py
index 526f7d93..9213ed37 100644
--- a/patacrep/songs/chordpro/ast.py
+++ b/patacrep/songs/chordpro/ast.py
@@ -31,6 +31,7 @@ DIRECTIVE_SHORTCUTS = {
"c": "comment",
"gc": "guitar_comment",
"cover": "cov",
+ "language": "lang",
}
def directive_name(text):
@@ -181,7 +182,7 @@ class Song(AST):
- content: the song content, as a list of objects `foo` such that
`foo.inline` is True.
- titles: The list of titles
- - language: The language (if set), None otherwise
+ - lang: The language code (if set), None otherwise
- authors: The list of authors
- meta: Every other metadata.
"""
diff --git a/patacrep/songs/chordpro/data/chordpro/song_header b/patacrep/songs/chordpro/data/chordpro/song_header
index ac5d8329..2ffb1d30 100644
--- a/patacrep/songs/chordpro/data/chordpro/song_header
+++ b/patacrep/songs/chordpro/data/chordpro/song_header
@@ -1,5 +1,5 @@
-(* if language is defined -*)
- {language: (( language ))}
+(* if lang is defined -*)
+ {lang: (( lang ))}
(* endif *)
(* if metadata.columns is defined -*)
{columns: (( metadata.columns ))}
diff --git a/patacrep/songs/chordpro/data/html/song_header b/patacrep/songs/chordpro/data/html/song_header
index 963ef686..bd401864 100644
--- a/patacrep/songs/chordpro/data/html/song_header
+++ b/patacrep/songs/chordpro/data/html/song_header
@@ -17,8 +17,8 @@
(* endif *)
(* endfor *)
-(* if language is defined -*)
- Language: (( language ))
+(* if lang is defined -*)
+ Lang: (( lang ))
(* endif *)
(* include 'content_metadata_cover' *)
diff --git a/patacrep/songs/chordpro/data/latex/song b/patacrep/songs/chordpro/data/latex/song
index 6f51d673..d106c2e8 100644
--- a/patacrep/songs/chordpro/data/latex/song
+++ b/patacrep/songs/chordpro/data/latex/song
@@ -1,5 +1,5 @@
-(* if language is defined -*)
- \selectlanguage{((language))}
+(* if lang is defined -*)
+ \selectlanguage{(( lang2babel(lang) ))}
(* endif *)
(*- if metadata.columns is defined *)
diff --git a/patacrep/songs/latex/__init__.py b/patacrep/songs/latex/__init__.py
index 2371c7d9..980fece2 100644
--- a/patacrep/songs/latex/__init__.py
+++ b/patacrep/songs/latex/__init__.py
@@ -8,19 +8,19 @@ will work on simple cases, but not on complex ones.
import os
from patacrep import files, encoding
-from patacrep.latex import parse_song
+from patacrep.latex import parse_song, BABEL_LANGUAGES
from patacrep.songs import Song
class LatexSong(Song):
"""LaTeX song parser."""
def _parse(self, __config):
- """Parse content, and return the dictinory of song data."""
+ """Parse content, and return the dictionary of song data."""
with encoding.open_read(self.fullpath, encoding=self.encoding) as song:
self.data = parse_song(song.read(), self.fullpath)
self.titles = self.data['@titles']
del self.data['@titles']
- self.language = self.data['@language']
+ self.set_lang(self.data['@language'])
del self.data['@language']
if "by" in self.data:
self.authors = [self.data['by']]
@@ -38,6 +38,18 @@ class LatexSong(Song):
))
return r'\import{{{}/}}{{{}}}'.format(os.path.dirname(path), os.path.basename(path))
+ def set_lang(self, language):
+ """Set the language code"""
+ for lang, babel_language in BABEL_LANGUAGES.items():
+ if language == babel_language:
+ self.lang = lang
+ return
+
+ # Add a custom language to the babel dictionary (language is not officially supported)
+ custom_lang = '_' + language
+ BABEL_LANGUAGES[custom_lang] = language
+ self.lang = custom_lang
+
SONG_PARSERS = {
'is': LatexSong,
'sg': LatexSong,
diff --git a/patacrep/templates.py b/patacrep/templates.py
index 3673f878..6a799295 100644
--- a/patacrep/templates.py
+++ b/patacrep/templates.py
@@ -9,6 +9,7 @@ import re
import json
from patacrep import errors, files
+from patacrep.latex import lang2babel
import patacrep.encoding
_LATEX_SUBS = (
@@ -84,6 +85,7 @@ class Renderer:
self.jinjaenv.trim_blocks = True
self.jinjaenv.lstrip_blocks = True
self.jinjaenv.globals["path2posix"] = files.path2posix
+ self.jinjaenv.globals["lang2babel"] = lang2babel
self.template = self.jinjaenv.get_template(template)
diff --git a/test/test_chordpro/00.sgc b/test/test_chordpro/00.sgc
index 3e2185b7..768ee9ee 100644
--- a/test/test_chordpro/00.sgc
+++ b/test/test_chordpro/00.sgc
@@ -1 +1 @@
-{language: english}
+{lang: en}
diff --git a/test/test_chordpro/01.sgc b/test/test_chordpro/01.sgc
index 25d6a677..6cf1934e 100644
--- a/test/test_chordpro/01.sgc
+++ b/test/test_chordpro/01.sgc
@@ -1,3 +1,3 @@
-{language: english}
+{lang: en}
A verse line
diff --git a/test/test_chordpro/02.sgc b/test/test_chordpro/02.sgc
index 2a8629e0..365a1b9b 100644
--- a/test/test_chordpro/02.sgc
+++ b/test/test_chordpro/02.sgc
@@ -1,3 +1,3 @@
-{language: english}
+{lang: en}
{title: A directive}
diff --git a/test/test_chordpro/03.sgc b/test/test_chordpro/03.sgc
index 341c9bd4..6468f5e9 100644
--- a/test/test_chordpro/03.sgc
+++ b/test/test_chordpro/03.sgc
@@ -1,2 +1,2 @@
-{language: english}
+{lang: en}
diff --git a/test/test_chordpro/04.sgc b/test/test_chordpro/04.sgc
index e9c2a952..d25f38a8 100644
--- a/test/test_chordpro/04.sgc
+++ b/test/test_chordpro/04.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{start_of_chorus}
A one line chorus
diff --git a/test/test_chordpro/05.sgc b/test/test_chordpro/05.sgc
index 9bc7f016..cf6a654b 100644
--- a/test/test_chordpro/05.sgc
+++ b/test/test_chordpro/05.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{start_of_bridge}
A one line bridge
diff --git a/test/test_chordpro/06.sgc b/test/test_chordpro/06.sgc
index 341c9bd4..6468f5e9 100644
--- a/test/test_chordpro/06.sgc
+++ b/test/test_chordpro/06.sgc
@@ -1,2 +1,2 @@
-{language: english}
+{lang: en}
diff --git a/test/test_chordpro/07.sgc b/test/test_chordpro/07.sgc
index b05a536f..1362cdeb 100644
--- a/test/test_chordpro/07.sgc
+++ b/test/test_chordpro/07.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{start_of_tab}
A tab
diff --git a/test/test_chordpro/08.sgc b/test/test_chordpro/08.sgc
index 9a9f0566..bfcb44dd 100644
--- a/test/test_chordpro/08.sgc
+++ b/test/test_chordpro/08.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
A lot of new lines
diff --git a/test/test_chordpro/09.sgc b/test/test_chordpro/09.sgc
index 193db1b0..b252de69 100644
--- a/test/test_chordpro/09.sgc
+++ b/test/test_chordpro/09.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{title: and a directive}
diff --git a/test/test_chordpro/10.sgc b/test/test_chordpro/10.sgc
index e7537b3b..431ddd11 100644
--- a/test/test_chordpro/10.sgc
+++ b/test/test_chordpro/10.sgc
@@ -1,3 +1,3 @@
-{language: english}
+{lang: en}
A line[A] with a chord
diff --git a/test/test_chordpro/11.sgc b/test/test_chordpro/11.sgc
index 3610f67c..350f195d 100644
--- a/test/test_chordpro/11.sgc
+++ b/test/test_chordpro/11.sgc
@@ -1,3 +1,3 @@
-{language: english}
+{lang: en}
A line ending with a chord[A]
diff --git a/test/test_chordpro/12.sgc b/test/test_chordpro/12.sgc
index 029ccad4..946d7add 100644
--- a/test/test_chordpro/12.sgc
+++ b/test/test_chordpro/12.sgc
@@ -1,3 +1,3 @@
-{language: english}
+{lang: en}
[A]A line starting with a chord
diff --git a/test/test_chordpro/13.sgc b/test/test_chordpro/13.sgc
index aa6f6603..1000c0db 100644
--- a/test/test_chordpro/13.sgc
+++ b/test/test_chordpro/13.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{start_of_tab}
A table
diff --git a/test/test_chordpro/21.sgc b/test/test_chordpro/21.sgc
index 25d6a677..6cf1934e 100644
--- a/test/test_chordpro/21.sgc
+++ b/test/test_chordpro/21.sgc
@@ -1,3 +1,3 @@
-{language: english}
+{lang: en}
A verse line
diff --git a/test/test_chordpro/22.sgc b/test/test_chordpro/22.sgc
index 2a8629e0..365a1b9b 100644
--- a/test/test_chordpro/22.sgc
+++ b/test/test_chordpro/22.sgc
@@ -1,3 +1,3 @@
-{language: english}
+{lang: en}
{title: A directive}
diff --git a/test/test_chordpro/23.sgc b/test/test_chordpro/23.sgc
index 3e2185b7..768ee9ee 100644
--- a/test/test_chordpro/23.sgc
+++ b/test/test_chordpro/23.sgc
@@ -1 +1 @@
-{language: english}
+{lang: en}
diff --git a/test/test_chordpro/24.sgc b/test/test_chordpro/24.sgc
index e9c2a952..d25f38a8 100644
--- a/test/test_chordpro/24.sgc
+++ b/test/test_chordpro/24.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{start_of_chorus}
A one line chorus
diff --git a/test/test_chordpro/25.sgc b/test/test_chordpro/25.sgc
index 9bc7f016..cf6a654b 100644
--- a/test/test_chordpro/25.sgc
+++ b/test/test_chordpro/25.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{start_of_bridge}
A one line bridge
diff --git a/test/test_chordpro/26.sgc b/test/test_chordpro/26.sgc
index 341c9bd4..6468f5e9 100644
--- a/test/test_chordpro/26.sgc
+++ b/test/test_chordpro/26.sgc
@@ -1,2 +1,2 @@
-{language: english}
+{lang: en}
diff --git a/test/test_chordpro/27.sgc b/test/test_chordpro/27.sgc
index b05a536f..1362cdeb 100644
--- a/test/test_chordpro/27.sgc
+++ b/test/test_chordpro/27.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{start_of_tab}
A tab
diff --git a/test/test_chordpro/28.sgc b/test/test_chordpro/28.sgc
index 9a9f0566..bfcb44dd 100644
--- a/test/test_chordpro/28.sgc
+++ b/test/test_chordpro/28.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
A lot of new lines
diff --git a/test/test_chordpro/29.sgc b/test/test_chordpro/29.sgc
index 193db1b0..b252de69 100644
--- a/test/test_chordpro/29.sgc
+++ b/test/test_chordpro/29.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{title: and a directive}
diff --git a/test/test_chordpro/author_names.sgc b/test/test_chordpro/author_names.sgc
index 36a39230..b1756cc3 100644
--- a/test/test_chordpro/author_names.sgc
+++ b/test/test_chordpro/author_names.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{title: Title}
{artist: The Beatles}
{artist: Oasis}
diff --git a/test/test_chordpro/chords.sgc b/test/test_chordpro/chords.sgc
index 040dcf07..983e03ee 100644
--- a/test/test_chordpro/chords.sgc
+++ b/test/test_chordpro/chords.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
[A]Simple
[Bb]BĂ©mol
diff --git a/test/test_chordpro/customchords.sgc b/test/test_chordpro/customchords.sgc
index 3357bb96..dd42e025 100644
--- a/test/test_chordpro/customchords.sgc
+++ b/test/test_chordpro/customchords.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{define: E4 base-fret 7 frets 0 1 3 3 x x}
{define: E5 base-fret 7 frets 0 1 3 3 x x fingers - 1 2 3 - -}
{define: E5/A* base-fret 7 frets 0 1 3 3 x x fingers - 1 2 3 - -}
diff --git a/test/test_chordpro/greensleeves.sgc b/test/test_chordpro/greensleeves.sgc
index 389f14d1..7ff25a58 100644
--- a/test/test_chordpro/greensleeves.sgc
+++ b/test/test_chordpro/greensleeves.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{columns: 2}
{title: Greensleeves}
{title: Un autre sous-titre}
diff --git a/test/test_chordpro/greensleeves.source b/test/test_chordpro/greensleeves.source
index 1dee93ff..3801418d 100644
--- a/test/test_chordpro/greensleeves.source
+++ b/test/test_chordpro/greensleeves.source
@@ -1,4 +1,4 @@
-{language : english}
+{lang : en}
{columns : 2}
{subtitle : Un sous titre}
{ title : Greensleeves}
diff --git a/test/test_chordpro/invalid_chord.sgc b/test/test_chordpro/invalid_chord.sgc
index acb5444f..3d6319be 100644
--- a/test/test_chordpro/invalid_chord.sgc
+++ b/test/test_chordpro/invalid_chord.sgc
@@ -1,3 +1,3 @@
-{language: english}
+{lang: en}
This is invalid.
diff --git a/test/test_chordpro/invalid_customchord.sgc b/test/test_chordpro/invalid_customchord.sgc
index 341c9bd4..6468f5e9 100644
--- a/test/test_chordpro/invalid_customchord.sgc
+++ b/test/test_chordpro/invalid_customchord.sgc
@@ -1,2 +1,2 @@
-{language: english}
+{lang: en}
diff --git a/test/test_chordpro/lang.sgc b/test/test_chordpro/lang.sgc
new file mode 100644
index 00000000..be2eff89
--- /dev/null
+++ b/test/test_chordpro/lang.sgc
@@ -0,0 +1 @@
+{lang: fr}
\ No newline at end of file
diff --git a/test/test_chordpro/lang.source b/test/test_chordpro/lang.source
new file mode 100644
index 00000000..c9a4c305
--- /dev/null
+++ b/test/test_chordpro/lang.source
@@ -0,0 +1 @@
+{language: fr}
diff --git a/test/test_chordpro/metadata.sgc b/test/test_chordpro/metadata.sgc
index 979c1388..d48ded77 100644
--- a/test/test_chordpro/metadata.sgc
+++ b/test/test_chordpro/metadata.sgc
@@ -1,4 +1,4 @@
-{language: french}
+{lang: fr}
{capo: Capo}
{title: Title}
{title: Subtitle1}
diff --git a/test/test_chordpro/metadata.source b/test/test_chordpro/metadata.source
index 514ac2c0..02167238 100644
--- a/test/test_chordpro/metadata.source
+++ b/test/test_chordpro/metadata.source
@@ -4,8 +4,8 @@
{subtitle: Subtitle4}
{t: Subtitle2}
{st: Subtitle5}
-{language: english}
-{language: french}
+{lang: en}
+{lang: fr}
{by: Author1}
{artist: Author2}
{album: Album}
diff --git a/test/test_chordpro/newline.html b/test/test_chordpro/newline.html
index 1fbb02a3..aca33fa6 100644
--- a/test/test_chordpro/newline.html
+++ b/test/test_chordpro/newline.html
@@ -1,4 +1,4 @@
-Language: english
+Lang: en
diff --git a/test/test_chordpro/newline.sgc b/test/test_chordpro/newline.sgc
index 72bdc1a2..e9bf0c62 100644
--- a/test/test_chordpro/newline.sgc
+++ b/test/test_chordpro/newline.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
This is a verse
With a new line
diff --git a/test/test_chordpro/nolyrics.sgc b/test/test_chordpro/nolyrics.sgc
index fd59c884..2ad06b03 100644
--- a/test/test_chordpro/nolyrics.sgc
+++ b/test/test_chordpro/nolyrics.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
A chorus [A]with lyrics
[Emaj3]maj et nombre
diff --git a/test/test_chordpro/ukulelechords.sgc b/test/test_chordpro/ukulelechords.sgc
index 3b37123d..bbf4aa81 100644
--- a/test/test_chordpro/ukulelechords.sgc
+++ b/test/test_chordpro/ukulelechords.sgc
@@ -1,4 +1,4 @@
-{language: english}
+{lang: en}
{define: G frets 0 2 3 2}
{define: D7 frets 2 2 2 3 fingers 1 1 1 2}
{define: G frets 3 2 0 0 0 3}