You will be charged only $1 for your 7-day trial. We'll email your a reminder before your trial period ends.
>
)}
-
>
)
}
diff --git a/src/components/PaymentPage/styles.css b/src/components/PaymentPage/styles.css
index c0ad961..24d8567 100644
--- a/src/components/PaymentPage/styles.css
+++ b/src/components/PaymentPage/styles.css
@@ -37,12 +37,3 @@
line-height: 1.5;
font-size: 15px;
}
-
-.page-footer {
- font-size: 14px;
- font-weight: 400;
- line-height: 2;
- padding: 10px 0;
- color: #8e8e93;
- text-align: center;
-}
diff --git a/src/components/SubscriptionPage/index.tsx b/src/components/SubscriptionPage/index.tsx
index 08f6ac9..3c9d706 100644
--- a/src/components/SubscriptionPage/index.tsx
+++ b/src/components/SubscriptionPage/index.tsx
@@ -34,8 +34,8 @@ function SubscriptionPage(): JSX.Element {
- {t('getAccess')}
- {t('subscriptionPolicy')}
+ {t('get_access')}
+ {t('subscription_policy')}
>
)
diff --git a/src/init.tsx b/src/init.tsx
index ecb745f..fd86e0e 100644
--- a/src/init.tsx
+++ b/src/init.tsx
@@ -6,14 +6,15 @@ import { Provider } from 'react-redux'
import { store } from './store'
import { AuthProvider } from './auth'
import { ApiContext, createApi } from './api'
-import resources, { getClientLocale } from './locales'
+import { getClientLocale, buildResources, fallbackLng } from './locales'
import App from './components/App'
const init = async () => {
const api = createApi()
const lng = getClientLocale()
+ const resources = await api.getElements({ locale: lng }).then(buildResources)
const i18nextInstance = i18next.createInstance()
- const options = { lng, resources }
+ const options = { lng, resources, fallbackLng }
await i18nextInstance.use(initReactI18next).init(options)
return (
diff --git a/src/locales/dev.ts b/src/locales/dev.ts
new file mode 100644
index 0000000..970c01a
--- /dev/null
+++ b/src/locales/dev.ts
@@ -0,0 +1,38 @@
+export default {
+ translation: {
+ lets_start: "Let's start!",
+ next: "Next",
+ date_of_birth: "What's your date of birth?",
+ privacy_text: "By continuing, you agree to our EULA and Privacy Notice. Have a question? Reach our support team here",
+ born_time_question: "What time were you born?",
+ nasa_data_using: "We use NASA data to determine the exact position of the planets in the sky at the time of your birth to create wallpapers that are just right for you.",
+ cta_title: "Start your 7-day trial",
+ cta_subtitle: "No pressure. Cancel anytime.",
+ reserved_for: "Reserved for ",
+ creating_profile: "Creating your profile",
+ zodiac_analysis: "Zodiac data analysis",
+ drawing_wallpaper: "Drawing Wallpapers",
+ preparing_results: "Preparing results",
+ invalid_date: "Date not found. Please check your details and try again.",
+ year: "Year",
+ month: "Month",
+ day: "Day",
+ we_will_email_you: "We will email you a copy of your wallpaper for easy access.",
+ your_email: "Your email",
+ we_dont_share: "We don't share any personal information.",
+ continue_agree: 'By clicking "Continue" below, you agree to our EULA and Privacy Policy.',
+ continue: 'Continue',
+ app_name: "Aura",
+ unexpected_error: 'Sorry, an unexpected error has occurred.',
+ oops: "Oops!",
+ total_today: 'Total today',
+ charged_only: "You will be charged only $1 for your 7-day trial. We'll email you a reminder before your trial period ends. Cancel anytime.",
+ purposes: 'For entertaiment purposes only.',
+ get_access: 'Get access',
+ subscription_policy: 'By proceeding, you agree that if you do not cancel your subscription before the end of the 7-day trial period, you will be automatically charged nineteen US dollars zero cents every 2 weeks until you cancel the subscription in the settings. Learn more about cancellation and refund policy in Subscription policy',
+ company_name: 'Wit LLC, California, US',
+ choose_payment: 'Choose Payment Method',
+ or: 'OR',
+ card: 'Credit / Debit Card',
+ },
+}
diff --git a/src/locales/en.ts b/src/locales/en.ts
deleted file mode 100644
index dd7a3ed..0000000
--- a/src/locales/en.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-export default {
- translation: {
- letsStart: "Let's start!",
- next: "Next",
- dateOfBirth: "What's your date of birth?",
- privacyText: "By continuing, you agree to our EULA and Privacy Notice. Have a question? Reach our support team here",
- bornTimeQuestion: "What time were you born?",
- nasaDataUsing: "We use NASA data to determine the exact position of the planets in the sky at the time of your birth to create wallpapers that are just right for you.",
- ctaTitle: "Start your 7-day trial",
- ctaSubtitle: "No pressure. Cancel anytime.",
- reservedFor: "Reserved for ",
- creatingProfile: "Creating your profile",
- zodiacAnalysis: "Zodiac data analysis",
- drawingWallpaper: "Drawing Wallpapers",
- preparingResults: "Preparing results",
- invalidDate: "Date not found. Please check your details and try again.",
- year: "Year",
- month: "Month",
- day: "Day",
- weWillEmailYou: "We will email you a copy of your wallpaper for easy access.",
- yourEmail: "Your email",
- weDontShare: "We don't share any personal information.",
- continueAgree: 'By clicking "Continue" below, you agree to our EULA and Privacy Policy.',
- continue: 'Continue',
- appName: "Aura",
- unexpectedError: 'Sorry, an unexpected error has occurred.',
- oops: "Oops!",
- totalToday: 'Total today',
- chargedOnly: "You will be charged only $1 for your 7-day trial. We'll email you a reminder before your trial period ends. Cancel anytime.",
- purposes: 'For entertaiment purposes only.',
- getAccess: 'Get access',
- subscriptionPolicy: 'By proceeding, you agree that if you do not cancel your subscription before the end of the 7-day trial period, you will be automatically charged nineteen US dollars zero cents every 2 weeks until you cancel the subscription in the settings. Learn more about cancellation and refund policy in Subscription policy',
- },
-}
diff --git a/src/locales/index.ts b/src/locales/index.ts
index ce7be91..e037fb7 100644
--- a/src/locales/index.ts
+++ b/src/locales/index.ts
@@ -1,6 +1,20 @@
-import en from './en.ts'
+import { Elements } from '../api'
+import dev from './dev.ts'
export const getClientLocale = () => navigator.language.split('-')[0]
export const getClientTimezone = () => Intl.DateTimeFormat().resolvedOptions().timeZone
+export const fallbackLng = 'dev'
-export default { en }
+const omitKeys = ['href', 'title', 'url_slug', 'type']
+const isWeb = (group: Elements.ElementGroup) => group.name === 'web'
+const cleanUp = (element: Partial = {}) => {
+ return Object.entries(element)
+ .filter(([key]) => !omitKeys.includes(key))
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
+}
+export const buildResources = (resp: Elements.Response) => {
+ const element = resp.data.groups.find(isWeb)?.items.at(0)
+ const translation = cleanUp(element)
+ const lng = getClientLocale()
+ return { [lng]: { translation }, dev }
+}