export default { name: 'RenderingCanvasViewDropdown', template: `
`, props: { renderingCanvas: { type: Object, default: null }, useBootstrap: { type: Boolean, default: false }, locale: { type: String, default: 'zh-TW' } }, computed: { canvasReady() { return this.renderingCanvas && this.renderingCanvas.isInitialized && this.renderingCanvas.isConnected; }, // Localization viewLabel() { return this.getLocalizedText('view', 'θ¦–εœ–'); }, frontLabel() { return this.getLocalizedText('front', 'ε‰θ¦–εœ–'); }, backLabel() { return this.getLocalizedText('back', 'εΎŒθ¦–εœ–'); }, leftLabel() { return this.getLocalizedText('left', 'ε·¦θ¦–εœ–'); }, rightLabel() { return this.getLocalizedText('right', 'ε³θ¦–εœ–'); }, topLabel() { return this.getLocalizedText('top', 'ι ‚θ¦–εœ–'); }, bottomLabel() { return this.getLocalizedText('bottom', 'εΊ•θ¦–εœ–'); }, isometricLabel() { return this.getLocalizedText('isometric', 'η­‰θ§’θ¦–εœ–'); }, homeLabel() { return this.getLocalizedText('home', 'δΈ»θ¦–εœ–'); } }, methods: { async setView(viewType) { if (this.renderingCanvas && this.renderingCanvas.setView) { try { await this.renderingCanvas.setView(viewType); } catch (err) { console.error(`Failed to set view: ${err}`); } } else { console.warn('No rendering canvas component provided or setView method not available'); } }, getLocalizedText(key, defaultText) { // Simple localization - can be extended with actual i18n library const translations = { 'en-US': { view: 'View', front: 'Front', back: 'Back', left: 'Left', right: 'Right', top: 'Top', bottom: 'Bottom', isometric: 'Isometric', home: 'Home' }, 'zh-TW': { view: 'θ¦–εœ–', front: 'ε‰θ¦–εœ–', back: 'εΎŒθ¦–εœ–', left: 'ε·¦θ¦–εœ–', right: 'ε³θ¦–εœ–', top: 'ι ‚θ¦–εœ–', bottom: 'εΊ•θ¦–εœ–', isometric: 'η­‰θ§’θ¦–εœ–', home: 'δΈ»θ¦–εœ–' } }; const localeTranslations = translations[this.locale] || translations['zh-TW']; return localeTranslations[key] || defaultText; } } }