# -*- coding: utf-8 -*-
#@+leo-ver=4
#@+node:@file french.py
#@@first

"""Translate a few menu items into French"""

from leoPlugins import *
from leoGlobals import *

#@+others
#@+node:onMenu
#@+at 
#@nonl
# 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):
	trace(tag,keywords)
	c = keywords.get("c")
	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.
	c.frame.menu.setRealMenuNamesFromTable(table)
#@-node:onMenu
#@-others

# Register the handlers...
registerHandler("menu1", onMenu)
	
__version__ = "1.2"
plugin_signon(__name__)
#@nonl
#@-node:@file french.py
#@-leo
