Skip to content

Commit

Permalink
refactor: optmize phrases
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed May 29, 2024
1 parent 87bffee commit 706893c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 26 deletions.
1 change: 0 additions & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"remark-gfm": "^4.0.0",
"stylelint": "^15.0.0",
"swr": "^2.2.0",
"titleize": "^4.0.0",
"ts-node": "^10.9.2",
"tslib": "^2.4.1",
"typescript": "^5.3.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ function PlanCardItem({ plan, onSelect }: Props) {
<Button
title={
<DangerousRaw>
<Trans components={{ name: <PlanName isTitleCase name={planName} /> }}>
{t('select_plan')}
</Trans>
<Trans components={{ name: <PlanName name={planName} /> }}>{t('select_plan')}</Trans>
</DangerousRaw>
}
disabled={isFreePlan && isFreeTenantExceeded}
Expand Down
6 changes: 2 additions & 4 deletions packages/console/src/components/PlanName/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { type TFuncKey } from 'i18next';
import { useTranslation } from 'react-i18next';
import titleize from 'titleize';

import { ReservedPlanName } from '@/types/subscriptions';

Expand All @@ -17,10 +16,9 @@ const registeredPlanNamePhraseMap: Record<

type Props = {
readonly name: string;
readonly isTitleCase?: boolean;
};

function PlanName({ name, isTitleCase = false }: Props) {
function PlanName({ name }: Props) {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console.subscription' });
const planNamePhrase = registeredPlanNamePhraseMap[name];

Expand All @@ -29,7 +27,7 @@ function PlanName({ name, isTitleCase = false }: Props) {
*/
const planName = planNamePhrase ? String(t(planNamePhrase)) : name;

return <span>{isTitleCase ? titleize(planName) : planName}</span>;
return <span>{planName}</span>;
}

export default PlanName;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import quota_table from './quota-table.js';
const subscription = {
free_plan: 'Kostenloser Plan',
free_plan_description: 'Für Nebenprojekte und erste Logto-Tests. Keine Kreditkarte erforderlich.',
pro_plan: 'Pro Plan',
pro_plan: 'Pro plan',
pro_plan_description: 'Für Unternehmen, die sorgenfrei von Logto profitieren möchten.',
enterprise: 'Unternehmen',
current_plan: 'Aktueller Plan',
Expand Down Expand Up @@ -56,7 +56,7 @@ const subscription = {
upgrade_title: 'Freundliche Erinnerung für unsere geschätzten Early Adopters',
upgrade_description:
'Sie nutzen derzeit mehr als das, was <name /> erlaubt. Logto ist nun offiziell und bietet Funktionen, die auf jeden Tarif zugeschnitten sind. Bevor Sie ein Upgrade auf den <name /> in Betracht ziehen, stellen Sie sicher, dass Sie die folgenden Kriterien für das Upgrade erfüllen.',
upgrade_pro_tip: ' Oder erwägen Sie ein Upgrade auf den Pro Plan.',
upgrade_pro_tip: ' Oder erwägen Sie ein Upgrade auf den Pro plan.',
upgrade_help_tip: 'Hilfe beim Upgrade benötigt? <a>Kontaktieren Sie uns</a>.',
a_maximum_of: 'Maximal <item/>',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const subscription = {
pro_plan: 'Pro plan',
pro_plan_description: 'For businesses benefit worry-free with Logto.',
enterprise: 'Enterprise',
current_plan: 'Current Plan',
current_plan: 'Current plan',
current_plan_description:
'Here’s your current plan. You can easily see your plan usage, check your upcoming bill, and make changes to your plan as needed.',
plan_usage: 'Plan usage',
Expand All @@ -16,7 +16,7 @@ const subscription = {
next_bill_hint: 'To learn more about the calculation, please refer to this <a>article</a>.',
next_bill_tip:
'The prices displayed here are tax-exclusive. The tax amount will be calculated based on the information you provide and your local regulatory requirements, and will be shown in your invoices.',
manage_payment: 'Manage Payment',
manage_payment: 'Manage payment',
overfill_quota_warning:
'You have reached your quota limit. To prevent any issues, upgrade the plan.',
upgrade_pro: 'Upgrade pro',
Expand Down Expand Up @@ -56,7 +56,7 @@ const subscription = {
upgrade_title: 'Friendly reminder for our honoured early adopters',
upgrade_description:
'You’re currently using more than what the <name /> allows. Logto is now official, including features tailored to each plan. Before you consider upgrading to the <name />, make sure you meet the following criteria before upgrading.',
upgrade_pro_tip: ' Or considering upgrading to Pro Plan.',
upgrade_pro_tip: ' Or considering upgrading to Pro plan.',
upgrade_help_tip: 'Need help upgrading? <a>Contact us</a>.',
a_maximum_of: 'A maximum of <item/>',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const tenants = {
delete_button: 'Permanently delete',
cannot_delete_title: 'Cannot delete this tenant',
cannot_delete_description:
"Sorry, you can't delete this tenant right now. Please make sure you're on the Free Plan and have paid all outstanding billings.",
"Sorry, you can't delete this tenant right now. Please make sure you're on the Free plan and have paid all outstanding billings.",
},
leave_tenant_modal: {
description: 'Are you sure you want to leave this tenant?',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const subscription = {
free_plan: 'Ücretsiz Plan',
free_plan_description:
'Yan projeler ve başlangıç Logto denemeleri için. Kredi kartı gerektirmez.',
pro_plan: 'Pro Plan',
pro_plan: 'Pro plan',
pro_plan_description: "Endişesiz bir şekilde Logto'dan faydalanan işletmeler için.",
enterprise: 'Kurumsal',
current_plan: 'Mevcut Plan',
Expand Down Expand Up @@ -58,7 +58,7 @@ const subscription = {
upgrade_title: 'Saygıdeğer erken benimseyenlerimiz için dostane hatırlatma',
upgrade_description:
"Şu anda <name /> tarafından izin verilenden daha fazlasını kullanıyorsunuz. Logto artık resmi olarak kullanılabilir durumda ve her plana özel özellikler sunuyor. <name />'e yükseltmeyi düşünmeden önce, yükseltme öncesinde aşağıdaki kriterleri karşıladığınızdan emin olun.",
upgrade_pro_tip: " Ya da Pro Plan'a geçmeyi düşünün.",
upgrade_pro_tip: " Ya da Pro plan'a geçmeyi düşünün.",
upgrade_help_tip:
'Yükseltme konusunda yardıma mı ihtiyacınız var? <a>Bizimle iletişime geçin</a>.',
a_maximum_of: '<item/> için maksimum',
Expand Down
11 changes: 1 addition & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 706893c

Please sign in to comment.