diff --git a/.eslintrc.js b/.eslintrc.js
index 41fbbb1cf..3d9359553 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -9,18 +9,20 @@ module.exports = {
},
root: true,
parser: '@typescript-eslint/parser',
- plugins: ['@typescript-eslint'],
+ plugins: ['@typescript-eslint', 'i18next'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'next/core-web-vitals',
+ 'plugin:i18next/recommended',
],
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
- '@typescript-eslint/no-explicit-any': 'warn',
+ '@typescript-eslint/no-explicit-any': 'off',
+ 'import/no-anonymous-default-export': 'off',
},
},
{
diff --git a/components/PoweredBy.tsx b/components/PoweredBy.tsx
index 5f683e7ec..a933b71cf 100644
--- a/components/PoweredBy.tsx
+++ b/components/PoweredBy.tsx
@@ -1,8 +1,12 @@
+import { useTranslation } from 'next-i18next';
+
export const PoweredBy = () => {
+ const { t } = useTranslation('common');
+
return (
@@ -182,7 +182,7 @@ export const Sidebar = ({ isOpen, setIsOpen }: SidebarProps) => {
- BoxyHQ Admin Portal
+ {t('boxyhq_admin_portal')}
diff --git a/components/connection/WellKnownURLs.tsx b/components/connection/WellKnownURLs.tsx
index 03e016523..3f64c21de 100644
--- a/components/connection/WellKnownURLs.tsx
+++ b/components/connection/WellKnownURLs.tsx
@@ -13,49 +13,49 @@ const WellKnownURLs = () => {
const links = [
{
- title: 'SP Metadata',
+ title: t('sp_metadata'),
description: t('sp_metadata_description'),
href: '/.well-known/sp-metadata',
buttonText: viewText,
type: 'idp-config',
},
{
- title: 'SAML Configuration',
+ title: t('saml_configuration'),
description: t('sp_config_description'),
href: '/.well-known/saml-configuration',
buttonText: viewText,
type: 'idp-config',
},
{
- title: 'SAML Public Certificate',
+ title: t('saml_public_cert'),
description: t('saml_public_cert_description'),
href: '/.well-known/saml.cer',
buttonText: downloadText,
type: 'idp-config',
},
{
- title: 'OpenID Configuration',
+ title: t('oidc_configuration'),
description: t('oidc_config_description'),
href: '/.well-known/oidc-configuration',
buttonText: viewText,
type: 'idp-config',
},
{
- title: 'OpenID Connect Discovery',
+ title: t('oidc_discovery'),
description: t('oidc_discovery_description'),
href: '/.well-known/openid-configuration',
buttonText: viewText,
type: 'auth',
},
{
- title: 'IdP Metadata',
+ title: t('idp_metadata'),
description: t('idp_metadata_description'),
href: '/.well-known/idp-metadata',
buttonText: viewText,
type: 'saml-fed',
},
{
- title: 'IdP Configuration',
+ title: t('idp_configuration'),
description: t('idp_config_description'),
href: '/.well-known/idp-configuration',
buttonText: viewText,
@@ -74,23 +74,23 @@ const WellKnownURLs = () => {
setView('idp-config')}
- title='Identity Provider Configuration'
- description='Links for SAML/OIDC IdP setup'
- label='Identity Provider Configuration links'
+ title={t('idp_configuration_title')}
+ description={t('idp_configuration_description')}
+ label={t('idp_configuration_label')}
/>
setView('auth')}
- title='Auth integration'
- description='Links for OAuth 2.0/OpenID Connect auth'
- label='Auth integration links'
+ title={t('auth_integration_title')}
+ description={t('auth_integration_description')}
+ label={t('auth_integration_label')}
/>
setView('saml-fed')}
- title='SAML Federation'
- description='Links for SAML Federation app setup'
- label='SAML Federation links'
+ title={t('saml_fed_configuration_title')}
+ description={t('saml_fed_configuration_description')}
+ label={t('saml_fed_configuration_label')}
/>
diff --git a/components/dsync/DirectoryTab.tsx b/components/dsync/DirectoryTab.tsx
index 633ce222f..d337b9a20 100644
--- a/components/dsync/DirectoryTab.tsx
+++ b/components/dsync/DirectoryTab.tsx
@@ -1,6 +1,7 @@
import Link from 'next/link';
import type { Directory } from '@boxyhq/saml-jackson';
import classNames from 'classnames';
+import { useTranslation } from 'next-i18next';
const DirectoryTab = ({
directory,
@@ -11,32 +12,34 @@ const DirectoryTab = ({
activeTab: string;
setupLinkToken?: string;
}) => {
+ const { t } = useTranslation('common');
+
const menus = setupLinkToken
? [
{
- name: 'Directory',
+ name: t('directory'),
href: `/setup/${setupLinkToken}/directory-sync/${directory.id}`,
active: activeTab === 'directory',
},
]
: [
{
- name: 'Directory',
+ name: t('directory'),
href: `/admin/directory-sync/${directory.id}`,
active: activeTab === 'directory',
},
{
- name: 'Users',
+ name: t('users'),
href: `/admin/directory-sync/${directory.id}/users`,
active: activeTab === 'users',
},
{
- name: 'Groups',
+ name: t('groups'),
href: `/admin/directory-sync/${directory.id}/groups`,
active: activeTab === 'groups',
},
{
- name: 'Webhook Events',
+ name: t('webhook_events'),
href: `/admin/directory-sync/${directory.id}/events`,
active: activeTab === 'events',
},
diff --git a/components/layouts/AccountLayout.tsx b/components/layouts/AccountLayout.tsx
index f803d6067..d3802dfb0 100644
--- a/components/layouts/AccountLayout.tsx
+++ b/components/layouts/AccountLayout.tsx
@@ -20,7 +20,7 @@ export const AccountLayout = ({ children }: { children: React.ReactNode }) => {
return (
<>
-
Admin Portal | BoxyHQ
+
{t('boxyhq_admin_portal')}
diff --git a/components/retraced/AddProject.tsx b/components/retraced/AddProject.tsx
index 24312baad..63198fe00 100644
--- a/components/retraced/AddProject.tsx
+++ b/components/retraced/AddProject.tsx
@@ -3,9 +3,11 @@ import classNames from 'classnames';
import { useRouter } from 'next/router';
import { successToast, errorToast } from '@components/Toaster';
import { LinkBack } from '@components/LinkBack';
+import { useTranslation } from 'next-i18next';
const AddProject = () => {
const router = useRouter();
+ const { t } = useTranslation('common');
const [loading, setLoading] = useState(false);
const [project, setProject] = useState({
@@ -49,7 +51,7 @@ const AddProject = () => {
}
if (data && data.project) {
- successToast('Project created successfully.');
+ successToast(t('retraced_project_created'));
router.replace(`/admin/retraced/projects/${data.project.id}`);
}
};
@@ -58,13 +60,15 @@ const AddProject = () => {
<>
-
Create Project
+
+ {t('create_project')}
+
-
- You can customize the look and feel Identity Provider selection page by setting following
- options:
-
+
{t('customize_branding')}:
@@ -170,17 +172,21 @@ const Login = ({
{/* No login methods enabled */}
{!isEmailPasswordEnabled && !isMagicLinkEnabled && (
-
- Please visit
-
- BoxyHQ documentation
-
- to learn how to enable the Magic Link or Email/Password authentication methods.
-
+
+ {t('documentation')}
+
+ ),
+ }}
+ />
)}
diff --git a/pages/admin/retraced/projects/[id]/events.tsx b/pages/admin/retraced/projects/[id]/events.tsx
index a08f337c9..824938473 100644
--- a/pages/admin/retraced/projects/[id]/events.tsx
+++ b/pages/admin/retraced/projects/[id]/events.tsx
@@ -9,6 +9,7 @@ import ErrorMessage from '@components/Error';
import { LinkBack } from '@components/LinkBack';
import { Select } from 'react-daisyui';
import { retracedOptions } from '@lib/env';
+import { useTranslation } from 'next-i18next';
const LogsViewer = dynamic(() => import('@components/retraced/LogsViewer'), {
ssr: false,
@@ -20,6 +21,7 @@ export interface Props {
const Events: NextPage
= ({ host }: Props) => {
const router = useRouter();
+ const { t } = useTranslation('common');
const [environment, setEnvironment] = useState('');
const [group, setGroup] = useState('');
@@ -62,7 +64,7 @@ const Events: NextPage = ({ host }: Props) => {
{project ? (
{groups ? (