Here is a JSON-based solution, with the same concept exposed by KaarezKaarez
languages.json
{
"fr" : {
"turn left" : "tournez à gauche s'il vous plaît"
},
"en" : {
"turn left" : "turn left please"
}
}
And then, using the json module:
import json
with open('languages.json') as fd:
lang = json.load(fd)
print(lang["fr"]["turn left"])
However, note that a JSON file could be bigger than a txt file.