Skip to content

Commit

Permalink
support internationalization on the client side
Browse files Browse the repository at this point in the history
  • Loading branch information
sumn2u committed Jun 7, 2024
1 parent d96d266 commit 86be8ce
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
29 changes: 18 additions & 11 deletions client/src/ImageUpload/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,24 @@ const ImageUpload = ({ onImageUpload }) => {
{isDragActive ? (
<Typography sx={{fontSize: "14px", color: "rgb(117, 117, 117)" }}>{t("configuration.image_upload.file_drop")}</Typography>
) : (
loading ?
progress > 0 && progress < 100 ? (
<div>
<progress value={progress} max={100} />
<p>{progress}%</p>
</div>
) : (
<div className="loading">Loading...</div>
)
:
<Typography sx={{fontSize: "14px", color: "rgb(117, 117, 117)" }}>{t("configuration.image_upload.description")}</Typography>
<>
{loading ? (
<>
{progress > 0 && progress < 100 ? (
<>
<progress value={progress} max={100} />
<p>{progress}%</p>
</>
) : (
<div className="loading">{t("loading")}</div>
)}
</>
) : (
<Typography sx={{fontSize: "14px", color: "rgb(117, 117, 117)" }}>
{t("configuration.image_upload.description")}
</Typography>
)}
</>
)}
</Box>
<Box display="flex" flexWrap="wrap" gap="1rem">
Expand Down
3 changes: 2 additions & 1 deletion client/src/Localization/translation-en-EN.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ const translationEnEN = {
"helptext_circle": "Add Circle",
"comment_placeholder": "Write comment here...",
"image_tags": "Image Tags",
"image_tags_classification_placeholder": "Image Classification"
"image_tags_classification_placeholder": "Image Classification",
"loading": "Loading...",
};

export default translationEnEN;

0 comments on commit 86be8ce

Please sign in to comment.