Skip to content

Commit

Permalink
internationalization: updated for git deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
ajas-ma committed Sep 7, 2024
1 parent 902f5c2 commit 94d6f5d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
20 changes: 20 additions & 0 deletions web/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,26 @@
"git_email":"Git Email",
"git_password":"Git Password",
"git_branch":"Git Branch",
"name_is_required":"Title is required",
"customCSS_is_required":"Custom CSS is required",
"copyrightText_is_required":"Copyright text is required",
"organizationName_is_required":"Organization name is required",
"projectName_is_required":"Project name is required",
"navImageDark_favicon_url_required":"Nav Image Dark Favicon URL required",
"navImage_favicon_url_required":"Valid Nav Image URL required",
"metaImage_favicon_url_required":"Valid Meta Image URL required",
"gitUser_is_required":"Git User is required",
"gitRepo_is_required":"Git Repo is required",
"gitEmail_is_required":"Git Email is required",
"gitPassword_is_required":"Git Password is required",
"gitBranch_is_required":"Git Branch is required",
"valid_gitRepo_url_required":"Valid git Repo url required",
"valid_gitEmail_format_required":"Valid git Email format required",
"git_user_palceholder":"Enter your git username",
"git_repo_placeholder":"https://github.com/yourusername/your-repo",
"git_email_placeholder":"[email protected]",
"git_password_placeholder":"Enter your git password",
"git_branch_palceholder":"Enter your branch name",

"clone_documentation": "Clone Documentation",
"delete_documentation": "Delete Documentation",
Expand Down
12 changes: 5 additions & 7 deletions web/src/components/CreateDocumentModal/CreateDocModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,6 @@ export default function CreateDocModal() {
};

const handleCreateDocument = async () => {
console.log(formData);

const validate = validateFormData(formData, gitDeployOn);
if (validate.status) {
toastMessage(t(validate.message), "error");
Expand Down Expand Up @@ -1150,7 +1148,7 @@ export default function CreateDocModal() {
<div className="grid gap-4 grid-cols-2 mb-5">
<FormField
label={t("git_user")}
placeholder={t("organization_name_placeholder")}
placeholder={t("git_user_palceholder")}
value={formData?.gitUser}
onChange={handleChange}
name="gitUser"
Expand All @@ -1159,7 +1157,7 @@ export default function CreateDocModal() {

<FormField
label={t("git_repo")}
placeholder={t("organization_name_placeholder")}
placeholder={t("git_repo_placeholder")}
value={formData?.gitRepo}
onChange={handleChange}
name="gitRepo"
Expand All @@ -1170,15 +1168,15 @@ export default function CreateDocModal() {
<div className="grid gap-4 sm:grid-cols-3 mb-5">
<FormField
label={t("git_email")}
placeholder={t("organization_name_placeholder")}
placeholder={t("git_email_placeholder")}
value={formData?.gitEmail}
onChange={handleChange}
name="gitEmail"
required={true}
/>
<FormField
label={t("git_password")}
placeholder={t("organization_name_placeholder")}
placeholder={t("git_password_placeholder")}
value={formData?.gitPassword}
onChange={handleChange}
name="gitPassword"
Expand All @@ -1187,7 +1185,7 @@ export default function CreateDocModal() {
/>
<FormField
label={t("git_branch")}
placeholder={t("organization_name_placeholder")}
placeholder={t("git_branch_palceholder")}
value={formData?.gitBranch}
onChange={handleChange}
name="gitBranch"
Expand Down
2 changes: 1 addition & 1 deletion web/src/utils/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export const validateFormData = (
if (!formData[field]) {
return {
status: true,
message: `${field}_is_required_when_git_deploy_is_enabled`,
message: `${field}_is_required`,
};
}
}
Expand Down

0 comments on commit 94d6f5d

Please sign in to comment.