#@+leo
#@+node:0::@file plugins/mod_french.py
#@+body
"""translate a few menu items into French"""

from leoPlugins import *
from leoGlobals import *


#@+others
#@+node:1::onMenu
#@+body
#@+at
#  The translation table used by setRealMenuNamesFromTable has entries of the form:
# 
# 	("official name","translated name"),
# 
# Ampersands in the translated name indicate that the following character is 
# to be underlined.
# 
# The official name can be any name equivalent to the standard English menu 
# names.  Leo "canonicalizes" the official name by converting to lower case 
# and removing any non-letters.  Thus, the following are  equivalent:
# 	("Open...","&Ouvre"),
# 	("open",   "&Ouvre"),
# 	("&Open",  "&Ouvre"),

#@-at
#@@c
def onMenu (tag,keywords):
	table = (
		("Open...","&Ouvre"),
		("OpenWith","O&uvre Avec..."),
		("close","&Ferme"),
		("Undo Typing","French &Undo Typing"), # Shows you how much French I know ;-)
		("Redo Typing","French &Redo Typing"),
		("Can't Undo", "French Can't Undo"),
		("Can't Redo", "French Can't Redo"))
	# Call the convenience routine to do the work.
	app().setRealMenuNamesFromTable(table)

#@-body
#@-node:1::onMenu
#@-others


if 1: # Register the handlers...
	registerHandler(("start1","menu1"), onMenu)
	
	import mod_french
	es("...translate menus into French v1.1: " + plugin_date(mod_french))
#@-body
#@-node:0::@file plugins/mod_french.py
#@-leo
