🌐 Add theme tab translation keys (#1119)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Implemented internationalization across various components, enabling
dynamic language translation for UI elements.

- **Enhancements**
	- Improved accessibility with translated `aria-label` attributes.
	- Enhanced user interface with translated button texts and labels.

- **Refactor**
	- Streamlined translation handling with the `useTranslate` hook.

- **Bug Fixes**
	- Corrected tooltip label for better clarity.

- **Style**
	- Updated visual elements to reflect changes in language settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
This commit is contained in:
Gabriel Pavão
2023-12-29 08:02:14 -03:00
committed by GitHub
parent f26eafd26f
commit 5fbbe9d86e
23 changed files with 186 additions and 62 deletions

View File

@@ -3,6 +3,7 @@ import { ThemeTemplate } from '@typebot.io/schemas'
import { useState } from 'react'
import { MyTemplates } from './MyTemplates'
import { TemplatesGallery } from './TemplatesGallery'
import { useTranslate } from '@tolgee/react'
type Tab = 'my-templates' | 'gallery'
@@ -21,6 +22,8 @@ export const ThemeTemplates = ({
currentTheme,
onTemplateSelect,
}: Props) => {
const { t } = useTranslate()
const [selectedTab, setSelectedTab] = useState<Tab>('my-templates')
return (
@@ -32,7 +35,7 @@ export const ThemeTemplates = ({
colorScheme={selectedTab === 'my-templates' ? 'blue' : 'gray'}
onClick={() => setSelectedTab('my-templates')}
>
My templates
{t('theme.sideMenu.template.myTemplates')}
</Button>
<Button
flex="1"
@@ -40,7 +43,7 @@ export const ThemeTemplates = ({
colorScheme={selectedTab === 'gallery' ? 'blue' : 'gray'}
onClick={() => setSelectedTab('gallery')}
>
Gallery
{t('theme.sideMenu.template.gallery')}
</Button>
</HStack>
<ThemeTemplatesBody