Skip to content

Commit

Permalink
Extended i18n over string literals
Browse files Browse the repository at this point in the history
  • Loading branch information
om-chauhan1 committed Apr 5, 2024
1 parent 01b1052 commit 1743ad2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
26 changes: 13 additions & 13 deletions app/assets/javascripts/components/uploads/upload_viewer.jsx
Expand Up @@ -28,7 +28,7 @@ const UploadViewer = ({ closeUploadViewer, upload, imageFile }) => {
}
}, [uploadMetadata, upload.id, loadingViews]);

const handleGetFileViews = files => {
const handleGetFileViews = (files) => {
dispatch(setUploadPageViews(files));
setLoadingViews(false);
};
Expand Down Expand Up @@ -72,13 +72,13 @@ const UploadViewer = ({ closeUploadViewer, upload, imageFile }) => {
fileUsageTable = (
<div>
<h1>{'\n'}</h1>
<h4>File usage on other wikis</h4>
<h4>{I18n.t('uploads.file_usage')}</h4>
<table border="1">
<thead>
<tr>
<th>Wiki</th>
<th>Article Name</th>
<th>Views per day</th>
<th>{I18n.t('uploads.wiki_big')}</th>
<th>{I18n.t('uploads.article_name')}</th>
<th>{I18n.t('uploads.views_per_day')}</th>
</tr>
</thead>
<tbody>
Expand All @@ -99,7 +99,7 @@ const UploadViewer = ({ closeUploadViewer, upload, imageFile }) => {
categories = (
<div>
<h1>{'\n'}</h1>
<h4>Categories</h4>
<h4>{I18n.t('uploads.categories')}</h4>
{categoriesList}
</div>
);
Expand All @@ -114,27 +114,27 @@ const UploadViewer = ({ closeUploadViewer, upload, imageFile }) => {
<div className="modal-body">
<div className="left">
<a href={upload.url} target="_blank"><img alt={upload.file_name} src={imageFile} /></a>
<p><a href={imageUrl} target="_blank">Original File</a>{` (${width} X ${height} pixels, file size: ${size})`}</p>
<h4>Description</h4>
<p><a href={imageUrl} target="_blank">{I18n.t('uploads.original_file')}</a>{` (${width} X ${height} pixels, file size: ${size})`}</p>
<h4>{I18n.t('uploads.description')}</h4>
<p dangerouslySetInnerHTML={{ __html: imageDescription }} />
</div>
<div className="right">
<table className="view-file-details">
<tbody>
<tr>
<td className="row-details bg-grey">Date:&nbsp;</td>
<td className="row-details bg-grey">{I18n.t('uploads.date')}&nbsp;</td>
<td className="row-details">{formatDateWithoutTime(upload.uploaded_at)}</td>
</tr>
<tr>
<td className="row-details bg-grey">Author:&nbsp;</td>
<td className="row-details bg-grey">{I18n.t('uploads.author')}&nbsp;</td>
<td className="row-details">{author}</td>
</tr>
<tr>
<td className="row-details bg-grey">Source:&nbsp;</td>
<td className="row-details bg-grey">{I18n.t('uploads.source')}&nbsp;</td>
<td className="row-details" dangerouslySetInnerHTML={{ __html: source }} />
</tr>
<tr>
<td className="row-details bg-grey">License:&nbsp;</td>
<td className="row-details bg-grey">{I18n.t('uploads.license')}&nbsp;</td>
<td className="row-details">{license}</td>
<td>{'\n'}</td>
</tr>
Expand All @@ -145,7 +145,7 @@ const UploadViewer = ({ closeUploadViewer, upload, imageFile }) => {
</div>
</div>
<div className="modal-footer">
<a className="button dark small pull-right upload-viewer-button" href={upload.url} target="_blank">View on Commons</a>
<a className="button dark small pull-right upload-viewer-button" href={upload.url} target="_blank">{I18n.t('uploads.view_commons')}</a>
</div>
</div>
);
Expand Down
12 changes: 12 additions & 0 deletions config/locales/en.yml
Expand Up @@ -1392,13 +1392,21 @@ en:
button: Update

uploads:
article_name: Article Name
author: "Author:"
categories: Categories
credit: Credit
date: "Date:"
description: Description
file_name: File Name
file_usage: File usage on other wikis
header: Files Uploaded to Wikimedia Commons
image: Image
label: Uploads
license: "License:"
loading: Loading uploads...
none: This class has not contributed any images or other media files to Wikimedia Commons.
original_file: Original File
select_label: Filter by uploader
time_doc: The time of each upload in your local time
uploaded_at: Upload Time
Expand All @@ -1411,7 +1419,11 @@ en:
usages: Usages
gallery_view: Gallery View
list_view: List View
source: "Source:"
tile_view: Tile View
views_per_day: Views per day
view_commons: View on Commons
wiki_big: Wiki

users:
already_enrolled: That user is already enrolled!
Expand Down

0 comments on commit 1743ad2

Please sign in to comment.