I have a kivy language file that looks like this. I have simplified for ease of reading, hopefully there is enough here to get across the concept...