Merge pull request #8609 from overleaf/ta-preview-error-message-copy

Update Preview Errors Copy

GitOrigin-RevId: 0e7f7a4237a80c3fa2efc8ae87fc2011f4bc879d
This commit is contained in:
Timothée Alby 2022-07-07 09:59:57 +02:00 committed by Copybot
parent 1ffd5a70ef
commit c92278a8e5
3 changed files with 20 additions and 42 deletions

View file

@ -485,8 +485,7 @@
"try_again": "",
"try_it_for_free": "",
"try_premium_for_free": "",
"try_recompile_project": "",
"try_refresh_page": "",
"try_recompile_project_or_troubleshoot": "",
"try_to_compile_despite_errors": "",
"turn_off_link_sharing": "",
"turn_on_link_sharing": "",

View file

@ -1,35 +1,10 @@
import PropTypes from 'prop-types'
import { Alert } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
import { useState } from 'react'
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
const [contactUsModalModules] = importOverleafModules('contactUsModal')
const ContactUsModal = contactUsModalModules?.import.default
function ErrorBoundaryFallback({ type }) {
const { t } = useTranslation()
const [showContactUsModal, setShowContactUsModal] = useState(false)
function handleContactUsClick() {
setShowContactUsModal(true)
}
function handleContactUsModalHide() {
setShowContactUsModal(false)
}
if (!ContactUsModal) {
return (
<div className="pdf-error-alert">
<Alert bsStyle="danger">
{`${t('generic_something_went_wrong')}. ${t('please_refresh')}`}
</Alert>
</div>
)
}
// we create each instance of `<Trans/>` individually so `i18next-scanner` can detect hardcoded `i18nKey` values
let content
if (type === 'pdf') {
@ -38,8 +13,11 @@ function ErrorBoundaryFallback({ type }) {
<p>{t('pdf_viewer_error')}</p>
<p>
<Trans
i18nKey="try_recompile_project"
components={[<a href="#" onClick={handleContactUsClick} />]} // eslint-disable-line react/jsx-key, jsx-a11y/anchor-has-content, jsx-a11y/anchor-is-valid
i18nKey="try_recompile_project_or_troubleshoot"
components={[
// eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
<a href="/learn/how-to/Resolving_access%2C_loading%2C_and_display_problems" />,
]}
/>
</p>
</>
@ -50,8 +28,11 @@ function ErrorBoundaryFallback({ type }) {
<p>{t('log_viewer_error')}</p>
<p>
<Trans
i18nKey="try_recompile_project"
components={[<a href="#" onClick={handleContactUsClick} />]} // eslint-disable-line react/jsx-key, jsx-a11y/anchor-has-content, jsx-a11y/anchor-is-valid
i18nKey="try_recompile_project_or_troubleshoot"
components={[
// eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
<a href="/learn/how-to/Resolving_access%2C_loading%2C_and_display_problems" />,
]}
/>
</p>
</>
@ -62,8 +43,11 @@ function ErrorBoundaryFallback({ type }) {
<p>{t('pdf_preview_error')}</p>
<p>
<Trans
i18nKey="try_refresh_page"
components={[<a href="#" onClick={handleContactUsClick} />]} // eslint-disable-line react/jsx-key, jsx-a11y/anchor-has-content, jsx-a11y/anchor-is-valid
i18nKey="try_recompile_project_or_troubleshoot"
components={[
// eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
<a href="/learn/how-to/Resolving_access%2C_loading%2C_and_display_problems" />,
]}
/>
</p>
</>
@ -73,10 +57,6 @@ function ErrorBoundaryFallback({ type }) {
return (
<div className="pdf-error-alert">
<Alert bsStyle="danger">{content}</Alert>
<ContactUsModal
show={showContactUsModal}
handleHide={handleContactUsModalHide}
/>
</div>
)
}

View file

@ -777,11 +777,10 @@
"open_a_file_on_the_left": "Open a file on the left",
"reference_error_relink_hint": "If this error persists, try re-linking your account here:",
"pdf_rendering_error": "PDF Rendering Error",
"pdf_preview_error": "There was a problem displaying the compilation results for this project. This is an internal __appName__ issue, not a problem with your LaTeX code.",
"pdf_viewer_error": "There was a problem displaying this project PDF. This is an internal __appName__ issue, not a problem with your LaTeX code.",
"log_viewer_error": "There was a problem displaying this project compilation errors and logs. This is an internal __appName__ issue, not a problem with your LaTeX code.",
"try_recompile_project": "Please try recompiling the project. If the problem persists, <0>contact us</0>",
"try_refresh_page": "Please try refreshing this page. If the problem persists, <0>contact us</0>.",
"pdf_preview_error": "There was a problem displaying the compilation results for this project.",
"pdf_viewer_error": "There was a problem displaying the PDF for this project.",
"log_viewer_error": "There was a problem displaying this projects compilation errors and logs.",
"try_recompile_project_or_troubleshoot": "Please try recompiling the project from scratch, and if that doesnt help, follow our <0>troubleshooting guide</0>.",
"something_went_wrong_rendering_pdf": "Something went wrong while rendering this PDF.",
"mendeley_reference_loading_error_expired": "Mendeley token expired, please re-link your account",
"zotero_reference_loading_error_expired": "Zotero token expired, please re-link your account",