Skip to content

feat: Add i18n multi-language support and enhance Twitter settings#126

Merged
lcomplete merged 6 commits intomainfrom
dev
Mar 21, 2026
Merged

feat: Add i18n multi-language support and enhance Twitter settings#126
lcomplete merged 6 commits intomainfrom
dev

Conversation

@lcomplete
Copy link
Copy Markdown
Owner

@lcomplete lcomplete commented Mar 21, 2026

Summary

  • i18n Multi-language Support: Complete internationalization implementation with English and Chinese (zh-CN) translations
  • Twitter Settings Enhancement: Improved Twitter settings management with better save rules configuration
  • Code Cleanup: Removed outdated Copilot instructions document

Key Changes

Internationalization (i18n)

  • Added i18n infrastructure with react-i18next
  • Created comprehensive translation files for:
    • Authentication (auth.json)
    • Common UI elements (common.json)
    • Home page (home.json)
    • Navigation components (navigation.json)
    • Page-related content (page.json)
    • Search functionality (search.json)
    • Settings components (settings.json)
  • Migrated all settings components, navigation, dialogs, and common UI elements to use translations
  • Supports English and Chinese (zh-CN) languages

Twitter Settings

  • Enhanced TwitterSaveRulesSetting component
  • Improved save rules configuration UI

Cleanup

  • Removed .github/copilot-instructions.md (outdated document)

Test plan

  • Verify language switching works correctly in settings
  • Test all i18n translations display properly in both English and Chinese
  • Test Twitter settings save rules functionality
  • Verify navigation labels and menu items display correct translations
  • Test dialog components with translated text

🤖 Generated with Claude Code

lcomplete and others added 6 commits March 17, 2026 04:54
- Add react-i18next, i18next, i18next-browser-languagedetector
- Create i18n initialization with browser language detection
- Add 5 translation namespaces: common, navigation, settings, page, auth
- Add English and Chinese (zh-CN) translation files
- Migrate PrimaryNavigation, SubHeader, NavLabels to i18n
- Migrate SettingModal tabs and GeneralSetting to i18n
- Add language switcher dropdown in Settings > General
- Migrate SignIn page to i18n
feat: add i18n multi-language support (English + Chinese)  添加国际化支持,包含中文翻译
- Introduced a new interface and utility functions for managing Twitter settings in TwitterSaveRulesSetting component.
- Updated validation messages in TwitterSaveRulesSetting to use localized strings.
- Refactored initial values for Twitter settings to utilize the new utility functions.
- Improved user feedback messages for saving Twitter settings.
- Added new localization keys for various settings and navigation labels in English and Chinese.
- Updated collection and sorting labels across multiple components to use localized strings.
- Enhanced error handling and user notifications in XSetting and other components.
@lcomplete lcomplete changed the title feat: Add i18n support, AI enhancements, and multiple feature improvements feat: Add i18n multi-language support and enhance Twitter settings Mar 21, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 21, 2026

🤖 Augment PR Summary

Summary: This PR introduces full client-side internationalization (English + Chinese) and updates large parts of the Huntly UI to use translated strings.

Changes:

  • Added i18n infrastructure using i18next, react-i18next, and browser language detection.
  • Created translation bundles for common, navigation, settings, page, auth, home, and search in en and zh-CN.
  • Migrated navigation, page list/detail UI, search, highlights, and many settings dialogs/pages to use t(...) keys instead of hardcoded strings.
  • Added a language selector to General settings to let users switch locales at runtime.
  • Improved batch organize API error handling (including redirect-to-signin on 401) and localized batch organize UI labels.
  • Enhanced X/Twitter save-rules editor with stable client-side keys for list rendering and localized copy.

Technical Notes: i18n is initialized at app startup (src/index.tsx), and translations are bundled as static JSON resources for fast runtime lookup.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

<Select
labelId="language-select-label"
id="language-select"
value={i18n.language?.startsWith('zh') ? 'zh-CN' : i18n.language || 'en'}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n.language can be a regional code (e.g. en-US), so this Select value may not match any supportedLanguages option and can render as an empty/invalid selection. Consider normalizing the value to one of the supported base language codes used in the menu items.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

search: zhSearch,
},
},
fallbackLng: 'en',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With LanguageDetector, the resolved language can be a variant like en-US/zh, which isn’t present in resources and can leak into i18n.language (impacting UI like the language selector). Consider configuring supportedLngs (and/or nonExplicitSupportedLngs) so i18next consistently uses en/zh-CN.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

<MenuItem value="ARCHIVED">Archive</MenuItem>
<InputLabel>{t('settings:library')}</InputLabel>
<Select value={saveStatus} label={t('settings:library')} onChange={(e) => setSaveStatus(e.target.value as "ALL" | "SAVED" | "ARCHIVED")}>
<MenuItem value="ALL">{t('settings:libraryStatus')}</MenuItem>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The saveStatus === "ALL" menu item is labeled with settings:libraryStatus ("Library status (optional)"), which doesn’t seem to describe the "All" option. This looks like it will display a confusing label in the Library filter dropdown.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.


React.useEffect(() => {
setDocTitle('My Highlights');
setDocTitle(t('page:myHighlightsTitle'));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This useEffect uses t(...) but has an empty dependency array, so the document title won’t update if the user switches languages while staying on this page. Same issue exists in the selectedPageId title effect below.

Severity: low

Other Locations
  • app/client/src/pages/Highlights.tsx:321

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

</div>}
{isLoading && <Loading/>}
{error && <p>Oops, something was broken. <div>{error.toString()}</div></p>}
{error && <p>{t('page:loadError')} <div>{error.toString()}</div></p>}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<p> cannot contain a block-level <div> child; this invalid markup can lead to unexpected DOM structure across browsers. Consider rendering the error message in a single container element to avoid HTML nesting issues.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@lcomplete lcomplete merged commit 33fdb2e into main Mar 21, 2026
1 check passed
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.

2 participants