@@ -6,6 +6,7 @@ import { ShowMessageDialog } from './dialogs.js';
6
6
import { ButtonDialog } from './dialog.js' ;
7
7
import { CopyToClipboard } from './utils.js' ;
8
8
import { HandleEvent } from './eventhandler.js' ;
9
+ import { Loc } from '../engine/core/localization.js' ;
9
10
10
11
export function ShowSharingDialog ( fileList , settings , viewer )
11
12
{
@@ -19,8 +20,8 @@ export function ShowSharingDialog (fileList, settings, viewer)
19
20
20
21
function AddCopyableTextInput ( parentDiv , getText )
21
22
{
22
- let copyText = 'Copy' ;
23
- let copiedText = 'Copied' ;
23
+ let copyText = Loc ( 'Copy' ) ;
24
+ let copiedText = Loc ( 'Copied' ) ;
24
25
let container = AddDiv ( parentDiv , 'ov_dialog_copyable_input' ) ;
25
26
let input = AddDomElement ( container , 'input' , null ) ;
26
27
input . setAttribute ( 'type' , 'text' ) ;
@@ -47,7 +48,7 @@ export function ShowSharingDialog (fileList, settings, viewer)
47
48
}
48
49
49
50
let section = AddDiv ( parentDiv , 'ov_dialog_section' ) ;
50
- AddDiv ( section , 'ov_dialog_inner_title' , 'Sharing Link' ) ;
51
+ AddDiv ( section , 'ov_dialog_inner_title' , Loc ( 'Sharing Link' ) ) ;
51
52
let sharingLinkInput = AddCopyableTextInput ( section , ( ) => {
52
53
HandleEvent ( 'model_shared' , 'sharing_link' ) ;
53
54
return GetSharingLink ( modelFiles ) ;
@@ -88,13 +89,13 @@ export function ShowSharingDialog (fileList, settings, viewer)
88
89
let useCurrentSettings = true ;
89
90
let section = AddDiv ( parentDiv , 'ov_dialog_section' ) ;
90
91
section . style . marginTop = '20px' ;
91
- AddDiv ( section , 'ov_dialog_inner_title' , 'Embedding Code' ) ;
92
+ AddDiv ( section , 'ov_dialog_inner_title' , Loc ( 'Embedding Code' ) ) ;
92
93
let optionsSection = AddDiv ( section , 'ov_dialog_section' ) ;
93
94
let embeddingCodeInput = AddCopyableTextInput ( section , ( ) => {
94
95
HandleEvent ( 'model_shared' , 'embedding_code' ) ;
95
96
return GetEmbeddingCode ( modelFiles , useCurrentSettings , settings , viewer ) ;
96
97
} ) ;
97
- AddCheckboxLine ( optionsSection , 'Use customized settings' , 'embed_current_settings' , ( checked ) => {
98
+ AddCheckboxLine ( optionsSection , Loc ( 'Use customized settings' , 'embed_current_settings' ) , ( checked ) => {
98
99
useCurrentSettings = checked ;
99
100
embeddingCodeInput . value = GetEmbeddingCode ( modelFiles , useCurrentSettings , settings , viewer ) ;
100
101
} ) ;
@@ -104,8 +105,8 @@ export function ShowSharingDialog (fileList, settings, viewer)
104
105
105
106
if ( ! fileList . IsOnlyUrlSource ( ) ) {
106
107
return ShowMessageDialog (
107
- 'Sharing Failed' ,
108
- 'Sharing works only if you load files by url. Please upload your model files to a web server, open them by url, and try embedding again.' ,
108
+ Loc ( 'Sharing Failed' ) ,
109
+ Loc ( 'Sharing works only if you load files by url. Please upload your model files to a web server, open them by url, and try embedding again.' ) ,
109
110
null
110
111
) ;
111
112
}
@@ -120,9 +121,9 @@ export function ShowSharingDialog (fileList, settings, viewer)
120
121
}
121
122
122
123
let dialog = new ButtonDialog ( ) ;
123
- let contentDiv = dialog . Init ( 'Share' , [
124
+ let contentDiv = dialog . Init ( Loc ( 'Share' ) , [
124
125
{
125
- name : 'Close' ,
126
+ name : Loc ( 'Close' ) ,
126
127
onClick ( ) {
127
128
dialog . Close ( ) ;
128
129
}
0 commit comments