@@ -24,27 +24,27 @@ public class XliffBuilder
24
24
public void Add ( string name , string key , int hash , string source , string target )
25
25
{
26
26
Units . Add ( new XElement ( X . TU ,
27
- new XAttribute ( "id" , id ++ ) ,
28
- new XAttribute ( "resname" , key ) ,
27
+ new XAttribute ( X . ID , id ++ ) ,
28
+ new XAttribute ( X . RESNAME , key ) ,
29
29
new XElement ( X . SOURCE , new XAttribute ( X . XLANG , SourceLang ) , source ) ,
30
30
( target == null ? null : new XElement ( X . TARGET , new XAttribute ( X . XLANG , TargetLang ) , target ) ) ,
31
31
new XElement ( X . CGROUP ,
32
- ( name == null ? null : new XElement ( X . CONTEXT , new XAttribute ( "context-type" , "x-locres-namespace" ) , name ) ) ,
33
- new XElement ( X . CONTEXT , new XAttribute ( "context-type" , "x-locres-key" ) , key ) ,
34
- new XElement ( X . CONTEXT , new XAttribute ( "context-type" , "x-locres-hash" ) , hash . ToString ( "X08" ) ) ) ) ) ;
32
+ ( name == null ? null : new XElement ( X . CONTEXT , new XAttribute ( X . CTYPE , X . LOCRES_NAME ) , name ) ) ,
33
+ new XElement ( X . CONTEXT , new XAttribute ( X . CTYPE , X . LOCRES_KEY ) , key ) ,
34
+ new XElement ( X . CONTEXT , new XAttribute ( X . CTYPE , X . LOCRES_HASH ) , hash . ToString ( "X08" ) ) ) ) ) ;
35
35
}
36
36
37
37
public XElement GetDocument ( )
38
38
{
39
39
return new XElement ( X . XLIFF ,
40
- new XAttribute ( "version" , "1.2" ) ,
40
+ new XAttribute ( X . VERSION , "1.2" ) ,
41
41
new XAttribute ( X . XNS , X . XLIFF_NS . NamespaceName ) ,
42
42
new XElement ( X . FILE ,
43
- new XAttribute ( "original" , Origin ) ,
44
- new XAttribute ( "source-language" , SourceLang ) ,
45
- new XAttribute ( "target-language" , TargetLang ) ,
46
- new XAttribute ( "datatype" , LocResFormat == LocResFormat . New ? "x-locres-1" : "x-locres-0" ) ,
47
- new XAttribute ( X . XSPACE , "preserve" ) ,
43
+ new XAttribute ( X . ORIGINAL , Origin ) ,
44
+ new XAttribute ( X . SOURCELANG , SourceLang ) ,
45
+ new XAttribute ( X . TARGETLANG , TargetLang ) ,
46
+ new XAttribute ( X . DATATYPE , LocResFormat == LocResFormat . New ? X . LOCRES_FORMAT_NEW : X . LOCRES_FORMAT_OLD ) ,
47
+ new XAttribute ( X . XSPACE , X . PRESERVE ) ,
48
48
new XElement ( X . BODY ,
49
49
Units ) ) ) ;
50
50
}
0 commit comments