From 946beae9b9152964c14ef51407aa863813c54d05 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 18:10:43 +0000 Subject: [PATCH] Translate Zernike flip and copy buttons via locales system Added flipX, flipY, flipZ, copyCoefficients keys to both EN and RU locales, and updated SurfaceActionButtons to use t.properties instead of hardcoded English strings. https://claude.ai/code/session_01P38ZLcmoFWti1EiwZJW28G --- src/components/ui/SurfaceActionButtons.js | 8 ++++---- src/constants/locales.js | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/ui/SurfaceActionButtons.js b/src/components/ui/SurfaceActionButtons.js index 0d17be9..a995eb8 100644 --- a/src/components/ui/SurfaceActionButtons.js +++ b/src/components/ui/SurfaceActionButtons.js @@ -76,7 +76,7 @@ export const SurfaceActionButtons = ({ surface, onInvert, onNormalizeUnZ, onConv onMouseEnter: (e) => e.target.style.backgroundColor = '#3a7bc8', onMouseLeave: (e) => e.target.style.backgroundColor = c.accent, title: 'Create a new surface with Zernike coefficients mirrored about the X-axis (y → -y)' - }, 'Flip around X'), + }, t.properties.flipX), surface.type === 'Zernike' && h('button', { onClick: onFlipY, @@ -84,7 +84,7 @@ export const SurfaceActionButtons = ({ surface, onInvert, onNormalizeUnZ, onConv onMouseEnter: (e) => e.target.style.backgroundColor = '#3a7bc8', onMouseLeave: (e) => e.target.style.backgroundColor = c.accent, title: 'Create a new surface with Zernike coefficients mirrored about the Y-axis (x → -x)' - }, 'Flip around Y'), + }, t.properties.flipY), surface.type === 'Zernike' && h('button', { onClick: onFlipZ, @@ -92,7 +92,7 @@ export const SurfaceActionButtons = ({ surface, onInvert, onNormalizeUnZ, onConv onMouseEnter: (e) => e.target.style.backgroundColor = '#3a7bc8', onMouseLeave: (e) => e.target.style.backgroundColor = c.accent, title: 'Create a new surface with Zernike coefficients rotated 180° about the Z-axis (x → -x, y → -y)' - }, 'Flip around Z'), + }, t.properties.flipZ), surface.type === 'Zernike' && h('button', { onClick: onCopyCoefficients, @@ -100,7 +100,7 @@ export const SurfaceActionButtons = ({ surface, onInvert, onNormalizeUnZ, onConv onMouseEnter: (e) => e.target.style.backgroundColor = '#3a7bc8', onMouseLeave: (e) => e.target.style.backgroundColor = c.accent, title: 'Copy Z1-Z37 values as tab-separated text for pasting into Excel' - }, 'Copy Coefficients'), + }, t.properties.copyCoefficients), // Convert to Poly button - shown only for Opal Un Z surface.type === 'Opal Un Z' && h('button', { diff --git a/src/constants/locales.js b/src/constants/locales.js index af45ad1..fc0dc24 100644 --- a/src/constants/locales.js +++ b/src/constants/locales.js @@ -81,6 +81,10 @@ export const locales = { normalize: 'Normalize Un Z', convertToUnZ: 'Convert to Un Z', convertToPoly: 'Convert to Poly', + flipX: 'Flip around X', + flipY: 'Flip around Y', + flipZ: 'Flip around Z', + copyCoefficients: 'Copy Coefficients', // Metrics paraxialFNum: 'Paraxial F/#', @@ -490,6 +494,10 @@ export const locales = { normalize: 'Нормализовать H', convertToUnZ: 'Конвертировать в Универсальное от Z', convertToPoly: 'Конвертировать в Полином', + flipX: 'Отразить по X', + flipY: 'Отразить по Y', + flipZ: 'Отразить по Z', + copyCoefficients: 'Копировать коэффициенты', // Метрики paraxialFNum: 'Параксиальное F/#',