#!/usr/bin/env python3
import sys
(bin, ln, title) = sys.argv
symbol = u"".join(([chr(ord("🇦")+ord(c)-ord("a")) for c in ln]))
xml = f"""
<node oor:name="M2{ln.upper()}" oor:op="replace">
<prop oor:name="Context" oor:type="xs:string"><value/></prop>
<prop oor:name="URL" oor:type="xs:string"><value>service:org.openoffice.comp.pyuno.pagetranslate?trigger&lang={ln}</value></prop>
<prop oor:name="Title" oor:type="xs:string"><value/><value xml:lang="en-US">→{title} {symbol}</value></prop>
<prop oor:name="Target" oor:type="xs:string"><value>_self</value></prop>
</node>
"""
print(xml)