From 76a63da30586ce8b7c346ba5d752630a3bd6b673 Mon Sep 17 00:00:00 2001 From: Yi-Ting Tu Date: Sat, 19 Aug 2023 15:02:47 -0400 Subject: [PATCH] Improve 'filter' option UI and corresponding locale strings --- cn/index.html | 2 +- index.html | 2 +- simulator/js/simulator.js | 37 +++++++++++++++++++++-------------- simulator/locales/de.js | 2 +- simulator/locales/en.js | 2 +- simulator/locales/fr.js | 2 +- simulator/locales/ja.js | 2 +- simulator/locales/nl.js | 2 +- simulator/locales/pl.js | 2 +- simulator/locales/ru.js | 2 +- simulator/locales/template.js | 2 +- simulator/locales/zh_CN.js | 2 +- simulator/locales/zh_TW.js | 2 +- tw/index.html | 2 +- 14 files changed, 35 insertions(+), 28 deletions(-) diff --git a/cn/index.html b/cn/index.html index 8ef1bf7c..e118f306 100644 --- a/cn/index.html +++ b/cn/index.html @@ -346,7 +346,7 @@

视图

模拟色彩

-模拟光源的颜色(波长)、混色与透光物的色散。 +模拟光源的颜色(波长)、混色、滤光,以及透光物的色散。
diff --git a/index.html b/index.html index 87eb5837..e5e608fa 100644 --- a/index.html +++ b/index.html @@ -403,7 +403,7 @@

Views

Simulate Colors

