# HG changeset patch # User paulb # Date 1133574816 0 # Node ID dc659cde0f79788545f4986e65d3d67985f7bc33 # Parent 3bbbcd3ff0b20d25c05b193abe3e10dd41726082 [project @ 2005-12-03 01:53:36 by paulb] Added internationalisation/translation and labelling to the tutorial example. diff -r 3bbbcd3ff0b2 -r dc659cde0f79 examples/Common/VerySimple/__init__.py --- a/examples/Common/VerySimple/__init__.py Sat Dec 03 01:53:18 2005 +0000 +++ b/examples/Common/VerySimple/__init__.py Sat Dec 03 01:53:36 2005 +0000 @@ -22,17 +22,21 @@ encoding = "utf-8" template_resources = { #"structure" : ("structure_template.xhtml", "structure_output.xsl") - "structure" : ("structure_multivalue_template.xhtml", "structure_output.xsl") + #"structure" : ("structure_multivalue_template.xhtml", "structure_output.xsl") + "structure" : ("structure_multivalue_label_template.xhtml", "structure_output.xsl") } init_resources = { #"structure" : ("structure_template.xhtml", "structure_input.xsl") - "structure" : ("structure_multivalue_template.xhtml", "structure_input.xsl") + #"structure" : ("structure_multivalue_template.xhtml", "structure_input.xsl") + "structure" : ("structure_multivalue_label_template.xhtml", "structure_input.xsl") } transform_resources = { "comments" : ["structure_comments.xsl"] } document_resources = { - "types" : "structure_types.xml" + #"types" : "structure_types.xml" + "types" : "structure_types_label.xml", + "translations" : "translations.xml" } in_page_resources = { "comments" : ("structure_output_comments.xsl", "comment-node") @@ -90,7 +94,9 @@ # Complete the response. - self.send_output(trans, [trans_xsl], structure, stylesheet_parameters) + stylesheet_parameters["locale"] = trans.get_content_languages()[0] + self.send_output(trans, [trans_xsl], structure, stylesheet_parameters, + references={"translations" : self.prepare_document("translations")}) # Site map initialisation.