Skip to content

Add comprehensive i18n documentation#36

Open
konard wants to merge 3 commits intoivansglazunov:mainfrom
konard:issue-15-b2fa0622
Open

Add comprehensive i18n documentation#36
konard wants to merge 3 commits intoivansglazunov:mainfrom
konard:issue-15-b2fa0622

Conversation

@konard
Copy link

@konard konard commented Oct 26, 2025

Summary

This PR adds comprehensive documentation for the i18n (internationalization) implementation in Hasyx, addressing issue #15.

What's Included

  • Complete I18N.md documentation covering all aspects of the i18n system
  • Detailed API reference for hooks, functions, and components
  • Quick start guide with examples for both client and server components
  • Migration guide for converting existing components to use i18n
  • Best practices and troubleshooting section
  • Guide for adding new languages to the system

Current i18n Implementation Status

The i18n implementation in Hasyx is already complete on the main branch, with:

next-intl integration configured in next.config.ts
Two languages supported: English (en) and Russian (ru)
661+ translation keys in i18n/en.json
663+ translation keys in i18n/ru.json
All major components migrated (see translations.md checklist)
Client-side locale switching via LocaleSwitcher component
Type-safe translations with TypeScript support
Organized namespaces (common, auth, files, messaging, etc.)

Key Features Documented

  1. Configuration

    • Environment variable setup (NEXT_PUBLIC_LOCALE)
    • Next.js plugin configuration
    • Request configuration with timezone support
  2. API Reference

    • useTranslations() - Client-side hook for translations
    • useLocale() - Get/set current locale
    • getLocale() - Get default locale from env
    • i18nMessages() - Get all messages for a locale
    • LocaleSwitcher - Component for switching languages
  3. Available Namespaces

    • common, config, actions, errors, success
    • auth, session, jwt
    • files, messaging, notifications, payments
    • entities (users, accounts, groups, etc.)
    • and more...
  4. Developer Guides

    • How to use translations in client components
    • How to use translations in server components
    • Adding new translation keys
    • Adding support for new languages
    • Migration guide for existing components
  5. Troubleshooting

    • Common issues and solutions
    • Translation key errors
    • TypeScript configuration

Files Changed

  • I18N.md - New comprehensive documentation (401 lines)

Testing

The i18n system is already fully functional in the main branch:

  • All components use the useTranslations hook
  • Locale switching works dynamically
  • Both English and Russian translations are complete
  • See translations.md for the complete migration checklist

Documentation Access

Users can access the documentation at:

  • Repository: I18N.md in the root directory
  • Link to translation checklist: translations.md

Fixes #15


🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: undefined
@vercel
Copy link

vercel bot commented Oct 26, 2025

@konard is attempting to deploy a commit to the ivansglazunov's projects Team on Vercel.

A member of the Team first needs to authorize it.

- Document all i18n features and configuration
- Include quick start guide and API reference
- Add migration guide for converting components
- Document available namespaces and best practices
- Include troubleshooting section
- Add guide for adding new languages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Localization i18n Add comprehensive i18n documentation Oct 26, 2025
Task completed - comprehensive i18n documentation added.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard marked this pull request as ready for review October 26, 2025 15:59
@konard
Copy link
Author

konard commented Oct 26, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

📎 Log file uploaded as GitHub Gist (293KB)
🔗 View complete solution draft log


Now working session is ended, feel free to review and add any feedback on the solution draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Localization i18n

1 participant