i18n: add support for Hebrew, closes #3216 (#3218)

This commit is contained in:
Huang Xin
2026-02-08 13:55:53 +08:00
committed by GitHub
parent 475becafe3
commit d8817a88b9
4 changed files with 1098 additions and 1 deletions
@@ -28,6 +28,7 @@ module.exports = {
'id',
'vi',
'ms',
'he',
'ar',
'th',
'bo',
File diff suppressed because it is too large Load Diff
@@ -11,6 +11,7 @@ import { useResetViewSettings } from '@/hooks/useResetSettings';
import { TRANSLATED_LANGS, TRANSLATOR_LANGS } from '@/services/constants';
import { ConvertChineseVariant } from '@/types/book';
import { SettingsPanelPanelProp } from './SettingsDialog';
import { getDirFromLanguage } from '@/utils/rtl';
import { isCJKEnv } from '@/utils/misc';
import Select from '@/components/Select';
@@ -142,8 +143,11 @@ const LangPanel: React.FC<SettingsPanelPanelProp> = ({ bookKey, onRegisterReset
useEffect(() => {
if (uiLanguage === viewSettings.uiLanguage) return;
saveViewSettings(envConfig, bookKey, 'uiLanguage', uiLanguage, false, false);
const sameDir = getDirFromLanguage(uiLanguage) === getDirFromLanguage(viewSettings.uiLanguage);
applyUILanguage(uiLanguage);
saveViewSettings(envConfig, bookKey, 'uiLanguage', uiLanguage, false, false).then(() => {
if (!sameDir) window.location.reload();
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [uiLanguage]);
@@ -784,6 +784,7 @@ export const TRANSLATED_LANGS = {
es: 'Español',
pt: 'Português',
ru: 'Русский',
he: 'עברית',
ar: 'العربية',
fa: 'فارسی',
el: 'Ελληνικά',