-Simulate colors (wavelengths) of light sources, mixture of colors, and chromatic dispersion of glasses. +Simulate colors (wavelengths) of light sources, mixture of colors, color filtering, and chromatic dispersion of glasses.
diff --git a/simulator/js/simulator.js b/simulator/js/simulator.js index 4acbaaa4..a93633a7 100644 --- a/simulator/js/simulator.js +++ b/simulator/js/simulator.js @@ -606,24 +606,31 @@ function shootWaitingRays() { //Optical Filter Settings function dichroicSettings(obj, elem){ - if (colorMode && createAdvancedOptions(obj.isDichroic)) { + if (colorMode) { createBooleanAttr(getMsg('filter'), obj.isDichroic, function(obj, value) { - obj.isDichroic = value; - obj.wavelength = obj.wavelength || GREEN_WAVELENGTH; - obj.isDichroicFilter = obj.isDichroicFilter || false; - obj.bandwidth = obj.bandwidth || 10 - }, elem); - createBooleanAttr(getMsg('invert'), obj.isDichroicFilter, function(obj, value) { - if(obj.isDichroic){ - obj.isDichroicFilter = value; + obj.isDichroic = value; + obj.wavelength = obj.wavelength || GREEN_WAVELENGTH; + obj.isDichroicFilter = obj.isDichroicFilter || false; + obj.bandwidth = obj.bandwidth || 10 + if (obj == objs[selectedObj]) { + cartesianSign = value; + localStorage.rayOpticsCartesianSign = value?"true":"false"; + selectObj(selectedObj); } }, elem); - createNumberAttr(getMsg('wavelength'), UV_WAVELENGTH, INFRARED_WAVELENGTH, 1, obj.wavelength || GREEN_WAVELENGTH, function(obj, value) { - obj.wavelength = value; - }, elem); - createNumberAttr("± " + getMsg('bandwidth'), 0, (INFRARED_WAVELENGTH - UV_WAVELENGTH) , 1, obj.bandwidth || 10, function(obj, value) { - obj.bandwidth = value; - }, elem); + if (obj.isDichroic) { + createBooleanAttr(getMsg('invert'), obj.isDichroicFilter, function(obj, value) { + if(obj.isDichroic){ + obj.isDichroicFilter = value; + } + }, elem); + createNumberAttr(getMsg('wavelength'), UV_WAVELENGTH, INFRARED_WAVELENGTH, 1, obj.wavelength || GREEN_WAVELENGTH, function(obj, value) { + obj.wavelength = value; + }, elem); + createNumberAttr("± " + getMsg('bandwidth'), 0, (INFRARED_WAVELENGTH - UV_WAVELENGTH) , 1, obj.bandwidth || 10, function(obj, value) { + obj.bandwidth = value; + }, elem); + } } } diff --git a/simulator/locales/de.js b/simulator/locales/de.js index dd660230..4d4278e9 100644 --- a/simulator/locales/de.js +++ b/simulator/locales/de.js @@ -516,7 +516,7 @@ locales["de"] = { }, "color_mode_popover": { "incomplete": true, - "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." + "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." }, "rayDensity_popover": { "message": "Gibt die Dichte der Lichtstrahlen für die Simulation an. Logarithmische Skala." diff --git a/simulator/locales/en.js b/simulator/locales/en.js index 036474b6..52272d44 100644 --- a/simulator/locales/en.js +++ b/simulator/locales/en.js @@ -502,7 +502,7 @@ locales["en"] = { "message": "Simulate the rays and images seen from some position. The blue circle is the observer. Any rays crossing it are considered to be 'observed'. The observer does not know where the rays actually begin, but may think they begin at some point(s) if they intersect there. The rays are shown in blue, and the points in yellow (real) or orange (virtual). (Drag the big blue dot to move the observer.)
When 'Simulate Colors' is on, they are shown in source colors instead." }, "color_mode_popover": { - "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." + "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." }, "rayDensity_popover": { "message": "Decides how dense should the lights be simulated. The number is in log scale." diff --git a/simulator/locales/fr.js b/simulator/locales/fr.js index 651be8a6..c356643e 100644 --- a/simulator/locales/fr.js +++ b/simulator/locales/fr.js @@ -573,7 +573,7 @@ locales["fr"] = { }, "color_mode_popover": { "incomplete": true, - "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." + "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." }, "rayDensity_popover": { "incomplete": true, diff --git a/simulator/locales/ja.js b/simulator/locales/ja.js index 6e1c0b64..b2cba504 100644 --- a/simulator/locales/ja.js +++ b/simulator/locales/ja.js @@ -670,7 +670,7 @@ locales["ja"] = { }, "color_mode_popover": { "incomplete": true, - "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." + "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." }, "rayDensity_popover": { "incomplete": false, diff --git a/simulator/locales/nl.js b/simulator/locales/nl.js index b168c74e..f1a4e7e0 100644 --- a/simulator/locales/nl.js +++ b/simulator/locales/nl.js @@ -589,7 +589,7 @@ locales["nl"] = { }, "color_mode_popover": { "incomplete": true, - "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." + "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." }, "rayDensity_popover": { "incomplete": true, diff --git a/simulator/locales/pl.js b/simulator/locales/pl.js index afb40253..878f4eac 100644 --- a/simulator/locales/pl.js +++ b/simulator/locales/pl.js @@ -514,7 +514,7 @@ locales["pl"] = { }, "color_mode_popover": { "incomplete": true, - "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." + "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." }, "rayDensity_popover": { "message": "Decyduje o tym, jaka ma być gęstość promieni symulowanego światła. Liczba jest w skali logarytmicznej." diff --git a/simulator/locales/ru.js b/simulator/locales/ru.js index 86f5472f..9341392b 100644 --- a/simulator/locales/ru.js +++ b/simulator/locales/ru.js @@ -576,7 +576,7 @@ locales["ru"] = { }, "color_mode_popover": { "incomplete": true, - "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." + "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." }, "rayDensity_popover": { "incomplete": true, diff --git a/simulator/locales/template.js b/simulator/locales/template.js index 9f6e7501..9612f61d 100644 --- a/simulator/locales/template.js +++ b/simulator/locales/template.js @@ -670,7 +670,7 @@ locales["LOCALE_ID"] = { }, "color_mode_popover": { "incomplete": true, - "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filter (advanced option in mirrors) and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." + "message": "Simulate colors (wavelengths) of light sources, mixture of colors, color filtering of blockers and mirrors, and chromatic dispersion of glasses. You can set those parameters for those objects when selected. To simulate color spectra, overlap rays with different wavelengths. The colors shown on the screen are only rough approximations, and can be very inaccurate when 'Ray density' is too high or too low." }, "rayDensity_popover": { "incomplete": true, diff --git a/simulator/locales/zh_CN.js b/simulator/locales/zh_CN.js index b7e7e66b..19705428 100644 --- a/simulator/locales/zh_CN.js +++ b/simulator/locales/zh_CN.js @@ -502,7 +502,7 @@ locales["zh-CN"] = { "message": "模拟从某位置见到的光线与像。蓝色圆形为观察者,与其相交的光线被其「观察」到。观察者无法知道光线真正的起始位置,但若其在某处相交,它会认为光线是从该处来的。光线以蓝色表示,相交处以黄色(实像)或橘色(虚像)表示。 (拖曳大蓝点以移动观察者。)
若使用「模拟色彩」,则改以光源颜色显示。" }, "color_mode_popover": { - "message": "模拟光源的颜色(波长)、混色、滤光(镜子的进阶选项)与透光物的色散。选取物件后可调整这些参数。重叠多条不同波长的光线可用于模拟光谱。屏幕显示之颜色仅为粗略近似,且当「光线密度」太高或太低时可能非常不准确。" + "message": "模拟光源的颜色(波长)、混色、遮光物与镜子的滤光,以及透光物的色散。选取物件后可调整这些参数。重叠多条不同波长的光线可用于模拟光谱。屏幕显示之颜色仅为粗略近似,且当「光线密度」太高或太低时可能非常不准确。" }, "rayDensity_popover": { "message": "决定光线模拟的密度。数值为对数刻度。" diff --git a/simulator/locales/zh_TW.js b/simulator/locales/zh_TW.js index c4a8a61c..7a8bfc32 100644 --- a/simulator/locales/zh_TW.js +++ b/simulator/locales/zh_TW.js @@ -502,7 +502,7 @@ locales["zh-TW"] = { "message": "模擬從某位置見到的光線與像。藍色圓形為觀察者,與其相交的光線被其「觀察」到。觀察者無法知道光線真正的起始位置,但若其在某處相交,它會認為光線是從該處來的。光線以藍色表示,相交處以黃色(實像)或橘色(虛像)表示。(拖曳大藍點以移動觀察者。)
若使用「模擬色彩」,則改以光源顏色顯示。" }, "color_mode_popover": { - "message": "模擬光源的顏色(波長)、混色、濾光(鏡子的進階選項)與透光物的色散。選取物件後可調整這些參數。重疊多條不同波長的光線可用於模擬光譜。螢幕顯示之顏色僅為粗略近似,且當「光線密度」太高或太低時可能非常不準確。" + "message": "模擬光源的顏色(波長)、混色、遮光物與鏡子的濾光,以及透光物的色散。選取物件後可調整這些參數。重疊多條不同波長的光線可用於模擬光譜。螢幕顯示之顏色僅為粗略近似,且當「光線密度」太高或太低時可能非常不準確。" }, "rayDensity_popover": { "message": "決定光線模擬的密度。數值為對數刻度。" diff --git a/tw/index.html b/tw/index.html index 4c955124..c0e31c31 100644 --- a/tw/index.html +++ b/tw/index.html @@ -347,7 +347,7 @@

呈現方式

模擬色彩

-模擬光源的顏色(波長)、混色與透光物的色散。 +模擬光源的顏色(波長)、混色、濾光,以及透光物的色散。