root/gli/trunk/metadata/adding_translations.txt @ 14865

Revision 12676, 3.9 KB (checked in by kjdon, 14 years ago)

language_dedpendent attribute is now optional. now use label instead of identifier

  • Property svn:keywords set to Author Date Id Revision
Line 
1How to add a translation for a metadata set.
2
3Note: When using the word element, we are speaking of a document object model element. Whereas when we say Element we are talking about a particular document object model element used to describe an item from the current set.
4
51. Prepare your source text in a UTF8 encoded document, or use a fully Unicode compliant text editor. Open the metadata set file that you want to edit.
6
7Example: To add a new language to the dublin.mds, open the file in a UTF8 editor.
8
92. In MetadataSet DOM element edit, or add if necessary, an argument named "language_dependent". As its value add a list of comma separated attribute names. These are the names of the attributes which are taken to be language dependent (see 4). This is optional.
10
11Example: While editing the dublin.mds scroll down to the start of the MetadataSet xml block, which looks like:
12
13<MetadataSet
14  contact     = "dcmi-feedback@dublincore.org"
15  creator     = "Dublin Core Metadata Initiative"
16  family      = "Dublin Core"
17  lastchanged = "Tue Jun 04 10:35:30 2002 - jmt12 on blackbird"
18  namespace   = "dc"
19>
20
21and add the mentioned line so it reads something like:
22
23<MetadataSet
24  contact     = "dcmi-feedback@dublincore.org"
25  creator     = "Dublin Core Metadata Initiative"
26  family      = "Dublin Core"
27  lastchanged = "Tue Jun 04 10:35:30 2002 - jmt12 on blackbird"
28  namespace   = "dc"
29  language_dependent = "label, definition, comment"
30>
31
32where label, definition and command are the attributes that we wish to be language specific.
33
343. Near the top of the document add a language specific set description block of the form
35
36  <SetLanguage code="**">
37    <Name>**</Name>
38    <Description>**</Description>
39  </SetLanguage>
40
41  Replace the ** with the relevant detail. Code is the two letter language code according to ISO 3166.
42
43Example: To add the French translation to the dublin.mds scroll down to just below the MetadataSet xml block, and add the SetLanguage xml block:
44
45  <SetLanguage code="fr">
46    <Name language="fr">El\303\251ments de m\303\251tadonn\303\251es du Dublin Core, Version 1.1: Description de R\303\251ference</Name>
47    <Description language="fr">Ce document r\303\251sume...</Description>
48  </SetLanguage>
49
504. For each Element xml block defined in the metadata set, add a new Language xml block and within it add the language specfic Attributes. The block is of the form:
51
52    <Language code="**">
53       <Attribute name="**">**</Attribute>
54       ...
55    </Language>
56
57  Replace the ** with the relevant detail. Once again code is the two letter language code according to ISO 3166. Note that the names specified in the name argument of an Attribute must also be listed in the language_dependent argument of the MetadataSet (see 1) (OPTIONAL)
58
59Example: Thus to add a French translation for the Element "Title", scroll down to the Element xml block defining Title. This should start:
60
61  <Element name="Title" remember_values="true">
62  ...
63  ...
64  ...
65  </Element>
66
67Now add in a new Language block so it looks something like this:
68
69  <Element name="Title" remember_values="true">
70  ...
71     <!-- French -->
72     <Language code="fr">
73        <Attribute name="label">Titre</Attribute>
74        <Attribute name="definition">Le nom donn\303\251 \303\240  la ressource.</Attribute>
75        <Attribute name="comment">Typiquement, un titre sera le nom par lequel la ressource est officiellement connue.</Attribute>
76     </Language>
77  ...
78  </Element>   
79
805. Finally edit the file <gli_install>/classes/xml/languages.xml. Locate the appropriate Language and add the argument mds="true" to enable this language. This controls what languages appear on the preferences page within the GLI.
81
82Example: Finally to enable the French translation, find the entry in the languages.xml file that reads:
83
84  <Language name="FRENCH"              code="FR" ... >ROMANCE</Language>
85
86And change it so it now says:
87
88  <Language name="FRENCH"              code="FR" ... mds="true">ROMANCE</Language>
Note: See TracBrowser for help on using the browser.