@@ -10,9 +10,9 @@ define([
10
10
"sugar-web/env" ,
11
11
"sugar-web/graphics/presencepalette" ,
12
12
"activity/palettes/export-palette" ,
13
- "webL10n " ,
13
+ "l10n " ,
14
14
"tutorial"
15
- ] , function ( activity , formatpalette , listpalette , parapalette , fontPalette , colorpalette , datastore , journalchooser , env , presencepalette , exportpalette , webL10n , tutorial ) {
15
+ ] , function ( activity , formatpalette , listpalette , parapalette , fontPalette , colorpalette , datastore , journalchooser , env , presencepalette , exportpalette , l10n , tutorial ) {
16
16
17
17
// Manipulate the DOM only when it is ready.
18
18
requirejs ( [ 'domReady!' , 'humane' ] , function ( doc , humane ) {
@@ -47,53 +47,53 @@ define([
47
47
// Language Settings
48
48
var defaultLanguage = ( typeof chrome != 'undefined' && chrome . app && chrome . app . runtime ) ? chrome . i18n . getUILanguage ( ) : navigator . language ;
49
49
var language = environment . user ? environment . user . language : defaultLanguage ;
50
- webL10n . language . code = language ;
50
+ l10n . init ( language ) ;
51
51
window . addEventListener ( "localized" , function ( ) {
52
- document . getElementById ( "network-button" ) . title = webL10n . get ( "Network" ) ;
53
- document . getElementById ( "color-button-1" ) . title = webL10n . get ( "ForegroundColor" ) ;
54
- document . getElementById ( "color-button-2" ) . title = webL10n . get ( "BackgroundColor" ) ;
55
- document . getElementById ( "format-text" ) . title = webL10n . get ( "Formattext" ) ;
56
- document . getElementById ( "paragraph" ) . title = webL10n . get ( "Paragraph" ) ;
57
- document . getElementById ( "list" ) . title = webL10n . get ( "List" ) ;
58
- document . getElementById ( "resize-inc" ) . title = webL10n . get ( "Increasefontsize" ) ;
59
- document . getElementById ( "font-button" ) . title = webL10n . get ( "ChooseFont" ) ;
60
- document . getElementById ( "resize-dec" ) . title = webL10n . get ( "Decreasefontsize" ) ;
61
- document . getElementById ( "insert-picture" ) . title = webL10n . get ( "Image" ) ;
62
- document . getElementById ( "edit-undo" ) . title = webL10n . get ( "Undo" ) ;
63
- document . getElementById ( "edit-redo" ) . title = webL10n . get ( "Redo" ) ;
64
- document . getElementById ( "edit-copy" ) . title = webL10n . get ( "Copy" ) ;
65
- document . getElementById ( "edit-paste" ) . title = webL10n . get ( "Paste" ) ;
66
- document . getElementById ( "export" ) . title = webL10n . get ( "Export" ) ;
67
- document . getElementById ( "super-script" ) . title = webL10n . get ( "SuperScript" ) ;
68
- document . getElementById ( "sub-script" ) . title = webL10n . get ( "SubScript" ) ;
69
- document . getElementById ( 5 ) . title = webL10n . get ( "Bold" ) ;
70
- document . getElementById ( 6 ) . title = webL10n . get ( "Italic" ) ;
71
- document . getElementById ( 7 ) . title = webL10n . get ( "Underline" ) ;
72
- document . getElementById ( 8 ) . title = webL10n . get ( "Strike" ) ;
73
- document . getElementById ( 9 ) . title = webL10n . get ( "OrderedList" ) ;
74
- document . getElementById ( 10 ) . title = webL10n . get ( "UnorderedList" ) ;
75
- document . getElementById ( 11 ) . title = webL10n . get ( "JustifyLeft" ) ;
76
- document . getElementById ( 12 ) . title = webL10n . get ( "JustifyRight" ) ;
77
- document . getElementById ( 13 ) . title = webL10n . get ( "JustifyCenter" ) ;
78
- document . getElementById ( 19 ) . title = webL10n . get ( "ExportToTxt" ) ;
79
- document . getElementById ( 20 ) . title = webL10n . get ( "ExportToPdf" ) ;
80
- document . getElementById ( 21 ) . title = webL10n . get ( "ExportToDoc" ) ;
81
- document . getElementById ( 22 ) . title = webL10n . get ( "ExportToOdt" ) ;
52
+ document . getElementById ( "network-button" ) . title = l10n . get ( "Network" ) ;
53
+ document . getElementById ( "color-button-1" ) . title = l10n . get ( "ForegroundColor" ) ;
54
+ document . getElementById ( "color-button-2" ) . title = l10n . get ( "BackgroundColor" ) ;
55
+ document . getElementById ( "format-text" ) . title = l10n . get ( "Formattext" ) ;
56
+ document . getElementById ( "paragraph" ) . title = l10n . get ( "Paragraph" ) ;
57
+ document . getElementById ( "list" ) . title = l10n . get ( "List" ) ;
58
+ document . getElementById ( "resize-inc" ) . title = l10n . get ( "Increasefontsize" ) ;
59
+ document . getElementById ( "font-button" ) . title = l10n . get ( "ChooseFont" ) ;
60
+ document . getElementById ( "resize-dec" ) . title = l10n . get ( "Decreasefontsize" ) ;
61
+ document . getElementById ( "insert-picture" ) . title = l10n . get ( "Image" ) ;
62
+ document . getElementById ( "edit-undo" ) . title = l10n . get ( "Undo" ) ;
63
+ document . getElementById ( "edit-redo" ) . title = l10n . get ( "Redo" ) ;
64
+ document . getElementById ( "edit-copy" ) . title = l10n . get ( "Copy" ) ;
65
+ document . getElementById ( "edit-paste" ) . title = l10n . get ( "Paste" ) ;
66
+ document . getElementById ( "export" ) . title = l10n . get ( "Export" ) ;
67
+ document . getElementById ( "super-script" ) . title = l10n . get ( "SuperScript" ) ;
68
+ document . getElementById ( "sub-script" ) . title = l10n . get ( "SubScript" ) ;
69
+ document . getElementById ( 5 ) . title = l10n . get ( "Bold" ) ;
70
+ document . getElementById ( 6 ) . title = l10n . get ( "Italic" ) ;
71
+ document . getElementById ( 7 ) . title = l10n . get ( "Underline" ) ;
72
+ document . getElementById ( 8 ) . title = l10n . get ( "Strike" ) ;
73
+ document . getElementById ( 9 ) . title = l10n . get ( "OrderedList" ) ;
74
+ document . getElementById ( 10 ) . title = l10n . get ( "UnorderedList" ) ;
75
+ document . getElementById ( 11 ) . title = l10n . get ( "JustifyLeft" ) ;
76
+ document . getElementById ( 12 ) . title = l10n . get ( "JustifyRight" ) ;
77
+ document . getElementById ( 13 ) . title = l10n . get ( "JustifyCenter" ) ;
78
+ document . getElementById ( 19 ) . title = l10n . get ( "ExportToTxt" ) ;
79
+ document . getElementById ( 20 ) . title = l10n . get ( "ExportToPdf" ) ;
80
+ document . getElementById ( 21 ) . title = l10n . get ( "ExportToDoc" ) ;
81
+ document . getElementById ( 22 ) . title = l10n . get ( "ExportToOdt" ) ;
82
82
} ) ;
83
83
84
84
if ( ! environment . objectId && ! environment . sharedId ) {
85
85
// New instance
86
86
// Intentionally added setTimeout to allow locale.ini file to be loaded
87
87
setTimeout ( function ( ) {
88
88
editor . setContents ( [
89
- { insert : webL10n . get ( 'Welcome' , { username : environment . user . name } ) + '\n' , attributes : { size : "40px" , color : environment . user . colorvalue . stroke , bold : true } } ,
89
+ { insert : l10n . get ( 'Welcome' , { username : environment . user . name } ) + '\n' , attributes : { size : "40px" , color : environment . user . colorvalue . stroke , bold : true } } ,
90
90
] ) ;
91
91
var length = editor . getLength ( ) ;
92
- editor . clipboard . dangerouslyPasteHTML ( length , webL10n . get ( 'Write' ) ) ;
92
+ editor . clipboard . dangerouslyPasteHTML ( length , l10n . get ( 'Write' ) ) ;
93
93
length = editor . getLength ( ) ;
94
- editor . clipboard . dangerouslyPasteHTML ( length , webL10n . get ( 'Writefeatures' ) ) ;
94
+ editor . clipboard . dangerouslyPasteHTML ( length , l10n . get ( 'Writefeatures' ) ) ;
95
95
length = editor . getLength ( ) ;
96
- editor . clipboard . dangerouslyPasteHTML ( length , webL10n . get ( 'Enjoy' ) ) ;
96
+ editor . clipboard . dangerouslyPasteHTML ( length , l10n . get ( 'Enjoy' ) ) ;
97
97
length = editor . getLength ( ) ;
98
98
editor . clipboard . dangerouslyPasteHTML ( length , "<br></br>" ) ;
99
99
length = editor . getLength ( ) ;
@@ -393,7 +393,7 @@ define([
393
393
} ;
394
394
datastore . create ( metadata , function ( ) {
395
395
console . log ( "export done." ) ;
396
- humane . log ( webL10n . get ( "Txt" ) ) ;
396
+ humane . log ( l10n . get ( "Txt" ) ) ;
397
397
} , inputData ) ;
398
398
} ) ;
399
399
@@ -439,7 +439,7 @@ define([
439
439
} ;
440
440
datastore . create ( metadata , function ( ) {
441
441
console . log ( "export done." ) ;
442
- humane . log ( webL10n . get ( "Pdf" ) ) ;
442
+ humane . log ( l10n . get ( "Pdf" ) ) ;
443
443
} , inputData ) ;
444
444
} ) ;
445
445
} ) ;
@@ -466,7 +466,7 @@ define([
466
466
} ;
467
467
datastore . create ( metadata , function ( ) {
468
468
console . log ( "export done." ) ;
469
- humane . log ( webL10n . get ( "Doc" ) ) ;
469
+ humane . log ( l10n . get ( "Doc" ) ) ;
470
470
} , inputData ) ;
471
471
} ) ;
472
472
@@ -488,7 +488,7 @@ define([
488
488
} ;
489
489
datastore . create ( metadata , function ( ) {
490
490
console . log ( "export done." ) ;
491
- humane . log ( webL10n . get ( "Odt" ) ) ;
491
+ humane . log ( l10n . get ( "Odt" ) ) ;
492
492
resetXML ( ) ;
493
493
} , inputData ) ;
494
494
@@ -615,13 +615,13 @@ define([
615
615
console . log ( connectedPeople [ key ] . name , key , connectedPeople [ key ] . networkId ) ;
616
616
}
617
617
if ( msg . move == 1 ) {
618
- humane . log ( html + webL10n . get ( "PlayerJoin" , { user : userName } ) ) ;
618
+ humane . log ( html + l10n . get ( "PlayerJoin" , { user : userName } ) ) ;
619
619
var c = cursors . createCursor ( msg . user . networkId , userName , msg . user . colorvalue . stroke ) ;
620
620
if ( myid == msg . user . networkId ) { mycursor = c ; }
621
621
}
622
622
if ( msg . move === - 1 ) {
623
623
cursors . removeCursor ( msg . user . networkId ) ;
624
- humane . log ( html + webL10n . get ( "PlayerLeave" , { user : userName } ) ) ;
624
+ humane . log ( html + l10n . get ( "PlayerLeave" , { user : userName } ) ) ;
625
625
if ( msg . user . networkId == connectedPeople [ 0 ] . networkId ) {
626
626
if ( connectedPeople [ 1 ] . networkId == myid ) {
627
627
document . getElementById ( 3 ) . style . display = "inline" ;
0 commit comments