Documentation Index
Fetch the complete documentation index at: https://docs.zopio.dev/llms.txt
Use this file to discover all available pages before exploring further.
View Internationalization
The View package includes comprehensive internationalization support, allowing you to create multilingual UI components.Overview
The View package’s internationalization features include:- Integration with next-intl for translations
- Support for multiple locales (English, Turkish, Spanish, German)
- Translation files for all view components
- Hooks for accessing translations in React components
- Automatic locale detection and switching
Configuration
The View package uses the same internationalization configuration as the rest of the framework:Translation Files
Translation files are stored in both thedictionaries/ and locales/ directories:
API Reference
useViewTranslations
Hook for accessing translations in React components.
setViewLocale
Function for setting the current locale.
getViewLocale
Function for getting the current locale.
withViewTranslations
Higher-order component for providing translations to components.
Examples
Using useViewTranslations in a Component
Using Translations with Parameters
Setting the Locale
Using withViewTranslations HOC
Integration with Next.js
The View package integrates with Next.js internationalization using next-international and next-intl:Adding New Translations
To add translations for a new key:- Add the key to all locale files (
en.json,tr.json,es.json,de.json) - Use the key in your components with
useViewTranslations
Adding Support for New Languages
To add support for a new language:- Create a new locale file in the
locales/directory (e.g.,fr.json) - Add the locale to the supported locales in the configuration
- Translate all keys from the English locale file