Skip to content

Commit e97af13

Browse files
committed
feat: Add wording translation
1 parent 5f73975 commit e97af13

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

public/locales/en/files.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,14 @@
153153
"pleaseWait": "Please wait while the initial 20 copies of the updated IPNS record are stored with the help of DHT peers…"
154154
},
155155
"noPinsInProgress": "All done, no remote pins in progress.",
156-
"remotePinningInProgress": "Remote pinning in progress:"
156+
"remotePinningInProgress": "Remote pinning in progress:",
157+
"previewNotFound": {
158+
"title": "IPFS can't find this item",
159+
"helpTitle": "These are common troubleshooting steps might help:",
160+
"helpListItemPathTypo": "Are there typos in the path you entered?",
161+
"helpListItemFileMoved": "Was the file moved, renamed, or deleted?",
162+
"helpListItemBookmarkMigrated": "Did you copy a URL or bookmark from another computer? If so, you'll need to",
163+
"helpListItemBookmarkMigratedLink": "point this instance at that computer's node",
164+
"backButton": "Go to Home"
165+
}
157166
}

src/files/FilesPage.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import withTour from '../components/tour/withTour.js'
1212
import InfoBoxes from './info-boxes/InfoBoxes.js'
1313
import FilePreview from './file-preview/FilePreview.js'
1414
import FilesList from './files-list/FilesList.js'
15+
import FileNotFound from './file-not-found/FileNotFound.js'
1516
import { getJoyrideLocales } from '../helpers/i8n.js'
1617

1718
// Icons
1819
import Modals, { DELETE, NEW_FOLDER, ADD_BY_CAR, SHARE, RENAME, ADD_BY_PATH, BULK_CID_IMPORT, CLI_TUTOR_MODE, PINNING, PUBLISH } from './modals/Modals.js'
1920
import Header from './header/Header.js'
2021
import FileImportStatus from './file-import-status/FileImportStatus.js'
2122
import { useExplore } from 'ipld-explorer-components/providers'
22-
import { FileNotFound } from './file-not-found/FileNotFound.js'
2323

2424
const FilesPage = ({
2525
doFetchPinningServices, doFilesFetch, doPinsFetch, doFilesSizeGet, doFilesDownloadLink, doFilesDownloadCarLink, doFilesWrite, doAddCarFile, doFilesBulkCidImport, doFilesAddPath, doUpdateHash,
@@ -229,7 +229,7 @@ const FilesPage = ({
229229

230230
<MainView t={t} files={files} remotePins={remotePins} pendingPins={pendingPins} failedPins={failedPins} doExploreUserProvidedPath={doExploreUserProvidedPath}/>
231231

232-
<Preview files={files} path={filesPathInfo.path} onDownload={() => onDownload([files])} />
232+
<Preview files={files} path={filesPathInfo.path} t={t} onDownload={() => onDownload([files])} />
233233

234234
<InfoBoxes isRoot={filesPathInfo.isMfs && filesPathInfo.isRoot}
235235
isCompanion={false}
@@ -265,13 +265,13 @@ const FilesPage = ({
265265
)
266266
}
267267

268-
const Preview = ({ files, path, onDownload }) => {
268+
const Preview = ({ files, path, t, onDownload }) => {
269269
if (files && files.type === 'file') {
270270
return (<FilePreview {...files} onDownload={onDownload} />)
271271
}
272272

273273
return (
274-
<FileNotFound path={path} />
274+
<FileNotFound path={path} t={t} />
275275
)
276276
}
277277

src/files/file-not-found/FileNotFound.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,30 @@ import React from 'react'
33
import Button from '../../components/button/button'
44

55
import GlyphAttention from '../../icons/GlyphAttention.js'
6+
import { withTranslation } from 'react-i18next'
67

7-
const FileNotFound = ({ path }) => {
8+
const FileNotFound = ({ path, t }) => {
89
return (
910
<div
1011
className='mb3 pa4-l pa2 mw9 center'
1112
style={{ background: 'rgba(251, 251, 251)' }}
1213
>
1314
<div className='flex flex-row items-center mb3'>
1415
<GlyphAttention style={{ height: 76 }} className='fill-red mr' role='presentation' />
15-
<div className='red fw6 truncate'>IPFS can't find this item</div>
16+
<div className='red fw6 truncate'>{t('previewNotFound.title')}</div>
1617
</div>
1718
<div className='mb3 charcoal fw6 truncate'>{path}</div>
18-
<div className='mb3'>These are common troubleshooting steps might help:</div>
19+
<div className='mb3'>{t('previewNotFound.helpTitle')}</div>
1920
<ul>
20-
<li>Are there typos in the path you entered?</li>
21-
<li>Was the file moved, renamed, or deleted?</li>
22-
<li>Did you copy a URL or bookmark from another computer? If so, you'll need to <a href="#/peers">point this instance at that computer's node</a>.</li>
21+
<li>{t('previewNotFound.helpListItemPathTypo')}</li>
22+
<li>{t('previewNotFound.helpListItemFileMoved')}</li>
23+
<li>{t('previewNotFound.helpListItemBookmarkMigrated')} <a href="#/peers">{t('previewNotFound.helpListItemBookmarkMigratedLink')}</a>.</li>
2324
</ul>
2425
<a href="#/files">
25-
<Button className='ma2 tc' bg='bg-teal'>Go to Home</Button>
26+
<Button className='ma2 tc' bg='bg-teal'>{t('previewNotFound.backButton')}</Button>
2627
</a>
2728
</div>
2829
)
2930
}
3031

31-
export { FileNotFound }
32+
export default withTranslation('files')(FileNotFound)

0 commit comments

Comments
 (0)