Browse Source

Editor: i18n (#21454)

heqiang 4 years ago
parent
commit
16e1d2dd29
3 changed files with 34 additions and 6 deletions
  1. 4 2
      editor/js/Menubar.View.js
  2. 6 4
      editor/js/Sidebar.Project.Video.js
  3. 24 0
      editor/js/Strings.js

+ 4 - 2
editor/js/Menubar.View.js

@@ -2,12 +2,14 @@ import { UIPanel, UIRow } from './libs/ui.js';
 
 
 function MenubarView( editor ) {
 function MenubarView( editor ) {
 
 
+	var strings = editor.strings;
+
 	var container = new UIPanel();
 	var container = new UIPanel();
 	container.setClass( 'menu' );
 	container.setClass( 'menu' );
 
 
 	var title = new UIPanel();
 	var title = new UIPanel();
 	title.setClass( 'title' );
 	title.setClass( 'title' );
-	title.setTextContent( 'View' );
+	title.setTextContent( strings.getKey( 'menubar/view' ) );
 	container.add( title );
 	container.add( title );
 
 
 	var options = new UIPanel();
 	var options = new UIPanel();
@@ -18,7 +20,7 @@ function MenubarView( editor ) {
 
 
 	var option = new UIRow();
 	var option = new UIRow();
 	option.setClass( 'option' );
 	option.setClass( 'option' );
-	option.setTextContent( 'Fullscreen' );
+	option.setTextContent( strings.getKey( 'menubar/view/fullscreen' ) );
 	option.onClick( function () {
 	option.onClick( function () {
 
 
 		if ( document.fullscreenElement === null ) {
 		if ( document.fullscreenElement === null ) {

+ 6 - 4
editor/js/Sidebar.Project.Video.js

@@ -4,12 +4,14 @@ import { APP } from './libs/app.js';
 
 
 function SidebarProjectVideo( editor ) {
 function SidebarProjectVideo( editor ) {
 
 
+	var strings = editor.strings;
+
 	var container = new UIPanel();
 	var container = new UIPanel();
 	container.setId( 'render' );
 	container.setId( 'render' );
 
 
 	// Video
 	// Video
 
 
-	container.add( new UIText( 'Video' ).setTextTransform( 'uppercase' ) );
+	container.add( new UIText( strings.getKey( 'sidebar/project/video' ) ) );
 	container.add( new UIBreak(), new UIBreak() );
 	container.add( new UIBreak(), new UIBreak() );
 
 
 	// Resolution
 	// Resolution
@@ -17,7 +19,7 @@ function SidebarProjectVideo( editor ) {
 	var resolutionRow = new UIRow();
 	var resolutionRow = new UIRow();
 	container.add( resolutionRow );
 	container.add( resolutionRow );
 
 
-	resolutionRow.add( new UIText( 'Resolution' ).setWidth( '90px' ) );
+	resolutionRow.add( new UIText( strings.getKey( 'sidebar/project/resolution' ) ).setWidth( '90px' ) );
 
 
 	var videoWidth = new UIInteger( 1024 ).setTextAlign( 'center' ).setWidth( '28px' );
 	var videoWidth = new UIInteger( 1024 ).setTextAlign( 'center' ).setWidth( '28px' );
 	resolutionRow.add( videoWidth );
 	resolutionRow.add( videoWidth );
@@ -35,7 +37,7 @@ function SidebarProjectVideo( editor ) {
 	// Duration
 	// Duration
 
 
 	var videoDurationRow = new UIRow();
 	var videoDurationRow = new UIRow();
-	videoDurationRow.add( new UIText( 'Duration' ).setWidth( '90px' ) );
+	videoDurationRow.add( new UIText( strings.getKey( 'sidebar/project/duration' ) ).setWidth( '90px' ) );
 
 
 	var videoDuration = new UIInteger( 10 );
 	var videoDuration = new UIInteger( 10 );
 	videoDurationRow.add( videoDuration );
 	videoDurationRow.add( videoDuration );
@@ -51,7 +53,7 @@ function SidebarProjectVideo( editor ) {
 	progress.setWidth( '170px' );
 	progress.setWidth( '170px' );
 	container.add( progress );
 	container.add( progress );
 
 
-	const renderButton = new UIButton( 'RENDER' );
+	const renderButton = new UIButton( strings.getKey( 'sidebar/project/render' ) );
 	renderButton.setWidth( '170px' );
 	renderButton.setWidth( '170px' );
 	renderButton.onClick( async () => {
 	renderButton.onClick( async () => {
 
 

+ 24 - 0
editor/js/Strings.js

@@ -71,6 +71,9 @@ function Strings( config ) {
 			'menubar/examples/Pong': 'Pong',
 			'menubar/examples/Pong': 'Pong',
 			'menubar/examples/Shaders': 'Shaders',
 			'menubar/examples/Shaders': 'Shaders',
 
 
+			'menubar/view': 'View',
+			'menubar/view/fullscreen': 'Fullscreen',
+
 			'menubar/help': 'Help',
 			'menubar/help': 'Help',
 			'menubar/help/source_code': 'Source Code',
 			'menubar/help/source_code': 'Source Code',
 			'menubar/help/icons': 'Icon Pack',
 			'menubar/help/icons': 'Icon Pack',
@@ -301,6 +304,11 @@ function Strings( config ) {
 			'sidebar/project/materials': 'Materials',
 			'sidebar/project/materials': 'Materials',
 			'sidebar/project/Assign': 'Assign',
 			'sidebar/project/Assign': 'Assign',
 
 
+			'sidebar/project/video': 'VIDEO',
+			'sidebar/project/resolution': 'Resolution',
+			'sidebar/project/duration': 'Duration',
+			'sidebar/project/render': 'RENDER',
+
 			'sidebar/settings': 'Settings',
 			'sidebar/settings': 'Settings',
 			'sidebar/settings/language': 'Language',
 			'sidebar/settings/language': 'Language',
 			'sidebar/settings/exportPrecision': 'Export Precision',
 			'sidebar/settings/exportPrecision': 'Export Precision',
@@ -398,6 +406,9 @@ function Strings( config ) {
 			'menubar/examples/Pong': 'Pong',
 			'menubar/examples/Pong': 'Pong',
 			'menubar/examples/Shaders': 'Shaders',
 			'menubar/examples/Shaders': 'Shaders',
 
 
+			'menubar/view': 'View',
+			'menubar/view/fullscreen': 'Fullscreen',
+
 			'menubar/help': 'Aide',
 			'menubar/help': 'Aide',
 			'menubar/help/source_code': 'Code Source',
 			'menubar/help/source_code': 'Code Source',
 			'menubar/help/icons': 'Icon Pack',
 			'menubar/help/icons': 'Icon Pack',
@@ -628,6 +639,11 @@ function Strings( config ) {
 			'sidebar/project/materials': 'Matériaux',
 			'sidebar/project/materials': 'Matériaux',
 			'sidebar/project/Assign': 'Attribuer',
 			'sidebar/project/Assign': 'Attribuer',
 
 
+			'sidebar/project/video': 'VIDEO',
+			'sidebar/project/resolution': 'Resolution',
+			'sidebar/project/duration': 'Duration',
+			'sidebar/project/render': 'RENDER',
+
 			'sidebar/settings': 'Paramètres',
 			'sidebar/settings': 'Paramètres',
 			'sidebar/settings/language': 'Langue',
 			'sidebar/settings/language': 'Langue',
 			'sidebar/settings/exportPrecision': 'Précision à l\'exportation',
 			'sidebar/settings/exportPrecision': 'Précision à l\'exportation',
@@ -725,6 +741,9 @@ function Strings( config ) {
 			'menubar/examples/Pong': '乒乓球',
 			'menubar/examples/Pong': '乒乓球',
 			'menubar/examples/Shaders': '着色器',
 			'menubar/examples/Shaders': '着色器',
 
 
+			'menubar/view': '视图',
+			'menubar/view/fullscreen': '全屏',
+
 			'menubar/help': '帮助',
 			'menubar/help': '帮助',
 			'menubar/help/source_code': '源码',
 			'menubar/help/source_code': '源码',
 			'menubar/help/icons': '图标组件包',
 			'menubar/help/icons': '图标组件包',
@@ -939,6 +958,11 @@ function Strings( config ) {
 			'sidebar/project/materials': '材质',
 			'sidebar/project/materials': '材质',
 			'sidebar/project/Assign': '应用',
 			'sidebar/project/Assign': '应用',
 
 
+			'sidebar/project/video': '视频',
+			'sidebar/project/resolution': '分辨率',
+			'sidebar/project/duration': '时长',
+			'sidebar/project/render': '渲染',
+
 			'sidebar/settings': '设置',
 			'sidebar/settings': '设置',
 			'sidebar/settings/language': '语言',
 			'sidebar/settings/language': '语言',
 			'sidebar/settings/exportPrecision': '输出精度',
 			'sidebar/settings/exportPrecision': '输出精度',