diff --git a/locales/en.yml b/locales/en.yml index 4982dc53..0feb50b4 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -1,3 +1,26 @@ home: + commandPalette: + search: Search... + placeholder: Type to search a tool or a command... + commandPaletteStore: + actions: Actions + external: External + tools: Tools categories: - newestTools: "Newest tools" + newestTools: Newest tools + title: IT Tools - Handy online tools for developers + allTools: All the tools + favoriteTools: Your favorite tools + thanks: '! Thank you' + giveUsAStarOn: Give us a star on + orFollowUsOn: or follow us on + youLikeItTools: You like it-tools? +tools: + xmlFormat: + description: Prettify your XML string to a human friendly readable format. + indentSize: 'Indent size:' + collapseContent: 'Collapse content:' + providedXmlIsNotValid: Provided XML is not valid. + inputLabel: Your XML + outputLabel: Formatted XML from your XML + placeHolder: Paste your XML here... diff --git a/locales/es.yml b/locales/es.yml new file mode 100644 index 00000000..855d4f45 --- /dev/null +++ b/locales/es.yml @@ -0,0 +1,26 @@ +home: + commandPalette: + search: Buscar... + placeholder: Escribe para buscar una herramienta o comando... + commandPaletteStore: + actions: Acciones + external: Externa + tools: Herramientas + categories: + newestTools: Herramientas Nuevas + title: 'IT Tools - Prácticas herramientas en línea para desarrolladores.' + allTools: Todas las herramientas + favoriteTools: Tus herramientas favorias + thanks: '! Thank you' + giveUsAStarOn: Give us a star on + orFollowUsOn: or follow us on + youLikeItTools: You like it-tools? +tools: + xmlFormat: + description: Embellece tu XML a un formato XML más amigable. + indentSize: 'Tamaño de indentación:' + collapseContent: 'Colapsar contenido:' + providedXmlIsNotValid: El XML proporcionado no es válido. + inputLabel: Tu XML + outputLabel: XML Formateado desde tu XML + placeHolder: Pega tu XML aquí... diff --git a/src/components/ToolCard.vue b/src/components/ToolCard.vue index 00f22466..5ffeae96 100644 --- a/src/components/ToolCard.vue +++ b/src/components/ToolCard.vue @@ -8,6 +8,8 @@ const props = defineProps<{ tool: Tool & { category: string } }>(); const { tool } = toRefs(props); const theme = useThemeVars(); +const { t } = useI18n(); + const appTheme = useAppTheme(); @@ -38,7 +40,7 @@ const appTheme = useAppTheme();
- {{ tool.description }} + {{ t(tool.description) }}
 
diff --git a/src/layouts/base.layout.vue b/src/layouts/base.layout.vue index 36edd77d..a80505ff 100644 --- a/src/layouts/base.layout.vue +++ b/src/layouts/base.layout.vue @@ -7,6 +7,7 @@ import { Heart, Home2, Menu2 } from '@vicons/tabler'; import HeroGradient from '../assets/hero-gradient.svg?component'; import MenuLayout from '../components/MenuLayout.vue'; import NavbarButtons from '../components/NavbarButtons.vue'; +import { availableLocales, loadLanguageAsync } from '../plugins/i18n.plugin'; import { toolsByCategory } from '@/tools'; import { useStyleStore } from '@/stores/style.store'; import { config } from '@/config'; @@ -24,10 +25,19 @@ const { tracker } = useTracker(); const toolStore = useToolStore(); +const currentLang = useStorage('application:selected-language', 'en'); + +loadLanguageAsync(currentLang.value); + const tools = computed(() => [ ...(toolStore.favoriteTools.length > 0 ? [{ name: 'Your favorite tools', components: toolStore.favoriteTools }] : []), ...toolsByCategory, ]); + +function onChange(event: any) { + currentLang.value = event; + loadLanguageAsync(event); +}