-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(i18n): Integrate next-intl, localize core UI, add regional locales. #852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…es and zh-TW Discover sources **Overview** - Integrates next-intl (App Router, no i18n routing) with cookie-based locale and Accept-Language fallback. - Adds message bundles and regional variants; sets en-US as the default. **Key changes** - i18n foundation - Adds request-scoped config to load messages per locale and injects NextIntlClientProvider in [layout.tsx] - Adds/updates messages for: en-US, en-GB, zh-TW, zh-HK, zh-CN, ja, ko, fr-FR, fr-CA, de. Centralizes LOCALES, LOCALE_LABELS, and DEFAULT_LOCALE in [locales.ts] - Adds LocaleSwitcher (cookie-based) and [LocaleBootstrap] - Pages and components - Localizes Sidebar, Home (including metadata/manifest), Settings, Discover, Library. - Localizes common components: MessageInput, Attach, Focus, Optimization, MessageBox, MessageSources, SearchImages, SearchVideos, EmptyChat, NewsArticleWidget, WeatherWidget. - APIs - Weather API returns localized condition strings server-side. - UX and quality - Converts all remaining <img> to Next Image. - Updates browserslist/caniuse DB to silence warnings. - Security: Settings API Key inputs are now password fields and placeholders were removed.
…dling and formatting instructions - Updated academicSearch, redditSearch, webSearch, wolframAlpha, writingAssistant, and youtubeSearch prompts to improve clarity and consistency in formatting instructions. - Added language handling instructions to writingAssistant and other prompts for better localization support. - Modified MetaSearchAgent to include locale and language parameters for improved prompt generation and language-specific responses. # Conflicts: # Dockerfile
…proved performance
wei840222
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self reviewed
|
LGTM |
|
I'll test the changes in the prompt with different locales and merge it afterwards |
|
@ItzCrazyKns Thank you! |
|
resolve conflict |
|
Hey, extremely sorry!! I was aggressively working on this new update. Let us get this resolved, we'll merge it. |
|
sure, I can help resolved the conflict. |
# Conflicts: # src/app/api/chat/route.ts # src/app/api/search/route.ts # src/app/api/suggestions/route.ts # src/app/discover/page.tsx # src/app/layout.tsx # src/app/page.tsx # src/app/settings/page.tsx # src/components/EmptyChat.tsx # src/components/EmptyChatMessageInput.tsx # src/components/MessageActions/Copy.tsx # src/components/MessageBox.tsx # src/components/MessageInputActions/Attach.tsx # src/components/MessageInputActions/Focus.tsx # src/components/MessageInputActions/Optimization.tsx # src/components/Navbar.tsx # src/components/NewsArticleWidget.tsx # src/components/Sidebar.tsx # src/components/WeatherWidget.tsx # src/lib/actions.ts # src/lib/hooks/useChat.tsx # src/lib/prompts/academicSearch.ts # src/lib/prompts/redditSearch.ts # src/lib/prompts/wolframAlpha.ts # src/lib/prompts/youtubeSearch.ts # yarn.lock
- Added LocaleSwitcher component to General settings section for language selection. - Integrated translations for various settings fields and dialogs, improving localization support. - Updated UIConfigField definitions to simplify options handling. - Refactored provider dialogs to utilize translations for user feedback messages. - Improved measurement unit handling in WeatherWidget component. - Cleaned up unused properties in provider configuration fields across multiple providers. - Ensured consistent naming and descriptions in the settings UI for better user experience.
- Updated settings structure in en-GB, en-US, fr-CA, fr-FR, ja, ko, zh-CN, and zh-HK JSON files. - Consolidated preferences, automatic search, and system instructions into a more organized format. - Added new sections for general settings, model management, and search settings. - Enhanced descriptions and placeholders for better user guidance. - Improved consistency across different language files.
|
@ItzCrazyKns Hi, I resolved the conflict, plz review. thx |
Resolve issue #738
Overview
Key changes
i18n foundation
Centralizes LOCALES, LOCALE_LABELS, and DEFAULT_LOCALE in [locales.ts]
Added language handling instructions to writingAssistant and other prompts for better localization support.
Modified MetaSearchAgent to include locale and language parameters for improved prompt generation and language-specific responses.
Pages and components
APIs
UX and quality