From f97870b83ba9eeaa26dbf68f5072010928b6c88f Mon Sep 17 00:00:00 2001 From: Alexandre Monjol Date: Tue, 2 Apr 2024 14:41:40 +0200 Subject: [PATCH] feat(sso) add all translations --- ditto/base.json | 24 +++++++++++++++-------- ditto/config.yml | 4 ++++ ditto/index.js | 3 +++ src/components/auth/GoogleAuthButton.tsx | 15 +++++++++----- src/core/constants/externalUrls.ts | 2 ++ src/core/utils/__tests__/urlUtils.test.ts | 4 ++-- src/pages/Invitation.tsx | 14 ++++++------- src/pages/auth/Login.tsx | 2 +- src/pages/auth/SignUp.tsx | 14 ++++++------- 9 files changed, 50 insertions(+), 32 deletions(-) diff --git a/ditto/base.json b/ditto/base.json index e1ab153f5..516d6c49f 100644 --- a/ditto/base.json +++ b/ditto/base.json @@ -174,7 +174,6 @@ "text_620bc4d4269a55014d493f12": "Welcome to Lago", "text_620bc4d4269a55014d493fc9": "Nice to see you here, let’s start by creating your account.", "text_62a99ba2af7535cefacab49c": "Organization name", - "text_62a99ba2af7535cefacab4ba": "Banco", "text_620bc4d4269a55014d493f53": "Set your password", "text_620bc4d4269a55014d493fb5": "Sign up", "text_620bc4d4269a55014d493fd4": "By signing up, you agree to our Terms of Service and Privacy Policy.\nAlready have an account? Log in", @@ -414,6 +413,7 @@ "text_628b8dc14c71840130f8d8a1": "Apply coupon", "text_63a5ba11eb4e7e17ef88e9f0": "You're running this app in an unsecure context. Clipboard access is disabled", "TZ_AFRICA_ALGIERS": "Africa/Algiers", + "TZ_AFRICA_CAIRO": "Africa/Cairo", "TZ_AFRICA_CASABLANCA": "Africa/Casablanca", "TZ_AFRICA_HARARE": "Africa/Harare", "TZ_AFRICA_JOHANNESBURG": "Africa/Johannesburg", @@ -547,20 +547,19 @@ "TZ_PACIFIC_PORT_MORESBY": "Pacific/Port Moresby", "TZ_PACIFIC_TONGATAPU": "Pacific/Tongatapu", "TZ_UTC": "UTC", - "TZ_AFRICA_CAIRO": "Africa/Cairo", "text_623b42ff8ee4e000ba87d0ae": "Add a billable metric", "text_623b42ff8ee4e000ba87d0b0": "Add a billable metric", "text_623b42ff8ee4e000ba87d0b4": "Base metric used to measure usage, and act as a foundation of pricing.", "text_623b42ff8ee4e000ba87d0b2": "Test this snippet", "text_623b42ff8ee4e000ba87d0c6": "Copy to clipboard", - "text_623b42ff8ee4e000ba87d0b8": "How should we name it? ", + "text_623b42ff8ee4e000ba87d0b8": "Billable metric settings", "text_623b42ff8ee4e000ba87d0be": "Name", "text_6241cc759211e600ea57f4c7": "Type a name", "text_623b42ff8ee4e000ba87d0c0": "Code", "text_623b42ff8ee4e000ba87d0c4": "Type a code", "text_623b42ff8ee4e000ba87d0c8": "Description (optional)", "text_623b42ff8ee4e000ba87d0ca": "Explain the goal of this billable metric …", - "text_623b42ff8ee4e000ba87d0cc": "How should we measure it? ", + "text_623b42ff8ee4e000ba87d0cc": "Billable metric aggregation", "text_623b42ff8ee4e000ba87d0ce": "Aggregation type", "text_623b42ff8ee4e000ba87d0d0": "Search or select an aggregation type", "text_623b42ff8ee4e000ba87d0d4": "Add billable metric", @@ -968,7 +967,7 @@ "text_646e2d0cc536351b62ba6f01": "More option", "text_646e2d0cc536351b62ba6f0c": "Pay in arrears", "text_646e2d0cc536351b62ba6f16": "Invoiceable", - "text_646e2d0cc536351b62ba6f20": "No spending mininum", + "text_646e2d0cc536351b62ba6f20": "No spending minimum", "text_646e2d0cc536351b62ba6f1a": "Pay charge in", "text_646e2d0cc536351b62ba6f2b": "Arrears", "text_646e2d0cc536351b62ba6f3d": "Advance", @@ -1611,6 +1610,15 @@ "text_63246f875e2228ab7b63dd02": "Your password is secure and you're all set!", "text_63246f875e2228ab7b63dcf4": "Organization invitation invalid", "text_63246f875e2228ab7b63dcfe": "It looks like the link you’re using is not valid. Please contact a member of the organization so they can invite you again.", + "text_660bf95c75dd928ced0ecb04": "Create your organization", + "text_660bf95c75dd928ced0ecb08": "This information won’t be editable in the future.", + "text_660bf95c75dd928ced0ecb25": "Sorry, Google Connect is not configured in your environment variables. Please read the documentation.", + "text_660bf95c75dd928ced0ecb31": "Log In with Google", + "text_660bf95c75dd928ced0ecb21": "Continue with Google", + "text_660bf95c75dd928ced0ecb33": "Type your organization name", + "text_660bf95c75dd928ced0ecb2b": "Oops! Looks like your Google account email doesn't match the invitation. Give it another shot!", + "text_660bf95c75dd928ced0ecb37": "Sign up with Google", + "text_660bfaa2cbc95800a63f48b1": "Sorry, it seems there are no accounts associated with the provided credentials.", "text_642707b0da1753a9bb6672b5": "Forget password", "text_642707b0da1753a9bb66728e": "Password reset email sent!", "text_642707b0da1753a9bb667298": "Check your email for a link to reset your password. If it doesn’t appear within a few minutes, check your spam folder.", @@ -1873,7 +1881,7 @@ "text_636d023ce11a9d038819b579": "Something went wrong", "text_636d023ce11a9d038819b57b": "Please refresh the page or contact us if the error persists.", "text_636d023ce11a9d038819b57d": "Refresh the page", - "text_636d12ce54c41fccdf0ef72d": "Download pdf", + "text_636d12ce54c41fccdf0ef72d": "Download credit note", "text_636d12ce54c41fccdf0ef72f": "Void credit available", "text_636d12ce54c41fccdf0ef731": "Copy credit note lago_id", "text_63720bd734e1344aea75b82d": "Credit note lago_id copied to clipboard", @@ -1901,11 +1909,11 @@ "text_6374e868262bab8719eac121": "The amount should be greater than $ 0.00\nUncheck this line item to not credit this fee", "text_63763e61409e0d55b268a590": "Credit note successfully issued", "text_637655cb50f04bf1c8379ce8": "Actions", - "text_637655cb50f04bf1c8379cea": "Download pdf", + "text_637655cb50f04bf1c8379cea": "Download credit note", "text_637655cb50f04bf1c8379cec": "Void credit available", "text_637655cb50f04bf1c8379cee": "Copy credit note lago_id", "text_637655cb50f04bf1c8379cf2": "for {{amount}}", - "text_637655cb50f04bf1c8379cf8": "Download pdf", + "text_637655cb50f04bf1c8379cf8": "Download credit note", "text_637655cb50f04bf1c8379cfa": "Overview", "text_637655cb50f04bf1c8379cfe": "Customer name", "text_637655cb50f04bf1c8379d02": "Invoice number", diff --git a/ditto/config.yml b/ditto/config.yml index 7af8eadef..8c0e75e86 100644 --- a/ditto/config.yml +++ b/ditto/config.yml @@ -340,7 +340,11 @@ sources: fileName: 👍 [Ready for dev] - Plans - Group by fees on invoices - name: 👍 [Ready for dev] - Settings / Customers - Lago x Stripe ACH & BACS id: 65e1f9032a71b571c754c489 + fileName: 👍 [Ready for dev] - Settings / Customers - Lago x Stripe ACH & BACS - name: 👍 [Ready for dev] - Plans - Invoice minimum spending id: 65d601bee599243feb44af59 + fileName: 👍 [Ready for dev] - Plans - Invoice minimum spending + - name: 👍 [Ready for dev] - Onboarding - Create/Connect Lago orga via SSO + id: 660bf95b851f012f6f11ecd0 format: flat variants: true diff --git a/ditto/index.js b/ditto/index.js index 8d4c7295e..a2f9c117f 100644 --- a/ditto/index.js +++ b/ditto/index.js @@ -68,6 +68,9 @@ module.exports = { "project_642707b04540bee48d54de86": { "base": require('./-ready-for-dev---login---reset-password__base.json') }, + "project_660bf95b851f012f6f11ecd0": { + "base": require('./-ready-for-dev---onboarding---createconnect-lago-orga-via-sso__base.json') + }, "project_63208b60a9b2a4c6186bbd26": { "base": require('./-ready-for-dev---onboarding---invite-member-to-organisation__base.json') }, diff --git a/src/components/auth/GoogleAuthButton.tsx b/src/components/auth/GoogleAuthButton.tsx index 34064f910..fe3e7cad5 100644 --- a/src/components/auth/GoogleAuthButton.tsx +++ b/src/components/auth/GoogleAuthButton.tsx @@ -4,6 +4,7 @@ import { useEffect, useState } from 'react' import { useSearchParams } from 'react-router-dom' import { hasDefinedGQLError } from '~/core/apolloClient' +import { DOCUMENTATION_ENV_VARS } from '~/core/constants/externalUrls' import { addValuesToUrlState } from '~/core/utils/urlUtils' import { LagoApiError, useGetGoogleAuthUrlLazyQuery } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' @@ -15,13 +16,13 @@ export type GoogleAuthModeEnum = 'login' | 'signup' | 'invite' const getErrorKey = (errorCode: string): string => { switch (errorCode) { case LagoApiError.InvalidGoogleToken: - return 'TODO: This is the error message for invalid google code' case LagoApiError.InvalidGoogleCode: - return 'TODO: This is the error message for invalid google code' case LagoApiError.GoogleAuthMissingSetup: - return 'TODO: This is the error message for missing google setup' + return 'text_660bf95c75dd928ced0ecb25' + case LagoApiError.UserDoesNotExists: + return 'text_660bfaa2cbc95800a63f48b1' default: - return 'TODO: This is the default error message' + return 'text_62b31e1f6a5b8b1b745ece48' } } @@ -64,7 +65,11 @@ const GoogleAuthButton = ({ invitationToken, label, mode }: BasicGoogleAuthButto return ( - {!!errorCode && {translate(getErrorKey(errorCode))}} + {!!errorCode && ( + + {translate(getErrorKey(errorCode), { href: DOCUMENTATION_ENV_VARS })} + + )}