Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Added translations for Billing & fixed some small issues

Blue Mouse7507b5eb0617
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 0994a9dee..3f08384cf 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -265,6 +265,36 @@
"deleteHint": "By pressing 'Delete project' you understand, that this action is irreversible.\nThe project and all the data related to it will be deleted from our servers."
}
},
+ "billing": {
+ "title": "Billing & Plans",
+ "desc": "It is free to get started and use our services.\nIf you need to handle more traffic, you probably need to upgrade your plan.\nBelow is a list of available plans. No hidden fees or other BS, everything is clear and transparent!",
+ "contact": "Need to track more than 1 million events per month?\nContact us at <mail>{{email}}</mail> to discuss your needs."
+ },
+ "pricing": {
+ "title": "Pricing Plans",
+ "adv": "Start out for free, no credit card needed.\nWhen your business grows, you can upgrade your plan at any time.",
+ "currentPlan": "Current plan",
+ "free": "Free",
+ "perMonth": "mo",
+ "yourPlan": "Your plan",
+ "downgrade": "Downgrade",
+ "upgrade": "Upgrade",
+ "whatIncl": "What's included",
+ "tiers": {
+ "hobby": "Hobby",
+ "freelancer": "Freelancer",
+ "startup": "Startup",
+ "enterprise": "Enterprise",
+ "upToXEVMo": "Up to {{amount}} events per month.",
+ "xEvMo": "{{amount}} events per month.",
+ "upToXProjects": "Create up to {{amount}} projects.",
+ "xMoDataRetention": "{{amount}} months of data retention.",
+ "highStandardSec": "High standard security.",
+ "evXPlanIncl": "Everything {{plan}} plan includes.",
+ "smallBusiSupport": "By buying this in you are supporting a small business.",
+ "carbonRemoval": "Your subscription contributes to carbon removal."
+ }
+ },
"titles": {
"recovery": "Account recovery",
"signin": "Sign in",
@@ -273,7 +303,8 @@
"profileSettings": "Profile settings",
"features": "Features",
"dashboard": "Dashboard",
- "docs": "Documentation"
+ "docs": "Documentation",
+ "billing": "Billing"
},
"footer": {
"slogan": "The best apps need the best services.",
diff --git a/src/pages/Billing/index.jsx b/src/pages/Billing/index.jsx
index 2b48879a8..4905fae18 100644
--- a/src/pages/Billing/index.jsx
+++ b/src/pages/Billing/index.jsx
@@ -1,29 +1,35 @@
+/* eslint-disable jsx-a11y/anchor-has-content */
import React from 'react'
+import { useTranslation, Trans } from 'react-i18next'
import Pricing from '../MainPage/Pricing'
import { isAuthenticated } from '../../hoc/protected'
import Title from 'components/Title'
+// todo: create CONTACT_EMAIL variable and use it in the app
const Features = () => {
+ const { t } = useTranslation('common')
+
return (
- <Title title='Billing'>
+ <Title title={t('titles.billing')}>
<div className='bg-gray-50'>
- <div className='w-11/12 md:w-4/5 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:px-8'>
- <h1 className='text-4xl mb-4 font-extrabold text-gray-900 tracking-tight'>Billing &amp; Plans</h1>
+ <div className='w-11/12 md:w-4/5 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:px-8 whitespace-pre-line'>
+ <h1 className='text-4xl mb-4 font-extrabold text-gray-900 tracking-tight'>
+ {t('billing.title')}
+ </h1>
<p className='text-lg text-gray-900 tracking-tight'>
- It is free to get started and use our services.<br />
- If you need to handle more traffic, you probably need to upgrade your plan.<br />
- Below is a list of available plans. No hidden fees or other BS, everything is clear and transparent!
+ {t('billing.desc')}
</p>
- <Pricing />
+ <Pricing t={t} />
<p className='text-lg text-gray-900 tracking-tight mt-10'>
- Need to track more than 1 million events per month?<br />
- Contact us at&nbsp;
- <a href='mailto:[email protected]' className='font-medium text-indigo-600 hover:text-indigo-500'>
- </a>
- &nbsp;
- to discuss your needs.
+ <Trans
+ t={t}
+ i18nKey='billing.contact'
+ values={{ email: '[email protected]'}}
+ components={{
+ mail: <a href='mailto:[email protected]' className='font-medium text-indigo-600 hover:text-indigo-500' />,
+ }}
+ />
</p>
</div>
</div>
diff --git a/src/pages/Docs/Docs.jsx b/src/pages/Docs/Docs.jsx
index 6f1bceaf5..9997ba202 100644
--- a/src/pages/Docs/Docs.jsx
+++ b/src/pages/Docs/Docs.jsx
@@ -99,7 +99,7 @@ const Docs = () => {
<div className='bg-gray-50'>
<div className='w-11/12 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:w-11/12 lg:px-8 lg:flex'>
<Contents t={t} />
- <div className='flex-1 lg:order-1'>
+ <div className='flex-1 lg:order-1 whitespace-pre-line'>
<h1 className='text-4xl font-extrabold text-gray-900 tracking-tight'>
{t('titles.docs')}
</h1>
@@ -172,7 +172,13 @@ const Docs = () => {
<li><b>pg</b> - {t('docs.tv.params.pg')}</li>
</ul>
</div>
- {t('docs.tv.gather')}
+ <Trans
+ t={t}
+ i18nKey='docs.tv.gather'
+ components={{
+ b: <b />,
+ }}
+ />
</p>
<Code text={trackPVAPI} language='javascript' />
diff --git a/src/pages/Features/index.jsx b/src/pages/Features/index.jsx
index a69be61f4..29c8e7d06 100644
--- a/src/pages/Features/index.jsx
+++ b/src/pages/Features/index.jsx
@@ -14,7 +14,7 @@ const Features = () => {
return (
<Title title={t('titles.features')}>
<div className='bg-gray-50'>
- <div className='w-11/12 md:w-4/5 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:px-8'>
+ <div className='w-11/12 md:w-4/5 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:px-8 whitespace-pre-line'>
<h1 className='text-4xl font-extrabold text-gray-900 tracking-tight'>
{t('titles.features')}
</h1>
diff --git a/src/pages/MainPage/Pricing.jsx b/src/pages/MainPage/Pricing.jsx
index cc9b7a607..1f2df6059 100644
--- a/src/pages/MainPage/Pricing.jsx
+++ b/src/pages/MainPage/Pricing.jsx
@@ -14,57 +14,58 @@ import { errorsActions } from 'redux/actions/errors'
import { upgradePlan } from 'api'
import routes from 'routes'
-const tiers = [
+const getTiers = (t) => [
{
- name: 'Hobby',
+ name: t('pricing.tiers.hobby'),
planCode: 'free',
priceMonthly: null,
includedFeatures: [
- 'Up to 3000 events per month.',
- 'Create up to 5 projects.',
- '3 months of data retention.',
- 'High standard security.',
+ t('pricing.tiers.upToXEVMo', { amount: 3000 }),
+ t('pricing.tiers.upToXProjects', { amount: 5 }),
+ t('pricing.tiers.xMoDataRetention', { amount: 3 }),
+ t('pricing.tiers.highStandardSec'),
],
},
{
- name: 'Freelancer',
+ name: t('pricing.tiers.freelancer'),
planCode: 'freelancer',
priceMonthly: 24,
includedFeatures: [
- 'Everything \'Hobby\' plan includes.',
- '100k events per month.',
- 'Create up to 10 projects.',
- '12 months of data retention.',
- 'By buying this in you are supporting a small business.',
- 'Your subscription contributes to carbon removal.',
+ t('pricing.tiers.evXPlanIncl', { plan: t('pricing.tiers.hobby') }),
+ t('pricing.tiers.xEvMo', { amount: '100k' }),
+ t('pricing.tiers.upToXProjects', { amount: 10 }),
+ t('pricing.tiers.xMoDataRetention', { amount: 12 }),
+ t('pricing.tiers.smallBusiSupport'),
+ t('pricing.tiers.carbonRemoval'),
],
},
{
- name: 'Startup',
+ name: t('pricing.tiers.startup'),
planCode: 'startup',
priceMonthly: 72,
includedFeatures: [
- 'Everything \'Freelancer\' plan includes.',
- '500k events per month.',
- '12 months of data retention.',
+ t('pricing.tiers.evXPlanIncl', { plan: t('pricing.tiers.freelancer') }),
+ t('pricing.tiers.xEvMo', { amount: '500k' }),
+ t('pricing.tiers.xMoDataRetention', { amount: 12 }),
],
},
{
- name: 'Enterprise',
+ name: t('pricing.tiers.enterprise'),
planCode: 'enterprise',
priceMonthly: 110,
includedFeatures: [
- 'Everything \'Startup\' plan includes.',
- '1m events per month.',
- '24 months of data retention.',
+ t('pricing.tiers.evXPlanIncl', { plan: t('pricing.tiers.startup') }),
+ t('pricing.tiers.xEvMo', { amount: '1m' }),
+ t('pricing.tiers.xMoDataRetention', { amount: 24 }),
],
},
]
-const Pricing = () => {
+const Pricing = ({ t }) => {
const dispatch = useDispatch()
const { authenticated, user } = useSelector(state => state.auth)
const [planCodeLoading, setPlanCodeLoading] = useState(null)
+ const tiers = getTiers(t)
const onPlanChange = async (planCode) => {
if (planCodeLoading === null && user.planCode !== planCode) {
@@ -73,7 +74,7 @@ const Pricing = () => {
const { data: { url } } = await upgradePlan(planCode)
if (_isEmpty(url)) {
- dispatch('Payment error: No Stripe URL was provided')
+ console.error('[ERROR] Payment error: No Stripe URL was provided')
} else {
window.location.href = url
}
@@ -91,14 +92,15 @@ const Pricing = () => {
return (
<div id='pricing' className={cx({ 'bg-white': !authenticated })}>
- <div className={cx('w-11/12 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8', { 'py-24': !authenticated })}>
+ <div className={cx('w-11/12 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 whitespace-pre-line', { 'py-24': !authenticated })}>
<div className='sm:flex sm:flex-col sm:align-center'>
{!authenticated && (
<>
- <h1 className='text-3xl font-extrabold text-gray-900 sm:text-center'>Pricing Plans</h1>
+ <h1 className='text-3xl font-extrabold text-gray-900 sm:text-center'>
+ {t('pricing.title')}
+ </h1>
<p className='mt-5 text-xl text-gray-500 sm:text-center'>
- Start out for free, no credit card needed.<br />
- When your business grows, you can upgrade your plan at any time.
+ {t('pricing.adv')}
</p>
</>
)}
@@ -130,7 +132,7 @@ const Pricing = () => {
<div className='absolute inset-x-0 top-0 transform translate-y-px'>
<div className='flex justify-center transform -translate-y-1/2'>
<span className='inline-flex rounded-full bg-indigo-600 px-4 py-1 text-sm font-semibold tracking-wider uppercase text-white'>
- Current plan
+ {t('pricing.currentPlan')}
</span>
</div>
</div>
@@ -139,11 +141,19 @@ const Pricing = () => {
<h2 className='text-lg leading-6 font-medium text-gray-900'>{tier.name}</h2>
<p className='mt-4'>
{_isNil(tier.priceMonthly) ? (
- <span className='text-4xl font-extrabold text-gray-900'>Free</span>
+ <span className='text-4xl font-extrabold text-gray-900'>
+ {t('pricing.free')}
+ </span>
) : (
<>
- <span className='text-4xl font-extrabold text-gray-900'>${tier.priceMonthly}</span>{' '}
- <span className='text-base font-medium text-gray-500'>/mo</span>
+ <span className='text-4xl font-extrabold text-gray-900'>
+ ${tier.priceMonthly}
+ </span>
+ &nbsp;
+ <span className='text-base font-medium text-gray-500'>
+ /
+ {t('pricing.perMonth')}
+ </span>
</>
)}
</p>
@@ -158,14 +168,14 @@ const Pricing = () => {
{planCodeLoading === tier.planCode && (
<Spin />
)}
- {tier.planCode === user.planCode ? 'Your plan' : 'Downgrade'}
+ {tier.planCode === user.planCode ? t('pricing.yourPlan') : t('pricing.downgrade')}
</span>
) : (
<Link
className='inline-flex items-center justify-center mt-8 w-full rounded-md py-2 text-sm font-semibold text-white text-center cursor-pointer select-none bg-indigo-600 hover:bg-indigo-700'
to={routes.signup}
>
- Get started
+ {t('common.getStarted')}
</Link>
)
) : authenticated ? (
@@ -179,19 +189,21 @@ const Pricing = () => {
{planCodeLoading === tier.planCode && (
<Spin />
)}
- {planCodeID > userPlancodeID ? 'Upgrade' : planCodeID < userPlancodeID ? 'Downgrade' : 'Your plan'}
+ {planCodeID > userPlancodeID ? t('pricing.upgrade') : planCodeID < userPlancodeID ? t('pricing.downgrade') : t('pricing.yourPlan')}
</span>
) : (
<Link
className='mt-8 block w-full bg-indigo-600 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-indigo-700'
to={routes.signup}
>
- Upgrade
+ {t('pricing.upgrade')}
</Link>
)}
</div>
<div className='pt-6 pb-8 px-6'>
- <h3 className='text-xs font-medium text-gray-900 tracking-wide uppercase'>What's included</h3>
+ <h3 className='text-xs font-medium text-gray-900 tracking-wide uppercase'>
+ {t('pricing.whatIncl')}
+ </h3>
<ul className='mt-6 space-y-4'>
{_map(tier.includedFeatures, (feature) => (
<li key={feature} className='flex space-x-3'>
diff --git a/src/pages/MainPage/index.jsx b/src/pages/MainPage/index.jsx
index c34162639..41bc5e5d5 100644
--- a/src/pages/MainPage/index.jsx
+++ b/src/pages/MainPage/index.jsx
@@ -185,7 +185,7 @@ const Main = () => {
</div>
</div>
</div>
- <Pricing />
+ <Pricing t={t} />
<FAQs t={t} />
<div className='bg-white'>
diff --git a/src/pages/Project/Settings/ProjectSettings.jsx b/src/pages/Project/Settings/ProjectSettings.jsx
index 87de57ebf..dc6ae2632 100644
--- a/src/pages/Project/Settings/ProjectSettings.jsx
+++ b/src/pages/Project/Settings/ProjectSettings.jsx
@@ -1,6 +1,6 @@
import React, { useState, useEffect, useMemo, memo } from 'react'
import { useLocation, useHistory, useParams } from 'react-router-dom'
-import { useTranslation, Trans } from 'react-i18next'
+import { useTranslation } from 'react-i18next'
import _isEmpty from 'lodash/isEmpty'
import _size from 'lodash/size'
import _replace from 'lodash/replace'
@@ -61,7 +61,7 @@ const ProjectSettings = ({
})
}
}
- }, [user, project, isLoading, isSettings, history, showError, projectDeleting])
+ }, [user, project, isLoading, isSettings, history, showError, projectDeleting, t])
const onSubmit = async (data) => {
if (!projectSaving) {
diff --git a/src/pages/Project/View/ViewProject.jsx b/src/pages/Project/View/ViewProject.jsx
index 31b88cb21..5e5072953 100644
--- a/src/pages/Project/View/ViewProject.jsx
+++ b/src/pages/Project/View/ViewProject.jsx
@@ -155,7 +155,7 @@ const ViewProject = ({
const [analyticsLoading, setAnalyticsLoading] = useState(true)
const [period, setPeriod] = useState(projectViewPrefs[id]?.period || periodPairs[1].period)
const [timeBucket, setTimebucket] = useState(projectViewPrefs[id]?.timeBucket || periodPairs[1].tbs[1])
- const activePeriod = useMemo(() => _find(periodPairs, p => p.period === period), [period])
+ const activePeriod = useMemo(() => _find(periodPairs, p => p.period === period), [period, periodPairs])
const [showTotal, setShowTotal] = useState(false)
const [chartData, setChartData] = useState({})
const [mainChart, setMainChart] = useState(null)