Skip to content

Commit

Permalink
chore: tweak i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyjoygh committed Aug 18, 2024
1 parent a3943f5 commit c571720
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
16 changes: 8 additions & 8 deletions frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@
"nickname": "Nickname",
"email": "Email",
"role": "Role",
"profile": "Profile",
"action": {
"add-user": "Add user"
}
"profile": "Profile"
},
"settings": {
"self": "Setting",
Expand All @@ -76,11 +73,14 @@
"workspace": {
"self": "Workspace settings",
"custom-style": "Custom style",
"enable-user-signup": {
"self": "Enable user signup",
"description": "Once enabled, other users can signup."
"disallow-user-registration": {
"self": "Disallow user registration"
},
"default-visibility": "Default visibility"
"default-visibility": "Default visibility",
"member": {
"self": "Member",
"add": "Add member"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const WorkspaceMembersSection = () => {
return (
<>
<div className="w-full flex flex-col sm:flex-row justify-start items-start gap-4 sm:gap-x-16">
<p className="sm:w-1/4 text-2xl shrink-0 font-semibold text-gray-900 dark:text-gray-500">Members</p>
<p className="sm:w-1/4 text-2xl shrink-0 font-semibold text-gray-900 dark:text-gray-500">{t("settings.workspace.member.self")}</p>
<div className="w-full sm:w-auto grow flex flex-col justify-start items-start gap-4">
<div className="w-full flex justify-end">
<Button
Expand All @@ -55,7 +55,7 @@ const WorkspaceMembersSection = () => {
setCurrentEditingUser(undefined);
}}
>
{t("user.action.add-user")}
{t("settings.workspace.member.add")}
</Button>
</div>
<div className="w-full flow-root">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Switch } from "@mui/joy";
import toast from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { workspaceServiceClient } from "@/grpcweb";
import { useWorkspaceStore } from "@/stores";
import { WorkspaceSetting } from "@/types/proto/api/v1/workspace_service";
import SSOSection from "./SSOSection";

const WorkspaceSecuritySection = () => {
const { t } = useTranslation();
const workspaceStore = useWorkspaceStore();

const toggleDisallowUserRegistration = async (on: boolean) => {
Expand All @@ -30,10 +32,6 @@ const WorkspaceSecuritySection = () => {
return;
}

console.log("1", {
setting: workspaceSetting,
updateMask: updateMask,
});
try {
await workspaceServiceClient.updateWorkspaceSetting({
setting: workspaceSetting,
Expand All @@ -56,7 +54,7 @@ const WorkspaceSecuritySection = () => {
size="lg"
checked={workspaceStore.setting.disallowUserRegistration}
onChange={(event) => toggleDisallowUserRegistration(event.target.checked)}
endDecorator={<span>Disallow user registration</span>}
endDecorator={<span>{t("settings.workspace.disallow-user-registration.self")}</span>}
/>
</div>
</div>
Expand Down

0 comments on commit c571720

Please sign in to comment.