Skip to content

Commit

Permalink
Merge pull request #2257 from Sefaria/revert-2254-add-lang-toggle-he-ui
Browse files Browse the repository at this point in the history
Revert "Add language toggle to sidebar in Hebrew UI"
  • Loading branch information
akiva10b authored Jan 16, 2025
2 parents b9ef019 + a46c167 commit 276c58a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
19 changes: 10 additions & 9 deletions static/css/s2.css
Original file line number Diff line number Diff line change
Expand Up @@ -5092,18 +5092,19 @@ body .ui-autocomplete.dictionary-toc-autocomplete .ui-menu-item a.ui-state-focus
.readerControls .readerTextToc .categoryAttribution .he {
font-style: normal;
}
.leftButtons,
.rightButtons {
.interface-english .leftButtons,
.interface-hebrew .rightButtons {
display: flex;
flex-direction: row;
text-align: left;
}
.interface-english .rightButtons,
.interface-hebrew .leftButtons {
display: flex;
flex-direction: row;
text-align: right;
align-items: center;
}
.leftButtons {
text-align: start;
}
.rightButtons {
text-align: end;
}
}
/* icons need a little nudge in flipped hebrew mode */
.interface-hebrew .rightButtons {
margin-left: -3px;
Expand Down
2 changes: 1 addition & 1 deletion static/js/ConnectionsPanelHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class ConnectionsPanelHeader extends Component {
const toggleLang = Sefaria.util.getUrlVars()["lang2"] === "en" ? "he" : "en";
const langUrl = Sefaria.util.replaceUrlParam("lang2", toggleLang);
const closeUrl = Sefaria.util.removeUrlParam("with");
const showOneLanguage = !Sefaria._siteSettings.TORAH_SPECIFIC;
const showOneLanguage = !Sefaria._siteSettings.TORAH_SPECIFIC || Sefaria.interfaceLang === "hebrew";
const toggleButton = (showOneLanguage) ? null : (this.props.connectionsMode === 'TextList') ?
<DropdownMenu buttonContent={<DisplaySettingsButton/>} context={ReaderPanelContext}><ReaderDisplayOptionsMenu/></DropdownMenu> :
<LanguageToggleButton toggleLanguage={this.props.toggleLanguage} url={langUrl} />;
Expand Down
4 changes: 2 additions & 2 deletions static/js/ReaderPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class ReaderPanel extends Component {
contentLangOverride = (Sefaria.interfaceLang === "english") ? "bilingual" : "hebrew";

} else if ((mode === "Connections" && connectionsMode !== 'TextList') || !!menuOpen){
// Default bilingual to interface language
contentLangOverride = (originalLanguage === "bilingual") ? Sefaria.interfaceLang : originalLanguage;
// Always Hebrew for Hebrew interface, treat bilingual as English for English interface
contentLangOverride = (Sefaria.interfaceLang === "hebrew") ? "hebrew" : ((originalLanguage === "bilingual") ? "english" : originalLanguage);
}
return contentLangOverride;
}
Expand Down

0 comments on commit 276c58a

Please sign in to comment.