diff --git a/reader/browsertest/basic_tests.py b/reader/browsertest/basic_tests.py index 242fb761ec..e7e34ffda8 100644 --- a/reader/browsertest/basic_tests.py +++ b/reader/browsertest/basic_tests.py @@ -233,7 +233,7 @@ def body(self): self.click_sidebar_entry(section) self.click_resources_on_sidebar() - self.click_sidebar_button("Compare Text") + self.click_sidebar_button("panel.compare_text") self.driver.find_element_by_css_selector('.readerNavMenuMenuButton').click() self.click_sidebar_button("Sheets") diff --git a/static/js/AboutBox.jsx b/static/js/AboutBox.jsx index b86dc28e8a..0c16669150 100644 --- a/static/js/AboutBox.jsx +++ b/static/js/AboutBox.jsx @@ -77,7 +77,7 @@ class AboutBox extends Component { if (d) { detailSection = (

- { Sefaria._("About This Text")} + { Sefaria._("side_nav.about_text")}

{d.title.stripHtml()} @@ -100,9 +100,9 @@ class AboutBox extends Component { const translationVersions = Object.entries(this.state.currentVersionsByActualLangs).filter(([lang, version]) => lang !== "he").map(([lang, version])=> version); const multiple_translations = translationVersions?.length > 1; const no_source_versions = multiple_translations || translationVersions?.length === 1 && !sourceVersion; - const sourceVersionSectionTitle = {en: Sefaria._("Current Version"), he:Sefaria._("Current Version")}; - const translationVersionsSectionTitle = multiple_translations ? {en: Sefaria._("Current Translations"), he:Sefaria._("Current Translations")} : {en: Sefaria._("Current Translation"), he: Sefaria._("Current Translation")}; - const alternateVersionsSectionTitle = no_source_versions ? {en: Sefaria._("Source Versions"), he: Sefaria._("Source Versions")} : {en: Sefaria._("Alternate Source Versions"), he: Sefaria._("Alternate Source Versions")} + const sourceVersionSectionTitle = {en: Sefaria._("text.current_version"), he:Sefaria._("text.current_version")}; + const translationVersionsSectionTitle = multiple_translations ? {en: Sefaria._("text.current_translation"), he:Sefaria._("text.current_translation")} : {en: Sefaria._("text.current_translation"), he: Sefaria._("text.current_translation")}; + const alternateVersionsSectionTitle = no_source_versions ? {en: Sefaria._("source_versions"), he: Sefaria._("source_versions")} : {en: Sefaria._("alt_source_versions"), he: Sefaria._("alt_source_versions")} let detailSection = null; if (d) { @@ -137,7 +137,7 @@ class AboutBox extends Component { detailSection = (

- { Sefaria._("About This Text")} + side_nav.about_text

@@ -163,8 +163,8 @@ class AboutBox extends Component { { !!placeTextEn || !!dateTextEn ?
- { Sefaria._("Composed")} {`${!!placeTextEn ? placeTextEn : ""} ${!!dateTextEn ? dateTextEn : ""}`} - { Sefaria._("Composed")} {`${!!placeTextHe ? placeTextHe : ""} ${!!dateTextHe ? dateTextHe : ""}`} + { Sefaria._("text.composed")} {`${!!placeTextEn ? placeTextEn : ""} ${!!dateTextEn ? dateTextEn : ""}`} + { Sefaria._("text.composed")} {`${!!placeTextHe ? placeTextHe : ""} ${!!dateTextHe ? dateTextHe : ""}`}
: null }
diff --git a/static/js/AboutSheet.jsx b/static/js/AboutSheet.jsx index 539a43ba22..eaa43a6541 100644 --- a/static/js/AboutSheet.jsx +++ b/static/js/AboutSheet.jsx @@ -52,7 +52,7 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => { const newSummary = event.target.value if (event.target.value.length > 280) { setValidation({ - validationMsg: Sefaria._("The summary description is limited to 280 characters."), + validationMsg: Sefaria._("summary_limit"), validationFailed: "summary" }); } @@ -111,14 +111,14 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => { const isFormValidated = () => { if ((!summary || summary.trim() == '') && tags.length == 0) { setValidation({ - validationMsg: Sefaria._("Please add a description and topics to publish your sheet."), + validationMsg: Sefaria._("topic.add_desription"), validationFailed: "both" }); return false } else if (!summary || summary.trim() == '') { setValidation({ - validationMsg: Sefaria._("Please add a description to publish your sheet."), + validationMsg: Sefaria._("sheet.add_description"), validationFailed: "summary" }); return false @@ -126,7 +126,7 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => { else if (tags.length == 0) { setValidation({ - validationMsg: Sefaria._("Please add topics to publish your sheet."), + validationMsg: Sefaria._("topic.add_topic_to_sheet"), validationFailed: "topics" }); return false @@ -206,7 +206,7 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => { {sheet.topics && sheet.topics.length > 0 ?
-

{ Sefaria._("Topics")}

+

header.topic

    {sheet.topics.map((topic, i) => ( @@ -224,15 +224,15 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {
; const publishSettingsEditMode =
- {!isPublished ?

{ Sefaria._("Publish your sheet on Sefaria for others to discover.")}

: null} -

{ Sefaria._("Summary")}

+ {!isPublished ?

sheet.publish_sheet_on_pecha

: null} +

summary

-

Topics

+

header.topic

{ tags={tags} suggestions={suggestions} onDelete={onTagDelete} - placeholderText={Sefaria._("Add a topic...")} + placeholderText={Sefaria._("add_topic")} delimiters={["Enter", "Tab", ","]} onAddition={onTagAddition} onValidate={onTagValidate} @@ -251,7 +251,7 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => { {!isPublished ?
: null} @@ -261,12 +261,11 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {
- {Sefaria._("Your Sheet is")}{ Sefaria._("published")} { Sefaria._("on Sefaria and visible to others through search and topics.")} - {Sefaria._("Your Sheet is")} { Sefaria._("published")} { Sefaria._("on Sefaria and visible to others through search and topics.")} + {Sefaria._("sheet.your_sheet_is")}{ Sefaria._("published")} { Sefaria._("topic.visible_to_other")}
: null @@ -295,10 +294,10 @@ const AboutSheet = ({ masterPanelSheetId, toggleSignUpModal }) => {
{Sefaria.util.localeDate(sheet.dateCreated)} - {sheet.views} {Sefaria._("Views")} + {sheet.views} {Sefaria._("profile.tab.sheet.tag.views")} {sheetSaves.length} {Sefaria._("Saves")}
- {/* {sheet.status !== 'public' ? (
{Sefaria._("Not Published")}
) : undefined} */} + {/* {sheet.status !== 'public' ? (
{Sefaria._("profile.tab.sheet.tag.not_published")}
) : undefined} */}
{ canEdit ? publishSettingsEditMode : publishSettingsReadOnly @@ -417,14 +416,14 @@ const CollectionsEditor = ({ sheetId }) => { {dataLoaded && collections.length === 0 ? - {Sefaria._("You can use collections to organize your sheets or public sheets you like. Collections can shared privately or made public on Sefaria.")} + {Sefaria._("profile.collection_description")} : null}
+
- +
{newName.length ?
diff --git a/static/js/AddToSourceSheet.jsx b/static/js/AddToSourceSheet.jsx index 3e79accee9..8662ed074e 100644 --- a/static/js/AddToSourceSheet.jsx +++ b/static/js/AddToSourceSheet.jsx @@ -51,11 +51,11 @@ class AddToSourceSheetBox extends Component { setDefaultSheet() { if (this.state.selectedSheet) { return; } if (!Sefaria._uid) { - this.setState({selectedSheet: {title: Sefaria._( "Your Sheet")}}); + this.setState({selectedSheet: {title: Sefaria._( "sheet.your_sheet")}}); } else { var sheets = Sefaria.sheets.userSheets(Sefaria._uid); if (!sheets.length) { - this.setState({selectedSheet: {title: Sefaria._( "Create a New Sheet")}}); + this.setState({selectedSheet: {title: Sefaria._( "header.profileMenu.create_New_Sheet")}}); } else { this.setState({selectedSheet: sheets[0]}); } @@ -133,7 +133,7 @@ class AddToSourceSheetBox extends Component { for (let i = 0; i < refs.length; i++) { let ref = Sefaria.getRefFromCache(refs[i]); if (ref && (Sefaria.isFullSegmentImage(ref.he) || Sefaria.isFullSegmentImage(ref.text))) { - alert(Sefaria._( "We do not currently support adding images to source sheets.")); + alert(Sefaria._( "sheet.message.do_not_support_adding_images_to_source_sheets")); return false; } } @@ -178,8 +178,8 @@ class AddToSourceSheetBox extends Component { disallowedTagsMode: 'discard', }); let titleRetval = { - "en": `${sheetTitle} ${Sefaria._("Section")}${nodeID}`, - "he": `${sheetTitle} ${Sefaria._("Section")}${nodeID}` + "en": `${sheetTitle} ${Sefaria._("section")}${nodeID}`, + "he": `${sheetTitle} ${Sefaria._("section")}${nodeID}` } if (refTitles){ //show the refs also of a source, just to be nice titleRetval["en"] += `(${refTitles["en"]})`; @@ -202,7 +202,7 @@ class AddToSourceSheetBox extends Component { const sheets = Sefaria._uid ? Sefaria.sheets.userSheets(Sefaria._uid) : null; let sheetsList = Sefaria._uid && sheets ? sheets.map((sheet) => { let classes = classNames({dropdownOption: 1, noselect: 1, selected: this.state.selectedSheet && this.state.selectedSheet.id === sheet.id}); - let title = sheet.title ? sheet.title.stripHtml() : Sefaria._("Untitled Source Sheet"); + let title = sheet.title ? sheet.title.stripHtml() : Sefaria._("sheet.untitled_sourc_sheet"); let selectSheet = this.selectSheet.bind(this, sheet); return (
{title}
); }) : (Sefaria._uid ? : null); @@ -218,11 +218,11 @@ class AddToSourceSheetBox extends Component { {titleRef["he"]}
- { Sefaria._("Add to")} + { Sefaria._("sheet.add_to")}
- {this.state.sheetsLoaded ? (this.state.selectedSheet.title === null ? Sefaria._("Untitled Source Sheet") : this.state.selectedSheet.title.stripHtml()) : }
+ {this.state.sheetsLoaded ? (this.state.selectedSheet.title === null ? Sefaria._("sheet.untitled_sourc_sheet") : this.state.selectedSheet.title.stripHtml()) : }
{this.state.sheetListOpen ?
@@ -238,7 +238,7 @@ class AddToSourceSheetBox extends Component { : null}
- { Sefaria._("Add to Sheet")} + { Sefaria._("sheet.add_to_sheet")}
); } @@ -269,15 +269,15 @@ class ConfirmAddToSheet extends Component { disallowedTagsMode: 'discard', }); srefTitles = { - "en": `${Sefaria._("Section from")} "${sheetTitle}"`, - "he": `${Sefaria._("Section from")} "${sheetTitle}"`, + "en": `${Sefaria._("sheet.section_from")} "${sheetTitle}"`, + "he": `${Sefaria._("sheet.section_from")} "${sheetTitle}"`, }; } return (
{srefTitles["he"]} -  {Sefaria._("has been added to")}  +  {Sefaria._("sheet.has_been_added_to")}  {this.props.sheet.title}.
@@ -304,7 +304,7 @@ class AddToSourceSheetWindow extends Component {
{Sefaria._uid ? null : - {Sefaria._("In order to add this source to a sheet, please ")} {Sefaria._("log in")} + {Sefaria._("sheet.message.login_before_add_source_sheet")} {Sefaria._("log_in")} }
diff --git a/static/js/AdminEditor.jsx b/static/js/AdminEditor.jsx index 5cb5087c6f..2048a887a2 100644 --- a/static/js/AdminEditor.jsx +++ b/static/js/AdminEditor.jsx @@ -12,25 +12,25 @@ const options_for_form = { "English Description": { label: "English Description", field: "enDescription", - placeholder: "Add a description.", + placeholder: Sefaria._("topic.admin.description"), type: 'textarea', markdown: true, }, "Hebrew Description": { label: "Tibetan Description", field: "heDescription", - placeholder: "Add a description.", + placeholder: Sefaria._("topic.admin.description"), type: 'textarea', markdown: true }, "Prompt": {label: "Prompt", field: "prompt", placeholder: "Add a prompt.", type: 'textarea'}, "English Short Description": { - label: "English Short Description for Table of Contents", field: "enCategoryDescription", - placeholder: "Add a short description.", type: 'input' + label: Sefaria._("topic.admin.en_short_description"), field: "enCategoryDescription", + placeholder: Sefaria._("topic.admin.short_description"), type: 'input' }, "Hebrew Short Description": { - label: "Tibetan Short Description for Table of Contents", field: "heCategoryDescription", - placeholder: "Add a short description.", type: 'input' + label: Sefaria._("topic.admin.bo_short_description"), field: "heCategoryDescription", + placeholder: Sefaria._("topic.admin.short_description"), type: 'input' }, "English Alternate Titles": { label: "English Alternate Titles", field: "enAltTitles", diff --git a/static/js/BookPage.jsx b/static/js/BookPage.jsx index d8e90394af..d1ff2e48f2 100644 --- a/static/js/BookPage.jsx +++ b/static/js/BookPage.jsx @@ -187,19 +187,19 @@ class BookPage extends Component { const readButton = !this.state.indexDetails || this.isTextToc() || this.props.compare ? null : Sefaria.lastPlaceForText(title) ? - Continue Reading + text.button.continue_reading : - Start Reading + text.start_reading const tabs = [] if (this.state.isContentVisible) { - tabs.push({id: "contents", title: {en: "Contents", he: Sefaria._("Contents")}}); + tabs.push({id: "contents", title: {en: Sefaria._("text.contents"), he: Sefaria._("text.contents")}}); } if (this.isBookToc()){ - tabs.push({id: "versions", title: {en: "Versions", he: Sefaria._("Versions")}}); + tabs.push({id: "versions", title: {en: Sefaria._("text.versions"), he: Sefaria._("text.versions")}}); } const renderTab = t => (
@@ -254,7 +254,7 @@ class BookPage extends Component {
:
- Table of Contents + text.table_of_contents
}
@@ -1285,11 +1285,11 @@ const EditTextInfo = function({initTitle, close}) {
- {savingStatus ?
Saving text information...

(processing title changes may take some time)
: null} + {savingStatus ?
{Sefaria._("topic.admin.save_information")}

{Sefaria._("topic.admin.change_processing_time_msg")}
: null}
- + setEnTitle(e.target.value)} defaultValue={enTitle}/>
{Sefaria._siteSettings.TORAH_SPECIFIC ? @@ -1327,14 +1327,14 @@ const EditTextInfo = function({initTitle, close}) {
-
Alternate English Titles
+
text.admin.alt_en_title
{Sefaria._siteSettings.TORAH_SPECIFIC ?
-
Alternate Hebrew Titles
+
text.admin.alt_bo_title
: null}
@@ -1368,7 +1368,7 @@ const EditTextInfo = function({initTitle, close}) {
} {index.current.hasOwnProperty("sectionNames") ?
-
+
: null}
diff --git a/static/js/CalendarsPage.jsx b/static/js/CalendarsPage.jsx index c6d96a8f5f..390610b990 100644 --- a/static/js/CalendarsPage.jsx +++ b/static/js/CalendarsPage.jsx @@ -43,7 +43,7 @@ const CalendarsPage = ({multiPanel, initialWidth}) => {
{about} -

Weekly Torah Portion

+

weekly_torah_portion

diff --git a/static/js/CategoryEditor.jsx b/static/js/CategoryEditor.jsx index c17aa61e98..c9b442a9fe 100644 --- a/static/js/CategoryEditor.jsx +++ b/static/js/CategoryEditor.jsx @@ -63,7 +63,7 @@ const ReorderEditor = ({close, type = "", postURL = "", redirect = "", origItems } const validate = () => { if (!isChanged) { - alert(Sefaria._("You haven't reordered the categories.")) + alert(Sefaria._("category.message.no_reordered_categories")) } else { save(); } @@ -122,7 +122,7 @@ const CategoryEditor = ({origData = {}, close, origPath = []}) => { const populateCatMenu = (update) => (
- +
) @@ -143,12 +143,12 @@ const CategoryEditor = ({origData = {}, close, origPath = []}) => { const validate = async function () { if (!changed) { - alert(Sefaria._("Please change one of the fields before saving.")); + alert(Sefaria._("message.change_field_before_saving")); return false; } if (data.enTitle.length === 0) { - alert(Sefaria._("Title must be provided.")); + alert(Sefaria._("topic.admin.title_must_be_provided")); return false; } await save(); @@ -200,7 +200,7 @@ const CategoryEditor = ({origData = {}, close, origPath = []}) => { const deleteObj = function () { if (subcategoriesAndBooks.length > 0) { - alert(Sefaria._("Cannot delete a category with contents.")); + alert(Sefaria._("category.message.cannot_delete_content")); return; } const url = `/api/category/${origPath.concat(origData.origEn).join("/")}`; @@ -210,7 +210,7 @@ const CategoryEditor = ({origData = {}, close, origPath = []}) => { {name: "true", content: Sefaria._("True"), role: "radio", ariaLabel: Sefaria._("Set Primary Status to True")}, { name: "false", - content: Sefaria._("False"), + content: Sefaria._("false"), role: "radio", ariaLabel: Sefaria._("Set Primary Status to False") }, @@ -218,7 +218,7 @@ const CategoryEditor = ({origData = {}, close, origPath = []}) => { const items = ["Title", "Hebrew Title", "English Description", "Hebrew Description", "Category Menu", "English Short Description", "Hebrew Short Description"]; return
- {

- {Sefaria._("No sheets matching")} ; + {Sefaria._("collection.no_sheets_matching")} ; "".
); } else if (this.isMember()) { return (
- {Sefaria._( "You can add sheets to this collection on your profile.")} + {Sefaria._( "collection.add_sheet_to_collection")}
- {Sefaria._("Open Profile")} + {Sefaria._("collection.open_profile")}
); } else { return (
- { Sefaria._("There are no sheets in this collection yet.")} + { Sefaria._("collection.message.no_sheet_in_collection")}
); } @@ -185,7 +185,7 @@ class CollectionPage extends Component { e.preventDefault(); this.props.searchInCollection(filter, this.state.collectionData.name); }}> - { Sefaria._("Search the full text of this collection for")}  + collection.search_fulltext  "" » ); @@ -228,10 +228,10 @@ class CollectionPage extends Component { const tabs = !hasContentsTab ? [] : [{id: "contents", title: {en: Sefaria._("Contents") , he: Sefaria._("Contents")}}]; tabs.push( - {id: "sheets", title: {en: Sefaria._("Sheets"), he: Sefaria._("Sheets")}}, + {id: "sheets", title: {en: Sefaria._("profile.tab.sheets"), he: Sefaria._("profile.tab.sheets")}}, { id: 'filter', - title: {en: Sefaria._("Filter"), he: Sefaria._("Filter")}, + title: {en: Sefaria._("filter"), he: Sefaria._("filter")}, icon: `/static/icons/arrow-${this.state.showFilterHeader ? 'up' : 'down'}-bold.svg`, justifyright: true, clickTabOverride: () => { @@ -340,7 +340,7 @@ const CollectionAbout = ({collection, isAdmin, toggleLanguage}) => (
: collection.description ? -
+
: null } {collection.websiteUrl ? @@ -423,10 +423,10 @@ class CollectionInvitationBox extends Component { } inviteByEmail(email) { if (!this.validateEmail(email)) { - this.flashMessage(Sefaria._("Please enter a valid email address.")); + this.flashMessage(Sefaria._("message.enter_valid_email")); return; } - this.setState({inviting: true, message: Sefaria._("Inviting...")}) + this.setState({inviting: true, message: Sefaria._("collection.inviting")}) $.post("/api/collections/" + this.props.slug + "/invite/" + email, function(data) { if ("error" in data) { alert(data.error); @@ -439,7 +439,7 @@ class CollectionInvitationBox extends Component { this.props.onDataChange(); } }.bind(this)).fail(function() { - alert(Sefaria._("There was an error sending your invitation.")); + alert(Sefaria._("collection.message.error_sending_invitation")); this.setState({message: null, inviting: false}); }.bind(this)); } @@ -450,9 +450,9 @@ class CollectionInvitationBox extends Component { render() { return (
- +
- Invite + collection.invite
{this.state.message ? @@ -527,7 +527,7 @@ class CollectionInvitationListing extends Component { {this.props.member.email}
- Invited + collection.invited {this.props.isAdmin ?
- {Sefaria._("Owner")} - - can invite & edit settings + collection.owner + - collection._can_invite_edit_setting
: null } {this.props.isAdmin ?
{Sefaria._("Editor")} - - can add & remove sheets + - collection.add_and_remove_sheets
: null} {this.props.isAdmin || this.props.isSelf ?
- {this.props.isSelf ? Sefaria._("Leave Collection"): Sefaria._("Remove")} + {this.props.isSelf ? Sefaria._("collection.leave_collection"): Sefaria._("remove")}
: null } {this.props.isInvitation && !this.state.invitationResent ?
- {Sefaria._("Resend Invitation")} + {Sefaria._("collection.resend_invitation")}
: null} {this.props.isInvitation && this.state.invitationResent ?
- {Sefaria._("Invitation Resent" )} + {Sefaria._("collection.invitation_resent" )}
: null} {this.props.isInvitation ?
- { Sefaria._("Remove")} + { Sefaria._("remove")}
: null} diff --git a/static/js/CollectionsWidget.jsx b/static/js/CollectionsWidget.jsx index 7d08852fe7..af5c1a188e 100644 --- a/static/js/CollectionsWidget.jsx +++ b/static/js/CollectionsWidget.jsx @@ -117,7 +117,7 @@ const CollectionsWidget = ({sheetID, close, handleCollectionsChange}) => { return
- { Sefaria._("Collections")} + { Sefaria._("collection")}
×
@@ -136,14 +136,14 @@ const CollectionsWidget = ({sheetID, close, handleCollectionsChange}) => { {dataLoaded && collections.length === 0 ? - { Sefaria._("You can use collections to organize your sheets or public sheets you like. Collections can shared privately or made public on Sefaria.")} + { Sefaria._("profile.collection_description")} : null }
+
- +
{newName.length ?
@@ -153,7 +153,7 @@ const CollectionsWidget = ({sheetID, close, handleCollectionsChange}) => {
- {Sefaria._("Done")} + collection.done
diff --git a/static/js/CommunityPage.jsx b/static/js/CommunityPage.jsx index 3c5a67ace4..1da82e1af3 100644 --- a/static/js/CommunityPage.jsx +++ b/static/js/CommunityPage.jsx @@ -110,13 +110,13 @@ const RecentlyPublished = ({multiPanel, toggleSignUpModal}) => { recentSheetsContent.splice(6, 0, joinTheConversation); recentSheetsContent.push( - { Sefaria._("Load More")} + { Sefaria._("load_more")} ); } return (
-

{ Sefaria._("Recently Published")}

+

{ Sefaria._("recently_published")}

); diff --git a/static/js/ComparePanelHeader.jsx b/static/js/ComparePanelHeader.jsx index 0de8a1ed3c..12fd6a4f58 100644 --- a/static/js/ComparePanelHeader.jsx +++ b/static/js/ComparePanelHeader.jsx @@ -26,8 +26,8 @@ const ComparePanelHeader = ({ search, category, openDisplaySettings, navHome, ca setQuery(e.target.value)} value={query} onKeyUp={handleSearchKeyUp} /> diff --git a/static/js/ConnectionFilters.jsx b/static/js/ConnectionFilters.jsx index e79edb619e..f37a939625 100644 --- a/static/js/ConnectionFilters.jsx +++ b/static/js/ConnectionFilters.jsx @@ -59,7 +59,7 @@ class CategoryFilter extends Component {
- + ({this.props.count}) diff --git a/static/js/ConnectionsPanel.jsx b/static/js/ConnectionsPanel.jsx index b0a7efa8af..5cfdf82b2a 100644 --- a/static/js/ConnectionsPanel.jsx +++ b/static/js/ConnectionsPanel.jsx @@ -229,7 +229,7 @@ class ConnectionsPanel extends Component { onSave() { this.reloadData(); this.props.setConnectionsMode("Resources"); - this.flashMessage(Sefaria._("Success! You've created a new connection.")); + this.flashMessage(Sefaria._("message.success_created_new_connection")); } getData(cb) { // Gets data about this text from cache, which may be null. @@ -335,14 +335,14 @@ class ConnectionsPanel extends Component { masterPanelSheetId={this.props.masterPanelSheetId} /> :
- this.props.setConnectionsMode("About")} /> - this.props.setConnectionsMode("Navigation")} /> - this.props.setConnectionsMode("SidebarSearch")} /> - this.props.setConnectionsMode("Translations")} count={resourcesButtonCounts.translations} /> + this.props.setConnectionsMode("About")} /> + this.props.setConnectionsMode("Navigation")} /> + this.props.setConnectionsMode("SidebarSearch")} /> + this.props.setConnectionsMode("Translations")} count={resourcesButtonCounts.translations} />
} {showConnectionSummary ? - + + { //ironically we need the masterpanel mode to be sheet to indicate a sheet is loaded, but the // title prop to be something other than "Sheet" to indicate that a real source is being // looked at (this.props.masterPanelMode === "Sheet" && this.props.title !== "Sheet") ? <> - this.props.setConnectionsMode("About")} /> - this.props.setConnectionsMode("Translations")} /> + this.props.setConnectionsMode("About")} /> + this.props.setConnectionsMode("Translations")} /> : null @@ -383,7 +383,7 @@ class ConnectionsPanel extends Component { : null } - + {this.props.masterPanelMode === "Sheet" ? - {Sefaria._("Go to My Notes")} + {Sefaria._("text.go_to_my_notes")} { // A list of Resources in addition to connection return (
- setConnectionsMode("Sheets")} /> - setConnectionsMode("WebPages")} /> - setConnectionsMode("Topics")} alwaysShow={Sefaria.is_moderator} /> - setConnectionsMode("manuscripts")} /> - setConnectionsMode("Torah Readings")} /> + setConnectionsMode("Sheets")} /> + setConnectionsMode("WebPages")} /> + setConnectionsMode("Topics")} alwaysShow={Sefaria.is_moderator} /> + setConnectionsMode("manuscripts")} /> + setConnectionsMode("Torah Readings")} />
); } @@ -750,13 +750,13 @@ const ToolsList = ({ setConnectionsMode, toggleSignUpModal, openComparePanel, co // A list of Resources in addition to connection return (
- !Sefaria._uid ? toggleSignUpModal(SignUpModalKind.AddToSheet) : setConnectionsMode("Add To Sheet", { "addSource": "mainPanel" })} /> - {/* setConnectionsMode("Lexicon")} /> */} - {/* {openComparePanel ? : null} */} - !Sefaria._uid ? toggleSignUpModal(SignUpModalKind.Notes) : setConnectionsMode("Notes")} /> - {masterPanelMode !== "Sheet" ? setConnectionsMode("Share")} /> : null} - {/* setConnectionsMode("Feedback")} /> */} - {/* setConnectionsMode("Advanced Tools")} /> */} + !Sefaria._uid ? toggleSignUpModal(SignUpModalKind.AddToSheet) : setConnectionsMode("Add To Sheet", { "addSource": "mainPanel" })} /> + {/* setConnectionsMode("Lexicon")} /> */} + {/* {openComparePanel ? : null} */} + !Sefaria._uid ? toggleSignUpModal(SignUpModalKind.Notes) : setConnectionsMode("Notes")} /> + {masterPanelMode !== "Sheet" ? setConnectionsMode("Share")} /> : null} + {/* setConnectionsMode("Feedback")} /> */} + {/* setConnectionsMode("Advanced Tools")} /> */}
); } @@ -785,17 +785,17 @@ const AboutSheetButtons = ({ setConnectionsMode, masterPanelSheetId }) => { return (
{isOwner ? - setConnectionsMode("AboutSheet")} /> + setConnectionsMode("AboutSheet")} /> : - setConnectionsMode("AboutSheet")} /> + setConnectionsMode("AboutSheet")} /> } {showEditButton ? - { + { window.location = `//${window.location.host}/sheets/${masterPanelSheetId}?editor=1`; }} /> : null } - setConnectionsMode("Share")} /> + setConnectionsMode("Share")} />
); } @@ -804,15 +804,15 @@ const SheetToolsList = ({ toggleSignUpModal, masterPanelSheetId, setConnectionsM // const [isOwner, setIsOwner] = useState(false); // const [isPublished, setIsPublished] = useState(false); const googleDriveState = { - export: { en: Sefaria._("Export to Google Docs") , he: Sefaria._("Export to Google Docs") }, + export: { en: Sefaria._("export.google_doc") , he: Sefaria._("export.google_doc") }, exporting: {en: Sefaria._("Exporting to Google Docs..."), he: Sefaria._("Exporting to Google Docs..."), greyColor: true}, - exportComplete: { en: Sefaria._("Export Complete"), he: Sefaria._("Export Complete"), secondaryEn: Sefaria._("Open in Google"), secondaryHe: Sefaria._("Open in Google"), greyColor: true} + exportComplete: { en: Sefaria._("export.complete"), he: Sefaria._("export.complete"), secondaryEn: Sefaria._("export.open_google"), secondaryHe: Sefaria._("export.open_google"), greyColor: true} } const copyState = { - copy: { en: Sefaria._("Copy"), he: Sefaria._("Copy") }, - copying: { en: Sefaria._("Copying..."), he: Sefaria._("Copying..."), greyColor: true}, - copied: { en: Sefaria._("Sheet Copied"), he: Sefaria._("Sheet Copied"), secondaryHe: Sefaria._("View Copy"), secondaryEn: Sefaria._("View Copy"), greyColor: true }, - error: { en: Sefaria._("Sorry, there was an error."), he: Sefaria._("Sorry, there was an error.") } + copy: { en: Sefaria._("copy"), he: Sefaria._("copy") }, + copying: { en: Sefaria._("copying"), he: Sefaria._("copying"), greyColor: true}, + copied: { en: Sefaria._("Sheet Copied"), he: Sefaria._("Sheet Copied"), secondaryHe: Sefaria._("sheet.view_copy"), secondaryEn: Sefaria._("sheet.view_copy"), greyColor: true }, + error: { en: Sefaria._("message.there_is_error"), he: Sefaria._("message.there_is_error") } } const [copyText, setCopyText] = useState(copyState.copy); const urlHashObject = Sefaria.util.parseHash(Sefaria.util.parseUrl(window.location).hash).afterLoading; @@ -919,14 +919,14 @@ const SheetToolsList = ({ toggleSignUpModal, masterPanelSheetId, setConnectionsM return (
copySheet()} /> {/* toggleCollectionsModal()} /> */} - window.print()} /> + window.print()} /> googleDriveExport()} /> { Sefaria._uses_new_editor && Sefaria._uid && ( sheet.owner === Sefaria._uid || sheet.options.collaboration === "anyone-can-edit" ) ? - setConnectionsMode("DivineName")} /> : null} + setConnectionsMode("DivineName")} /> : null}
) @@ -936,10 +936,10 @@ class SheetNodeConnectionTools extends Component { render() { return (
{this.props.multiPanel ? - + : null} - this.props.setConnectionsMode("Sheets")} /> - this.props.setConnectionsMode("Feedback")} /> + this.props.setConnectionsMode("Sheets")} /> + this.props.setConnectionsMode("Feedback")} />
); } } @@ -1053,11 +1053,11 @@ class ConnectionsSummary extends Component { if (this.props.collapsed) { connectionsSummary = connectionsSummary.slice(0, collapsedTopLevelLimit) //get the first x items summaryToggle = ( - + ); } else { summaryToggle = ( - + ) } } @@ -1149,12 +1149,12 @@ const TopicList = ({ masterPanelMode, srefs, interfaceLang, contentLang }) => { {Sefaria.is_moderator && masterPanelMode === "Text" ? + createNewTopicStr={Sefaria._("create_new_topic")}/> : null} {(!topics || !topics.length) ? (
- +
) : topics.map( @@ -1243,8 +1243,8 @@ class WebPagesList extends Component { if (!content.length) { const filterName = this.props.filter !== "all" ? this.props.filter : null; - const en = Sefaria._("No web pages known") + (filterName ? Sefaria._("from") + filterName : "") + Sefaria._("here"); - const he = Sefaria._("No web pages known") + (filterName ? Sefaria._("from") + filterName : "") + Sefaria._("here"); + const en = Sefaria._("no_web_pages") + (filterName ? Sefaria._("from") + filterName : "") + Sefaria._("here"); + const he = Sefaria._("no_web_pages") + (filterName ? Sefaria._("from") + filterName : "") + Sefaria._("here"); return
; @@ -1296,9 +1296,9 @@ const AdvancedToolsList = ({srefs, canEditText, currVersions, setConnectionsMode return (
- - !Sefaria._uid ? toggleSignUpModal(SignUpModalKind.AddConnection) : setConnectionsMode("Add Connection")} /> - {editText ? () : null} + + !Sefaria._uid ? toggleSignUpModal(SignUpModalKind.AddConnection) : setConnectionsMode("Add Connection")} /> + {editText ? () : null}
); } @@ -1434,29 +1434,29 @@ class ShareBox extends Component { const classes = classNames({ textList: 1, fullPanel: this.props.fullPanel }); return (
- +
{this.state.sheet && Sefaria._uid === this.state.sheet.owner ?
- People with this link can + people_with_link
: null}
- - - - {/* */} + + + + {/* */}
); } @@ -1510,10 +1510,10 @@ class AddNoteBox extends Component { $(ReactDOM.findDOMNode(this)).find(".noteText").val(""); this.props.onSave(); } else { - alert(Sefaria._("Sorry, there was a problem saving your note.")); + alert(Sefaria._("note_save_warning")); } }.bind(this)).fail(function (xhr, textStatus, errorThrown) { - alert(Sefaria._("Unfortunately, there was an error saving this note. Please try again or try reloading this page.")); + alert(Sefaria._("note_save_error_try_again")); }); this.setState({ saving: true }); } @@ -1524,8 +1524,8 @@ class AddNoteBox extends Component { this.setState({ isPrivate: false }); } deleteNote() { - alert(Sefaria._("Something went wrong (that's all I know).")); - if (!confirm(Sefaria._("Are you sure you want to delete this note?"))) { return; } + alert(Sefaria._("something_went_wrong")); + if (!confirm(Sefaria._("note_confirm_delete_request"))) { return; } Sefaria.deleteNote(this.props.noteId).then(this.props.onDelete); } render() { @@ -1536,17 +1536,17 @@ class AddNoteBox extends Component { //const publicClasses = classNames({ notePublicButton: 1, active: !this.state.isPrivate }); return (
- +
- {this.props.noteId ? Sefaria._("Save") : Sefaria._("Add Note")} + {this.props.noteId ? Sefaria._("button.save") : Sefaria._("text.add_note")}
{this.props.noteId ?
- { Sefaria._("Cancel")} + { Sefaria._("button.cancel")}
: null} {this.props.noteId ? (
- { Sefaria._("Delete Note")} + { Sefaria._("note.delete_note")}
) : null}
); } @@ -1695,17 +1695,17 @@ class AddConnectionBox extends Component { {this.props.srefs.length === 1 ?
- { Sefaria._("Choose a text to connect")} + { Sefaria._("connection.choose_text_to_connect")}
- { Sefaria._("Browse")} + { Sefaria._("browse")}
: null} {this.props.srefs.length > 2 ?
- { Sefaria._("We currently only understand connections between two texts")} + { Sefaria._("messange.we_only_understand_connection_betweeen_two_texts")}
: null} @@ -1720,20 +1720,17 @@ class AddConnectionBox extends Component {
- {Sefaria._("Add Connection")} + {Sefaria._("add_connection")}
@@ -1772,11 +1769,11 @@ function ManuscriptImage(props) { :

{manuscript.manuscript.title}

}
- {Sefaria._("Location")} {manuscript['page_id'].replace(/_/g, ' ')}
+ {Sefaria._("location")} {manuscript['page_id'].replace(/_/g, ' ')}
{ manuscript.manuscript[description] ? - + {manuscript.manuscript[description]}
: '' @@ -1792,7 +1789,7 @@ function ManuscriptImage(props) {
: '' } - + { Sefaria.util.parseUrl(manuscript.manuscript['source']).host.replace("www.", "") } diff --git a/static/js/ConnectionsPanelHeader.jsx b/static/js/ConnectionsPanelHeader.jsx index 1879cd15ea..5b91009eb2 100644 --- a/static/js/ConnectionsPanelHeader.jsx +++ b/static/js/ConnectionsPanelHeader.jsx @@ -52,7 +52,7 @@ class ConnectionsPanelHeader extends Component { if (this.props.connectionsMode === "Resources") { // Top Level Menu title =
- +
; } else if ((this.props.previousCategory && this.props.connectionsMode === "TextList") || previousMode) { @@ -83,11 +83,11 @@ class ConnectionsPanelHeader extends Component { - { Sefaria._("Resources") } + { Sefaria._("panel.resources") } - { Sefaria._("Resources")} + { Sefaria._("panel.resources")} ; diff --git a/static/js/DictionarySearch.jsx b/static/js/DictionarySearch.jsx index 9035afe49e..75376e7d60 100644 --- a/static/js/DictionarySearch.jsx +++ b/static/js/DictionarySearch.jsx @@ -102,7 +102,7 @@ class DictionarySearch extends Component { source: function(request, response) { if (Sefaria.hebrew.containsEnglish(request.term)) { - response([{label: Sefaria._("Invalid entry. Please type a Hebrew word.") , value: "__invalid"}]); + response([{label: Sefaria._("message.error_invalid_entry") , value: "__invalid"}]); return } Sefaria.lexiconCompletion( @@ -179,12 +179,12 @@ class DictionarySearch extends Component { image of maginfying glass
); diff --git a/static/js/EditCollectionPage.jsx b/static/js/EditCollectionPage.jsx index 9c75977cb0..9925015e2c 100644 --- a/static/js/EditCollectionPage.jsx +++ b/static/js/EditCollectionPage.jsx @@ -22,7 +22,7 @@ class EditCollectionPage extends Component { componentDidMount() { $(window).on("beforeunload", function() { if (this.changed) { - return Sefaria._("You have unsaved changes to your collection."); + return Sefaria._("collection.message.unsaved_changes"); } }.bind(this)); } @@ -36,7 +36,7 @@ class EditCollectionPage extends Component { var field = idToField[e.target.id]; var file = e.currentTarget.files[0]; if (file.size > MAX_IMAGE_SIZE) { - alert(Sefaria._("Images must be smaller than ") + MAX_IMAGE_MB + "MB."); + alert(Sefaria._("collection.message.image_resize ") + MAX_IMAGE_MB + "MB."); return; } var formData = new FormData(); @@ -59,7 +59,7 @@ class EditCollectionPage extends Component { } }.bind(this), fail: function() { - alert(Sefaria._("Unfortunately an error occurred uploading your file.")) + alert(Sefaria._("collection.message_error_upload_image")) this.clearUploading(field); } }); @@ -91,7 +91,7 @@ class EditCollectionPage extends Component { this.setState({listed: !!e.target.checked}); } delete() { - if (confirm(Sefaria._("Are you sure you want to delete this collection? This cannot be undone."))) { + if (confirm(Sefaria._("collection.message.comfirm_delete_collection"))) { $.ajax({ url: "/api/collections/" + this.props.initialData.slug, type: "DELETE", @@ -103,7 +103,7 @@ class EditCollectionPage extends Component { } }, fail: function() { - alert(Sefaria._("Unfortunately an error occurred deleting your collection.")); + alert(Sefaria._("collection.message.error_deleting_collection")); } }); } @@ -122,11 +122,11 @@ class EditCollectionPage extends Component { window.location = "/collections/" + data.collection.slug; } }.bind(this)).fail(function() { - alert(Sefaria._("Unfortunately an error occurred saving your collection.")); + alert(Sefaria._("collection.save_error")); }); } render() { - const title = this.props.initialData ? "Edit Collection" : "Create a Collection"; + const title = this.props.initialData ? "collection.edit_collection" : "collection.create_collection"; return (
@@ -146,28 +146,28 @@ class EditCollectionPage extends Component {
{this.state.imageUrl ? Collection Image @@ -175,11 +175,11 @@ class EditCollectionPage extends Component {
- Recommended size: 350px x 350px or larger + collection.image_size
@@ -187,7 +187,7 @@ class EditCollectionPage extends Component { {this.state.headerUrl ?
{this.state.headerUrl ?
@@ -198,11 +198,11 @@ class EditCollectionPage extends Component {
- Recommended size: 1000px width to fill sheet, smaller images align right + collection.recommended_size
: null } @@ -211,7 +211,7 @@ class EditCollectionPage extends Component { {this.props.initialData ?
{this.state.moderationStatus !== "nolist" ?
@@ -226,7 +226,7 @@ class EditCollectionPage extends Component {
- Your collection will appear on the public collections page where others can find it. + collection.message._appear_collection_in_public
:
@@ -237,7 +237,7 @@ class EditCollectionPage extends Component { {this.props.initialData ?
- Delete Collection + collection.delete_collection
: null} diff --git a/static/js/Header.jsx b/static/js/Header.jsx index c2f892eaac..425dee1c3e 100644 --- a/static/js/Header.jsx +++ b/static/js/Header.jsx @@ -48,10 +48,10 @@ class Header extends Component {
{ Sefaria._siteSettings.TORAH_SPECIFIC ? {logo} : null } - Texts - Topics - Community - {/*Donate*/} + header.text + header.topic + header.community + {/*header.donate*/}
@@ -139,7 +139,7 @@ class SearchBar extends Component { this.state = { searchFocused: false }; - this._searchOverridePre = Sefaria._('Search for') +': "'; + this._searchOverridePre = Sefaria._("search_for") +': "'; this._searchOverridePost = '"'; this._type_icon_map = { "Collection": "collection.svg", @@ -376,12 +376,12 @@ class SearchBar extends Component { + title={Sefaria._("search_text_or_keywords")} />
); } @@ -515,7 +515,7 @@ const MobileNavMenu = ({onRefClick, showSearch, openTopic, openURL, close, visib */} - Collections + profile.tab.collection {/* @@ -528,15 +528,15 @@ const MobileNavMenu = ({onRefClick, showSearch, openTopic, openURL, close, visib <> - Profile + header.profileMenu.profile - Saved & History + save_and_history - Notifications + notifications : null } @@ -549,7 +549,7 @@ const MobileNavMenu = ({onRefClick, showSearch, openTopic, openURL, close, visib <> - Account Settings + header.profileMenu.account_settings : null } @@ -557,13 +557,13 @@ const MobileNavMenu = ({onRefClick, showSearch, openTopic, openURL, close, visib - Get Help + get_help {Sefaria._uid ? - Logout + header.profileMenu.log_out : } @@ -634,10 +634,10 @@ const ProfilePicMenu = ({len, url, name}) => { Profile


@@ -651,7 +651,7 @@ const ProfilePicMenu = ({len, url, name}) => {

: null}
@@ -695,7 +695,7 @@ const HelpButton = () => { return ( ); diff --git a/static/js/Misc.jsx b/static/js/Misc.jsx index 2f54ad53dd..9fdb7b679d 100644 --- a/static/js/Misc.jsx +++ b/static/js/Misc.jsx @@ -178,7 +178,7 @@ class ProfilePic extends Component { onSelectFile(e) { if (e.target.files && e.target.files.length > 0) { if (!e.target.files[0].type.startsWith('image/')) { - this.setState({ error: Sefaria._("file_error_message")}); + this.setState({ error: Sefaria._("file.message.error")}); return; } const reader = new FileReader(); @@ -309,7 +309,7 @@ class ProfilePic extends Component { (
{ event.target.value = null}}/>
) : null } @@ -333,14 +333,14 @@ class ProfilePic extends Component { { (uploading || isFirstCropChange) ? (
) : (
- { Sefaria._("Drag corners to crop image") } + { Sefaria._("drag_corners_to_crop_images") }
@@ -464,7 +464,7 @@ const FilterableList = ({ setFilter(e.target.value)} @@ -476,8 +476,8 @@ const FilterableList = ({ setDisplaySort(prev => !prev)} - enText={ Sefaria._("Sort") } - heText={ Sefaria._("Sort") } + enText={ Sefaria._("profile.tab.dropdown.sort") } + heText={ Sefaria._("profile.tab.dropdown.sort") } /> setFilter(e.target.value)} @@ -504,7 +504,7 @@ const FilterableList = ({
- Sort by + profile.tab.dropdown.sort_by { sortOptions.map(option =>(
- Site Language + setting.site_language
བོད་ཡིག @@ -1432,14 +1432,14 @@ function InterfaceLanguageMenu({currentLang, translationLanguagePreference, setT { !!translationLanguagePreference ? ( <>
- Preferred Translation + text.admin.prefferred_translation
{Sefaria.translateISOLanguageCode(translationLanguagePreference, false)} - Reset + topic.reset
@@ -1749,7 +1749,7 @@ const SheetListing = ({ }; const handleSheetDeleteClick = () => { - if (confirm(Sefaria._("Are you sure you want to delete this sheet? There is no way to undo this action."))) { + if (confirm(Sefaria._("sheet.delete_warning_msg"))) { Sefaria.sheets.deleteSheetById(sheet.id).then(handleSheetDelete); } }; @@ -1762,7 +1762,7 @@ const SheetListing = ({ } }; - const title = sheet.title ? sheet.title.stripHtmlConvertLineBreaks() : Sefaria._("Untitled Source Sheet"); + const title = sheet.title ? sheet.title.stripHtmlConvertLineBreaks() : Sefaria._("sheet.untitled_sourc_sheet"); const viewsIcon = sheet.public ?
{sheet.views}
@@ -1770,7 +1770,7 @@ const SheetListing = ({ const views = ( <> - {sheet.views} Views + {sheet.views} profile.tab.sheet.tag.views ); @@ -1827,7 +1827,7 @@ const SheetListing = ({ }); const created = Sefaria.util.localeDate(sheet.created); const underInfo = infoUnderneath ? [ - sheet.status !== 'public' ? ({Sefaria._("Not Published")}) : undefined, + sheet.status !== 'public' ? ({Sefaria._("profile.tab.sheet.tag.not_published")}) : undefined, showAuthorUnderneath ? ({sheet.ownerName}) : undefined, views, created, @@ -1837,8 +1837,8 @@ const SheetListing = ({ const pinButtonClasses = classNames({sheetListingPinButton: 1, pinned: pinned, active: pinnable}); - const pinMessage = pinned && pinnable ? Sefaria._("Pinned Sheet - click to unpin") : - pinned ? Sefaria._("Pinned Sheet") : Sefaria._("Pin Sheet"); + const pinMessage = pinned && pinnable ? Sefaria._("collection.unpin_sheet") : + pinned ? Sefaria._("collection.pinned_sheet") : Sefaria._("collection.pin_sheet"); const pinButton = return ( @@ -1864,17 +1864,17 @@ const SheetListing = ({
{ editable && !Sefaria._uses_new_editor ? - + : null } { collectable ? - + : null } { deletable ? - + : null } { @@ -1924,7 +1924,7 @@ const CollectionListing = ({data}) => { {`${data.sheetCount} `} - Sheets + sheets {data.memberCount > 1 ? @@ -1933,7 +1933,7 @@ const CollectionListing = ({data}) => { {data.memberCount > 1 ? {`${data.memberCount} `} - Editors + collection.editor : null }
@@ -1988,13 +1988,13 @@ class LoginPrompt extends Component { return (
- { Sefaria._("Please log in to use this feature.")} + { Sefaria._("message.login_to_use_feature")}
- { Sefaria._("Log In")} + { Sefaria._("log_in")} - { Sefaria._("Sign Up")} + { Sefaria._("sign_up")}
); } @@ -2037,7 +2037,7 @@ class SignUpModal extends Component {
- { Sefaria._("Already have an account?")}   + { Sefaria._("sign_up.already_have_account")}   { Sefaria._("Sign in")}
@@ -2553,8 +2553,8 @@ Dropdown.propTypes = { class LoadingMessage extends Component { render() { - var message = this.props.message || Sefaria._("Loading...") ; - var heMessage = this.props.heMessage || Sefaria._("Loading..."); + var message = this.props.message || Sefaria._("loading...") ; + var heMessage = this.props.heMessage || Sefaria._("loading..."); var classes = "loadingMessage sans-serif " + (this.props.className || ""); return (
@@ -2634,12 +2634,12 @@ class FeedbackBox extends Component { } sendFeedback() { if (!this.state.type) { - this.setState({alertmsg: Sefaria._("Please select a feedback type")}); + this.setState({alertmsg: Sefaria._("feedback.please_select_type")}); return } if (!Sefaria._uid && !this.validateEmail($("#feedbackEmail").val())) { - this.setState({alertmsg: Sefaria._("Please enter a valid email address")}); + this.setState({alertmsg: Sefaria._("message.enter_valid_email")}); return } @@ -2665,7 +2665,7 @@ class FeedbackBox extends Component { Sefaria.track.event("Tools", "Send Feedback", this.props.url); } }.bind(this)).fail(function (xhr, textStatus, errorThrown) { - alert(Sefaria._("Unfortunately, there was an error sending this feedback. Please try again or try reloading this page.")); + alert(Sefaria._("feedback.message.error_sending_feedback")); this.setState({feedbackSent: true}); }); } @@ -2680,13 +2680,13 @@ class FeedbackBox extends Component { if (this.state.feedbackSent) { return (
-

{ Sefaria._("Feedback sent")}

+

{ Sefaria._("text.feedback.feedback_send")}

) } return (
-

{ Sefaria._("Have some feedback? We would love to hear it.") }

+

{ Sefaria._("text.feedback.have_feedback?") }

{this.state.alertmsg ?
@@ -2698,26 +2698,26 @@ class FeedbackBox extends Component { - + {!Sefaria._uid ? -
+
: null }
this.sendFeedback()}> - {Sefaria._("Submit")} + {Sefaria._("button.submit")}
); @@ -2775,8 +2775,8 @@ class CookiesNotification extends Component { - { Sefaria._("We use cookies to give you the best experience possible on our site. Click OK to continue using Pecha.") }{ Sefaria._("Learn More") } - { Sefaria._("OK") } + { Sefaria._("message.cookies_msg") }{ Sefaria._("learn_more") } + { Sefaria._("ok") }
@@ -2803,7 +2803,7 @@ const CommunityPagePreviewControls = ({date}) => { return (
- { Sefaria._("You are previewing the Community page for")} + { Sefaria._("community.message.previewing")} {date} @@ -2880,10 +2880,10 @@ const AdminToolHeader = function({title, validate, close}) {
- { Sefaria._("Cancel")} + { Sefaria._("button.cancel")}
- { Sefaria._("Save")} + { Sefaria._("button.save")}
@@ -2942,7 +2942,7 @@ const CategoryChooser = function({categories, update}) { {menus.map((menu, index) =>
)} @@ -3009,7 +3009,7 @@ const DivineNameReplacer = ({setDivineNameReplacement, divineNameReplacement}) = {value: "h", label:'ה׳'}, {value: "ykvk", label: 'יקוק'}, ]} - placeholder={Sefaria._("Select Type")} + placeholder={Sefaria._("select_type")} onChange={(e) => setDivineNameReplacement((e.target.value))} preselected={divineNameReplacement} /> diff --git a/static/js/ModeratorToolsPanel.jsx b/static/js/ModeratorToolsPanel.jsx index 2f1fde0688..3dfcd3327d 100644 --- a/static/js/ModeratorToolsPanel.jsx +++ b/static/js/ModeratorToolsPanel.jsx @@ -99,7 +99,7 @@ class ModeratorToolsPanel extends Component { const dlReady = (this.state.bulk_format && (this.state.bulk_title_pattern || this.state.bulk_version_title_pattern)); const downloadButton =
- {Sefaria._('Download')} + {Sefaria._("text.download")}
; const downloadSection = ( diff --git a/static/js/MyNotesPanel.jsx b/static/js/MyNotesPanel.jsx index 841b07462a..dd14a29bf8 100644 --- a/static/js/MyNotesPanel.jsx +++ b/static/js/MyNotesPanel.jsx @@ -57,7 +57,7 @@ class MyNotesPanel extends Component {
{this.props.hideNavHeader ? null : @@ -126,11 +126,10 @@ class NoteListing extends Component { return (
- {Sefaria._("Add to Sheet")} + {Sefaria._("sheet.add_to_sheet")}
- Add to Sheet - הוסף לדף מקורות + {Sefaria._("sheet.add_to_sheet")}
{this.props.showText ? diff --git a/static/js/NavSidebar.jsx b/static/js/NavSidebar.jsx index a533e345dd..9ab08dfb44 100644 --- a/static/js/NavSidebar.jsx +++ b/static/js/NavSidebar.jsx @@ -95,24 +95,8 @@ const Promo = () => const AboutSefaria = ({hideTitle}) => ( {!hideTitle ? - A Living Library of Buddhist Text : null } - - - The Pecha platform provides access to Buddhist scriptures in a variety of languages and styles to accommodate everyone's needs. - By searching for a single verse, users can discover its origins, various interpretations, translations into different languages, - commentaries, annotations, sub-commentaries, and references in other scriptures—all in one place. Whether casually exploring various - scriptures or engaging in deep study, users can share insights or personal experiences related to the subject through notes or comments - with other Dharma friends. Additionally, users can gain from the fresh insights shared by fellow readers in their notes. - - - དཔེ་ཆ་དྲ་བའི་ནང་དུ་ཁྱེད་རང་གི་དགོས་མཁོ་དང་འཚམ་པའི་ནང་པའི་གསུང་རབ་སྣ་ཚོགས་བཞུགས་ཡོད། དྲ་རྒྱ་འདིའི་ཁྱད་ཆོས་ནི། ཀློག་མཁན་རྣམས་ཀྱིས་སྟབས་བདེ་བོའི་ངང་ནས་གཞུང་ལུགས་ཆེན་པོ་རྣམས་ལ་སློབ་སྦྱོང་བྱེད་ཐུབ་ཀྱི་ཡོད། དཔེར་ན། རྩ་ཚིག་གཅིག་ཙམ་བཙལ་བས། ཚིག་དེ་གང་ནས་འབྱུང་བའི་ཁུངས་དང་། - ཚིག་སྦྱོར་དང་འགྱུར་མི་འདྲ་བ། སྐད་ཡིག་གཞན་པའི་ནང་དུ་འགྱུར་བ་གང་ཡོད། རྩ་ཚིག་དེའི་འགྲེལ་བ་དང་། མཆན་འགྲེལ། ཡང་འགྲེལ། བསྟན་བཅོས་གཞན་པའི་ནང་དུ་ཚིག་དེ་ལུང་དྲངས་པ་སོགས་དེ་དང་འབྲེལ་ཡོད་ཕལ་ཆེ་བ་སྟབས་གཅིག་ཏུ་ཀློག་ཐུབ། ཀློག་མཁན་ཁྱེད་ཀྱིས་ཐུགས་ལྷོད་ལྷོད་ངང་གསུང་རབ་སྣ་ཚོགས་ལ་རགས་བལྟ་དང་། ཞིབ་ཀློག་བྱེད་པའི་ཞོར་དུ། - སྐབས་བབ་བརྗོད་བྱ་དང་འབྲེལ་བའི་གོ་རྟོགས་གསར་པའམ། ཡང་ན་རང་གི་མི་ཚེའི་ནང་བྱུང་བའི་སྐྱིད་སྡུག་གི་ཉམས་མྱོང་རྣམས་ཟིན་བྲིས་དང་། མཆན་དུ་བྲིས་ཏེ་ཆོས་གྲོགས་གཞན་གྱི་ལོངས་སྤྱོད་དུ་སྤེལ་ཆོག་ལ་། ཆོས་གྲོགས་གཞན་གྱི་མྱོང་རྟོགས་གསར་པ་རྣམས་ཀྱང་རང་ཉིད་ཀྱིས་ལོངས་སྤྱོད་བྱེད་ཐུབ་ཀྱི་ཡོད། - - - Pecha平台提供多种语言和风格的佛教经典的访问,以满足每个人的需求。通过搜索一节经文,用户可以在一个地方找到它的起源、各种解释、不同语言的翻译、注释、注释、子注释和其他经文的参考。无论是随意探索各种经典,还是进行深入研究,用户都可以通过笔记或评论与其他佛友分享与该主题相关的见解或个人经历。此外,用户还可以从其他读者在笔记中分享的新鲜见解中获益。 - - + side_nav.about_pecha_title : null } + side_nav.about_pecha_description ); @@ -161,7 +145,7 @@ const AboutTranslatedText = ({translationsSlug}) => { const Resources = () => ( -

Resources

+ {/*

panel.resources

@@ -170,7 +154,7 @@ const Resources = () => ( -
+
*/} ); @@ -191,7 +175,7 @@ const SupportSefaria = ({white}) => (
donation icon - Make a Donation + side_nav.make_donation */} ); @@ -252,15 +236,15 @@ const AboutText = ({index, hideTitle}) => { return ( {hideTitle ? null : - About This Text} + side_nav.about_text} { composed || authors.length ?
{authors.length ?
{authors.length == 1 ? - Author: - : Authors:} + text.author: + : text.author:}  {authors} @@ -268,7 +252,7 @@ const AboutText = ({index, hideTitle}) => { {composed ?
- Composed: + text.composed:  {composed} @@ -339,7 +323,7 @@ const DafLink = () => { const Translations = () => { return ( - Translations + {/* Translations Access key works from the library in several languages. @@ -348,7 +332,7 @@ const Translations = () => { יצירות נבחרות מהספרייה בתרגומים לשפות שונות. - + */} ) } @@ -356,10 +340,10 @@ const Translations = () => { const LearningSchedules = () => { return ( - Learning Schedules + {/* Learning Schedules
- Weekly Torah Portion: + weekly_torah_portion:
@@ -380,7 +364,7 @@ const LearningSchedules = () => { All Learning Schedules › לוחות לימוד נוספים › -
+ */} ); }; @@ -483,23 +467,15 @@ const Visualizations = ({categories}) => { const AboutTopics = ({hideTitle}) => ( {hideTitle ? null : - About Topics } - - - ཤོག་ངོས་འདིའི་ནང་དུ། དོན་དག་སྣ་ཚོགས་དང་འབྲེལ་བའི་ལུང་དང་། འབྲེལ་ཡོད་ཀྱི་བསྟན་བཅོས། ཀློག་མཁན་གྱིས་སྤེལ་བའི་ཟིན་བྲིས་སོགས་བརྗོད་གཞི་ལྟར་ལྟ་ཀློག་བྱེད་པའམ། ཡང་ན། ཁྱེད་རང་གིས་ལྟ་འདོད་པའི་དམིགས་བསལ་གྱི་བརྗོད་གཞི་གང་རུང་འཚོལ་བཤེར་བྱེད་ཆོག། - ད་དུང་དྲ་བའི་ཟུར་ངོས་སུ་མི་མང་པོས་དོ་སྣང་བྱེད་སའི་བརྗོད་གཞི་ཚ་ཤོས་གང་ཡིན་གོ་རིམ་ལྟར་གསལ་བ་ལས་ཀྱང་རང་འདོད་ལྟར་བཀླག་ཆོག། མདོར་ན། ཤོག་ངོས་འདིའི་ནང་ལྟ་ཀློག་མང་ཙམ་གྱིས་དང་། ཁྱེད་རང་ལ་སྤྲོ་སྣང་འདྲེན་པའི་བརྗོད་གཞི་མང་པོ་ཡོད། - - - Topics Pages present a curated selection of various genres of sources on thousands of chosen subjects. You can browse by category, - search for something specific, or view the most popular topics — and related topics — on the sidebar. Explore and click through to learn more. - + topic.about } + topic.about_description ); const TrendingTopics = () => ( - Trending Topics + topic.trend {Sefaria.trendingTopics.map((topic, i) =>
@@ -519,7 +495,7 @@ const RelatedTopics = ({title}) => { },[title]); return (topics.length ? - Related Topics + side_nav.related_topic {shownTopics.map((topic, i) =>
@@ -539,16 +515,16 @@ const JoinTheConversation = ({wide}) => { return ( -
- Join the Conversation - Combine sources from our library with your own comments, questions, images, and videos. + {/*
+ side_nav.join_conversation + topic.combine_source
+
*/}
); }; @@ -557,16 +533,16 @@ const JoinTheConversation = ({wide}) => { const JoinTheCommunity = ({wide}) => { return ( -
- Join the Conversation - People around the world use Sefaria to create and share Torah resources. You're invited to add your voice. + {/*
+ side_nav.join_conversation + side_nav.join_conversation.descriptions
+
*/}
); }; @@ -596,8 +572,8 @@ const StayConnected = () => { // TODO: remove? looks like we are not using this return ( - Stay Connected - Get updates on new texts, learning resources, features, and more. + side_nav.stay_connected + side_nav.stay_connected.decription
{/**/} @@ -621,7 +597,7 @@ const StayConnected = () => { // TODO: remove? looks like we are not using this const AboutLearningSchedules = () => ( - Learning Schedules + {/* Learning Schedules Since biblical times, the Torah has been divided into sections which are read each week on a set yearly calendar. @@ -631,7 +607,7 @@ const AboutLearningSchedules = () => ( מימי קדם חולקה התורה לקטעי קריאה שבועיים שנועדו לסיום הספר כולו במשך תקופת זמן של שנה. בעקבות המנהג הזה התפתחו לאורך השנים סדרי לימוד תקופתיים רבים נוספים, ובעזרתם יכולות קהילות וקבוצות של לומדים ללמוד יחד טקסטים שלמים. - + */} ); @@ -639,16 +615,13 @@ const AboutLearningSchedules = () => ( const AboutCollections = ({hideTitle}) => ( {hideTitle ? null : - About Collections} - - Collections are user generated bundles of sheets which can be used privately, shared with friends, or made public on Pecha. - དཔེ་ཆ་དྲ་བའི་ཆེད་བསྒྲིགས་རྣམས་ནི་དྲ་བ་འདིའི་ཀློག་མཁན་རྣམས་ཀྱིས་བཟོས་པ་ཡིན་ལ། འདི་དག་བེད་སྤྱོད་བྱེད་སྟངས་གསུམ་ཡོད་དེ། ཁྱེད་རང་གཅིག་པུས་སྤྱོད་པ་དང་། གྲོགས་པོ་གཞན་དང་མཉམ་སྤྱོད་བྱེད་པ། ཡང་ན། ཀློག་མཁན་ཡོངས་ཀྱི་བགོ་སྐལ་དུ་ཕུལ་ཀྱང་ཆོག་པ་ཡིན། - + collection.about} + collection.description_detail {hideTitle ? null : } @@ -657,12 +630,12 @@ const AboutCollections = ({hideTitle}) => ( const ExploreCollections = () => ( - Collections - Organizations, communities and individuals around the world curate and share collections of sheets for you to explore. + profile.tab.collection + side_nav.collection.description @@ -671,7 +644,7 @@ const ExploreCollections = () => ( const WhoToFollow = ({toggleSignUpModal}) => ( - Who to Follow + side_nav.who_to_follow {Sefaria.followRecommendations.map(user => )} @@ -758,7 +731,7 @@ const DownloadVersions = ({sref}) => { return( - Download Text + side_nav.download_text
{ })).concat( // add merged versions for both primary langs "en" and "he" where applicable. (not yet possible for individual actual languages) versions.map(v => v.language).unique().map(lang => ({ value: `merged/${lang}`, - label: `${Sefaria._("Merged Version", "DownloadVersions")} (${Sefaria._(Sefaria.translateISOLanguageCode(lang))})`, + label: `${Sefaria._("side_nav.download_text.merged_version")} (${Sefaria._(Sefaria.translateISOLanguageCode(lang))})`, })) ) } - placeholder={Sefaria._( "Select Version", "DownloadVersions")} + placeholder={Sefaria._( "side_nav.download_text.select_version")} onChange={handleInputChange} /> - {Sefaria._("Download")} + {Sefaria._("text.download")}
); diff --git a/static/js/NewsletterSignUpForm.jsx b/static/js/NewsletterSignUpForm.jsx index 56a7a52dfd..9a602b5fde 100644 --- a/static/js/NewsletterSignUpForm.jsx +++ b/static/js/NewsletterSignUpForm.jsx @@ -38,7 +38,7 @@ export function NewsletterSignUpForm({ setShowNameInputs(true); } else { setShowNameInputs(false); - setSubscribeMessage("Please enter a valid email address."); + setSubscribeMessage("message.enter_valid_email"); } } @@ -65,7 +65,7 @@ export function NewsletterSignUpForm({ <> setFirstName(e.target.value)} @@ -82,7 +82,7 @@ export function NewsletterSignUpForm({ setLastName(e.target.value)} onKeyUp={handleSubscribeKeyUp}/> diff --git a/static/js/NoteListing.jsx b/static/js/NoteListing.jsx index 188ce844af..82afc42b33 100644 --- a/static/js/NoteListing.jsx +++ b/static/js/NoteListing.jsx @@ -29,7 +29,7 @@ class NoteListing extends Component { $(".addToSourceSheetModal").position({my: "center center-40", at: "center center", of: window}); } deleteNote() { - if (!confirm(Sefaria._("Are you sure you want to delete this note?"))) { return; } + if (!confirm(Sefaria._("note_confirm_delete_request"))) { return; } const resolve = this.props.onDeleteNote || (()=>{}); Sefaria.deleteNote(this.props.data._id).then(resolve); } diff --git a/static/js/NotificationsPanel.jsx b/static/js/NotificationsPanel.jsx index 66b328d28a..e44aa7f1f4 100644 --- a/static/js/NotificationsPanel.jsx +++ b/static/js/NotificationsPanel.jsx @@ -83,7 +83,7 @@ class NotificationsPanel extends Component {

- Notifications + notifications

{ Sefaria.notificationCount > 0 ? : null}
{ Sefaria._uid ? @@ -155,7 +155,7 @@ const SheetPublishNotification = ({date, content}) => { const topLine = ( <> {content.name}  - published a new sheet + sheet.publish_new_sheet ); @@ -185,7 +185,7 @@ const SheetLikeNotification = ({date, content}) => { const topLine = ( <> {content.name}  - liked your sheet + sheet.liked_your_sheet ); @@ -211,7 +211,7 @@ const FollowNotification = ({date, content}) => { const topLine = ( <> {content.name}  - is now following you + is_following_you" ); @@ -240,7 +240,7 @@ const CollectionAddNotification = ({date, content}) => { const topLine = ( <> {content.name}  - added you to a collection + collection.add_you_to_collection ); @@ -270,7 +270,7 @@ const IndexNotification = ({date, content}) => { const topLine = ( <> - New Text:  + text.new_text diff --git a/static/js/PublicCollectionsPage.jsx b/static/js/PublicCollectionsPage.jsx index 5d71fd7b16..3163c2a96d 100644 --- a/static/js/PublicCollectionsPage.jsx +++ b/static/js/PublicCollectionsPage.jsx @@ -66,7 +66,7 @@ const PublicCollectionsPage = ({multiPanel, initialWidth}) => {

- Collections + collections

{multiPanel ? null : @@ -85,7 +85,7 @@ const PublicCollectionsPage = ({multiPanel, initialWidth}) => {
{enCollBox}
{heCollBox}
) - : There are no public collections yet.) + : collection.message.no_public_collection) : }
diff --git a/static/js/ReaderApp.jsx b/static/js/ReaderApp.jsx index 136f28f2a6..5c84aecb96 100644 --- a/static/js/ReaderApp.jsx +++ b/static/js/ReaderApp.jsx @@ -527,7 +527,7 @@ class ReaderApp extends Component { hist.mode = "collection"; break; case "collectionsPublic": - hist.title = Sefaria._("Collections") + " | " + Sefaria._(siteName); + hist.title = Sefaria._("collection") + " | " + Sefaria._(siteName); hist.url = "collections"; hist.mode = "collcetionsPublic"; break; @@ -547,7 +547,7 @@ class ReaderApp extends Component { hist.mode = "updates"; break; case "modtools": - hist.title = Sefaria._("Moderator Tools"); + hist.title = Sefaria._("moderator_tools"); hist.url = "modtools"; hist.mode = "modtools"; break; diff --git a/static/js/ReaderPanel.jsx b/static/js/ReaderPanel.jsx index a8e1cb2cd0..246521ea35 100644 --- a/static/js/ReaderPanel.jsx +++ b/static/js/ReaderPanel.jsx @@ -1310,7 +1310,7 @@ class ReaderControls extends Component { return null } else { return ( -
{Sefaria._("In Progress")}
+
{Sefaria._("text.versions.in_progress")}
) } } @@ -1333,11 +1333,11 @@ class ReaderControls extends Component { if (this.props.sheetID) { if (this.props.sheetTitle === null) { - title = heTitle = Sefaria._("Loading..."); + title = heTitle = Sefaria._("loading..."); } else { title = heTitle = this.props.sheetTitle; if (title === "") { - title = heTitle = Sefaria._("Untitled") + title = heTitle = Sefaria._("sheet.untitled") } } @@ -1564,7 +1564,7 @@ class ReaderDisplayOptionsMenu extends Component { this.props.parentPanel === "Sheet" ? null : ( 500 ? ); let aliyahOptions = [ - {name: "aliyotOn", content: Sefaria._("On"), role: "radio", ariaLabel: Sefaria._("Show Parasha Aliyot") }, - {name: "aliyotOff", content: Sefaria._("Off"), role: "radio", ariaLabel: Sefaria._("Hide Parasha Aliyot") }, + {name: "aliyotOn", content: Sefaria._("on"), role: "radio", ariaLabel: Sefaria._("Show Parasha Aliyot") }, + {name: "aliyotOff", content: Sefaria._("off"), role: "radio", ariaLabel: Sefaria._("Hide Parasha Aliyot") }, ]; let aliyahToggle = this.renderAliyotToggle() ? ( this.props.parentPanel == "Sheet" ? null : @@ -1622,14 +1622,14 @@ class ReaderDisplayOptionsMenu extends Component { currentValue={this.props.settings.aliyotTorah} />) : null; let vowelsOptions = [ - {name: "all", content: "אָ֑", role: "radio", ariaLabel: Sefaria._("Show Vowels and Cantillation")}, - {name: "partial", content: "אָ", role: "radio", ariaLabel: Sefaria._("Show only vowel points")}, - {name: "none", content: "א", role: "radio", ariaLabel: Sefaria._("Show only consonantal text")} + {name: "all", content: "אָ֑", role: "radio", ariaLabel: Sefaria._("show_vowels")}, + {name: "partial", content: "אָ", role: "radio", ariaLabel: Sefaria._("show_only_vowels")}, + {name: "none", content: "א", role: "radio", ariaLabel: Sefaria._("show_only_consonenetal_text")} ]; let vowelToggle = null; if(!this.props.menuOpen){ let vowelOptionsSlice = this.vowelToggleAvailability(); - let vowelOptionsTitle = (vowelOptionsSlice == 0) ? Sefaria._("Vocalization") : Sefaria._("Vowels"); + let vowelOptionsTitle = (vowelOptionsSlice == 0) ? Sefaria._("vocalization") : Sefaria._("vowels"); vowelsOptions = vowelsOptions.slice(vowelOptionsSlice); vowelToggle = (this.props.settings.language !== "english" && vowelsOptions.length > 1) ? this.props.parentPanel == "Sheet" ? null : @@ -1643,13 +1643,13 @@ class ReaderDisplayOptionsMenu extends Component { } let punctuationOptions = [ - {name: "punctuationOn", content: Sefaria._("On"), role: "radio", ariaLabel: Sefaria._("Show Punctuation")}, - {name: "punctuationOff", content: Sefaria._("Off"), role: "radio", ariaLabel: Sefaria._("Hide Punctuation")} + {name: "punctuationOn", content: Sefaria._("on"), role: "radio", ariaLabel: Sefaria._("show_punchuation")}, + {name: "punctuationOff", content: Sefaria._("off"), role: "radio", ariaLabel: Sefaria._("hide_punchuation")} ] let punctuationToggle = this.shouldPunctuationToggleRender() ? ( {data.name}, role: "radio", - ariaLabel: Sefaria._("Sort by") + " " + Sefaria._(data.name), + ariaLabel: Sefaria._("profile.tab.dropdown.sort_by") + " " + Sefaria._(data.name), })); return Sefaria.multiPanel && !this.props.compare ? ( @@ -78,13 +78,13 @@ class SearchFilters extends Component { <>
- Filters + filter

- Sort by + profile.tab.dropdown.sort_by

- Exact Matches Only + {_("exact_matches_only")}
@@ -321,8 +321,8 @@ class SearchFilter extends Component { } render() { const { filter, expandable } = this.props; - const toggleMessage = Sefaria._("Press enter to toggle search filter for ") + filter.title + "."; - const expandMessage = filter.title + Sefaria._("Press enter to toggle the list of specific books within "); + const toggleMessage = Sefaria._("search.message.toggle_filter") + filter.title + "."; + const expandMessage = filter.title + Sefaria._("search.message.toggle_list_of_books"); return ( <> diff --git a/static/js/SearchPage.jsx b/static/js/SearchPage.jsx index d75b42c4f6..930985eb58 100644 --- a/static/js/SearchPage.jsx +++ b/static/js/SearchPage.jsx @@ -41,7 +41,7 @@ class SearchPage extends Component {

- Results for  + {_("results_for")}  { this.props.query } @@ -49,7 +49,7 @@ class SearchPage extends Component { {this.state.totalResults?.getValue() > 0 ?
{this.state.totalResults.asString()}  - Results + {_("results")}
: null }

diff --git a/static/js/SearchResultList.jsx b/static/js/SearchResultList.jsx index c89f25fd5e..a3b88fbc09 100644 --- a/static/js/SearchResultList.jsx +++ b/static/js/SearchResultList.jsx @@ -32,11 +32,11 @@ const SourcesSheetsDiv = (props) => { } if (props?.numSources > 0) { - const sourcesDiv = {props.numSources} Sources; + const sourcesDiv = {props.numSources} sheet.sources; sourcesSheetsCounts.push(sourcesDiv); } if (props?.numSheets > 0) { - const sheetsDiv = {props.numSheets} Sheets; + const sheetsDiv = {props.numSheets} sheets; sourcesSheetsCounts.push(sheetsDiv); } @@ -542,8 +542,8 @@ class SearchResultList extends Component { } } - const loadingMessage = (); - const noResultsMessage = (); + const loadingMessage = (); + const noResultsMessage = (); const queryFullyLoaded = !this.state.moreToLoad[tab] && !this.state.isQueryRunning[tab]; const haveResults = !!results.length; @@ -637,8 +637,8 @@ const SearchSortBox = ({type, updateAppliedOptionSort, sortType}) => { {setIsOpen(!isOpen)}} - enText={Sefaria._("Sort") } - heText={Sefaria._("Sort") } + enText={Sefaria._("profile.tab.dropdown.sort") } + heText={Sefaria._("profile.tab.dropdown.sort") } buttonStyle={true} /> (
- Filter + filter {!!nFilters ? <> ({nFilters.toString()}) : null}
); diff --git a/static/js/SearchTextResult.jsx b/static/js/SearchTextResult.jsx index 34825a17ab..9859eb9892 100644 --- a/static/js/SearchTextResult.jsx +++ b/static/js/SearchTextResult.jsx @@ -115,7 +115,7 @@ class SearchTextResult extends Component { // const more_results_indicator = (!(data.duplicates)) ? "" : //
// - // {data.duplicates.length} {(data.duplicates.length > 1) ? Sefaria._("moreResults") : Sefaria._("anotherResult")} + // {data.duplicates.length} {(data.duplicates.length > 1) ? Sefaria._("search.more_results") : Sefaria._("search.another_result")} // // // {data.duplicates.length} more version{(data.duplicates.length > 1) ? "s" : null} diff --git a/static/js/Sheet.jsx b/static/js/Sheet.jsx index 8383e75996..22f1d159e0 100644 --- a/static/js/Sheet.jsx +++ b/static/js/Sheet.jsx @@ -374,7 +374,7 @@ class SheetContent extends Component {
- {Sefaria._("Created with")} + {Sefaria._("sheet.created_with")}
) @@ -405,7 +405,7 @@ class SheetSource extends Component {
- {Sefaria._("Added by")}: + {Sefaria._("added_by")}:
: null } @@ -463,7 +463,7 @@ class SheetComment extends Component { return (
-
+
+

{this.props.source.outsideText.stripHtml()}

@@ -532,7 +532,7 @@ class SheetOutsideText extends Component { return (
-
this.shouldPassClick(e)} aria-label={ Sefaria._("Click to see")+ this.props.linkCount + Sefaria._("connections to this source")} tabIndex="0" onKeyPress={function(e) {e.charCode == 13 ? this.props.sheetSourceClick(e):null}.bind(this)} > +
this.shouldPassClick(e)} aria-label={ Sefaria._("sheet.button_click_to_see")+ this.props.linkCount + Sefaria._("sheet.connections_to_this_source")} tabIndex="0" onKeyPress={function(e) {e.charCode == 13 ? this.props.sheetSourceClick(e):null}.bind(this)} >
{this.props.source.options && this.props.source.options.sourcePrefix && this.props.source.options.sourcePrefix !== "" ? {this.props.source.options.sourcePrefix} : null }
@@ -542,7 +542,7 @@ class SheetOutsideText extends Component { {this.props.source.addedBy ?
- {Sefaria._("Added by")}: + {Sefaria._("added_by")}:
: null } @@ -569,7 +569,7 @@ class SheetOutsideBiText extends Component { return (
-
+
{this.props.source.options && this.props.source.options.sourcePrefix && this.props.source.options.sourcePrefix !== "" ? {this.props.source.options.sourcePrefix} : null } @@ -584,7 +584,7 @@ class SheetOutsideBiText extends Component { {this.props.source.addedBy ?
- {Sefaria._("Added by")}: + {Sefaria._("added_by")}:
: null } @@ -649,12 +649,12 @@ class SheetMedia extends Component { ); return (
-
+
{this.props.source.addedBy ? -
{Sefaria._("Added by")}:
+
{Sefaria._("added_by")}:
: null }
diff --git a/static/js/SheetMetadata.jsx b/static/js/SheetMetadata.jsx index 63db7e6775..1a7ec83c79 100644 --- a/static/js/SheetMetadata.jsx +++ b/static/js/SheetMetadata.jsx @@ -99,14 +99,14 @@ class SheetMetadata extends Component { isFormValidated() { if ((!this.state.summary || this.state.summary.trim() == '') && this.state.tags.length == 0) { this.setState({ - validationMsg: Sefaria._("Please add a description and topics to publish your sheet."), + validationMsg: Sefaria._("topic.add_desription"), validationFailed: "both" }); return false } else if (!this.state.summary || this.state.summary.trim() == '') { this.setState({ - validationMsg: Sefaria._("Please add a description to publish your sheet."), + validationMsg: Sefaria._("sheet.add_description"), validationFailed: "summary" }); return false @@ -114,7 +114,7 @@ class SheetMetadata extends Component { else if (this.state.tags.length == 0) { this.setState({ - validationMsg: Sefaria._("Please add topics to publish your sheet."), + validationMsg: Sefaria._("topic.add_topic_to_sheet"), validationFailed: "topics" }); return false @@ -282,7 +282,7 @@ class SheetMetadata extends Component { const newSummary = event.target.value if (event.target.value.length > 280) { this.setState({ - validationMsg: Sefaria._("The summary description is limited to 280 characters."), + validationMsg: Sefaria._("summary_limit"), validationFailed: "summary" }); } @@ -327,7 +327,7 @@ class SheetMetadata extends Component {
- {Sefaria._("Table of Contents")} + {Sefaria._("text.table_of_contents")}
@@ -377,13 +377,13 @@ class SheetMetadata extends Component {
: null }
- {Sefaria._("Created")} {Sefaria.util.naturalTime(timestampCreated, "en")} {Sefaria._("ago")} · {sheet.views} {Sefaria._("Views")} · { !!this.state.sheetSaves ? this.state.sheetSaves.length + this.state.sheetLikeAdjustment : '--'} {Sefaria._("Saves")} {this.state.published ? null : (· {Sefaria._("Not Published")})} + {Sefaria._("created")} {Sefaria.util.naturalTime(timestampCreated, "en")} {Sefaria._("ago")} · {sheet.views} {Sefaria._("profile.tab.sheet.tag.views")} · { !!this.state.sheetSaves ? this.state.sheetSaves.length + this.state.sheetLikeAdjustment : '--'} {Sefaria._("Saves")} {this.state.published ? null : (· {Sefaria._("profile.tab.sheet.tag.not_published")})}
- {Sefaria._("Created")} {Sefaria.util.naturalTime(timestampCreated, "he")} {Sefaria._("ago")} · - {sheet.views} · {Sefaria._("Views")} - {!!this.state.sheetSaves ? this.state.sheetSaves.length + this.state.sheetLikeAdjustment : '--' } {Sefaria._("Saves")} {this.state.published ? null : (· {Sefaria._("Not Published")})}
+ {Sefaria._("created")} {Sefaria.util.naturalTime(timestampCreated, "he")} {Sefaria._("ago")} · + {sheet.views} · {Sefaria._("profile.tab.sheet.tag.views")} + {!!this.state.sheetSaves ? this.state.sheetSaves.length + this.state.sheetLikeAdjustment : '--' } {Sefaria._("Saves")} {this.state.published ? null : (· {Sefaria._("profile.tab.sheet.tag.not_published")})}
@@ -391,7 +391,7 @@ class SheetMetadata extends Component { {Sefaria._uid === sheet.owner && !Sefaria._uses_new_editor ? edit sheet - {Sefaria._("Edit")} + {Sefaria._("collection.edit")} : null } @@ -401,23 +401,23 @@ class SheetMetadata extends Component { copy sheet - {Sefaria._("Add to Collection")} + {Sefaria._("collection.add_to_collection")} {Sefaria._uid !== sheet.owner && !Sefaria._uses_new_editor ? - { Sefaria._("View in Editor")} + { Sefaria._("view_in_editor")} : null }
{this.state.sheetCopyStatus === "Copied" ? : null } {Sefaria._uses_new_editor ? - { Sefaria._("View in the old sheets experience")} + { Sefaria._("sheet.view_old_sheet_experience")} : null } {this.state.showCollectionsModal ? @@ -427,13 +427,13 @@ class SheetMetadata extends Component {
-

{ Sefaria._("About this Sheet")}

+

{ Sefaria._("sheet.about_this_sheet")}

{details && !canEdit ?
: null}
{sheet.topics && sheet.topics.length > 0 && !canEdit ?
-

{ Sefaria._("Tags")}

+

{ Sefaria._("sheet.tags")}

{sheet.topics.map((topic, i) => (

- {this.state.published ? Sefaria._("Publish Settings"): Sefaria._("Publish Sheet")} + {this.state.published ? Sefaria._("publish_setting"): Sefaria._("Publish Sheet")}

{this.state.published ? -

{ Sefaria._("Your sheet is")} { Sefaria._("published")} { Sefaria._("on Sefaria and visible to others through search and topics.")}

: +

{ Sefaria._("sheet.your_sheet_is")} { Sefaria._("published")} { Sefaria._("topic.visible_to_other")}

:

{ Sefaria._("List your sheet on Sefaria for others to discover.")}

} @@ -468,9 +468,9 @@ class SheetMetadata extends Component { className={this.state.validationFailed === "both" || this.state.validationFailed === "summary" ? "error" : ""} rows="3" maxLength="281" - placeholder={Sefaria._("Write a short description of your sheet...")} + placeholder={Sefaria._("write_short_description")} value={this.state.summary} onChange={this.handleSummaryChange}> -

{Sefaria._("Topics")}

+

{Sefaria._("header.topic")}

diff --git a/static/js/SourceEditor.jsx b/static/js/SourceEditor.jsx index deba24dc8b..dd5ce3b90f 100644 --- a/static/js/SourceEditor.jsx +++ b/static/js/SourceEditor.jsx @@ -23,7 +23,7 @@ const SourceEditor = ({topic, close, origData={}}) => { const validate = async function () { if (!changed) { - alert("Please change one of the fields before saving."); + alert(`${Sefaria._("message.change_field_before_saving")}`); return false; } if (displayRef.length === 0) { @@ -95,7 +95,7 @@ const SourceEditor = ({topic, close, origData={}}) => { validate={validate} items={["Title", "Prompt"]} deleteObj={deleteTopicSource} updateData={updateData} isNew={isNew} extras={ [
- + {}} getSuggestions={getSuggestions} diff --git a/static/js/StaticPages.jsx b/static/js/StaticPages.jsx index 096ff8c897..6c50652c4e 100644 --- a/static/js/StaticPages.jsx +++ b/static/js/StaticPages.jsx @@ -9,6 +9,7 @@ import {NewsletterSignUpForm} from "./NewsletterSignUpForm"; import palette from './sefaria/palette'; import classNames from 'classnames'; import Cookies from 'js-cookie'; +import Sefaria from './sefaria/sefaria'; @@ -366,7 +367,7 @@ const SheetsLandingPage = () => ( enImg="/static/img/sheets-landing-page/sheetspage_headerimage.png" enImgAlt="Sefaria Sheets" enActionURL="/sheets/new?utm_source=Sefaria&utm_medium=LandingPage&utm_campaign=Sheets" - enActionText="Make a Sheet" + enActionText={Sefaria._("side_nav.make_sheet")} heTitle="דפי מקורות" heText="בחרו לכם מקורות מארון הספרים היהודי של ספריא והוסיפו הערות, תמונות או סרטונים משלכם." heImg="/static/img/sheets-landing-page/sheetspage_headerimage_HEB.png" @@ -859,7 +860,7 @@ const EducatorsPage = () => ( } else { response.json().then(resp_json => { if (resp_json.hasOwnProperty("status") && resp_json["status"] == "ok") { - setMessage("Subscribed! Welcome to our list."); + setMessage("message.subscribed"); setMessageStyle(""); } else if (resp_json.hasOwnProperty("error")) { setMessage(resp_json["error"]); @@ -2374,7 +2375,7 @@ const HeaderForEducatorsPage = () => { {Sefaria._("In Progress")}
+
{Sefaria._("text.versions.in_progress")}
) } diff --git a/static/js/TextColumnBanner.jsx b/static/js/TextColumnBanner.jsx index 5faf7d4f8a..2842e1907e 100644 --- a/static/js/TextColumnBanner.jsx +++ b/static/js/TextColumnBanner.jsx @@ -92,7 +92,7 @@ const TransLangPrefAskBanner = ({ setAccepted, setTranslationLanguagePreference */ const OpenTransBanner = ({ openTranslations }) => { const buttons = [{ - text: "Go to translations", + text: Sefaria._("go_to_translation"), onClick: () => { openTranslations(); }, sideEffect: "close", }]; diff --git a/static/js/TextsPage.jsx b/static/js/TextsPage.jsx index ad75a4bef2..548df698b6 100644 --- a/static/js/TextsPage.jsx +++ b/static/js/TextsPage.jsx @@ -72,7 +72,7 @@ const TextsPage = ({ categories, settings, setCategories, onCompareBack, openSea const title = compare ? null :
-

Browse the Library

+

home.browse_text

{ multiPanel && Sefaria.interfaceLang !== "hebrew" && Sefaria._siteSettings.TORAH_SPECIFIC ? : null } @@ -89,11 +89,11 @@ const TextsPage = ({ categories, settings, setCategories, onCompareBack, openSea const sidebarModules = [ multiPanel ? { type: "AboutSefaria" } : { type: null }, - // {type: "Promo"}, - // {type: "Translations"}, + {type: "Promo"}, + {type: "Translations"}, // {type: "LearningSchedules"}, - // {type: "JoinTheCommunity"}, - // {type: "Resources"}, + {type: "JoinTheCommunity"}, + {type: "Resources"}, ]; const footer = compare ? null :