refactor: new i18n strings for data sharing and data component

This commit is contained in:
Joel Jacob Stephen
2024-02-20 20:31:00 +05:30
parent e261f75cc8
commit ba58e25278
3 changed files with 39 additions and 16 deletions

View File

@@ -1,10 +1,12 @@
{ {
"app": { "app": {
"collapse_sidebar": "Collapse Sidebar", "collapse_sidebar": "Collapse Sidebar",
"continue_to_dashboard": "Continue to Dashboard",
"expand_sidebar": "Expand Sidebar", "expand_sidebar": "Expand Sidebar",
"name": "HOPPSCOTCH", "name": "HOPPSCOTCH",
"no_name": "No name", "no_name": "No name",
"open_navigation": "Open Navigation" "open_navigation": "Open Navigation",
"read_documentation": "Read Documentation"
}, },
"configs": { "configs": {
"auth_providers": { "auth_providers": {
@@ -16,7 +18,7 @@
}, },
"confirm_changes": "Hoppscotch server must restart to reflect the new changes. Confirm changes made to the server configurations?", "confirm_changes": "Hoppscotch server must restart to reflect the new changes. Confirm changes made to the server configurations?",
"input_empty": "Please fill all the fields before updating the configurations", "input_empty": "Please fill all the fields before updating the configurations",
"dataSharing": { "data-sharing": {
"title": "Data Sharing", "title": "Data Sharing",
"description": "Help improve Hoppscotch by sharing anonymous data", "description": "Help improve Hoppscotch by sharing anonymous data",
"enable": "Enable Data Sharing", "enable": "Enable Data Sharing",
@@ -48,6 +50,14 @@
"save_changes": "Save Changes", "save_changes": "Save Changes",
"title": "Configurations" "title": "Configurations"
}, },
"data_sharing": {
"description": "Share anonymous data usage to improve Hoppscotch",
"enable": "Enable Data Sharing",
"see_shared": "See what is shared",
"toggle_description": "Share data and make Hoppscotch better",
"title": "Make Hoppscotch Better",
"welcome": "Welcome to"
},
"metrics": { "metrics": {
"dashboard": "Dashboard", "dashboard": "Dashboard",
"no_metrics": "No metrics found", "no_metrics": "No metrics found",
@@ -56,6 +66,13 @@
"total_teams": "Total Workspaces", "total_teams": "Total Workspaces",
"total_users": "Total Users" "total_users": "Total Users"
}, },
"newsletter": {
"description": "Get updates about our latest news",
"subscribe": "Subscribe",
"title": "Stay in Touch",
"toggle_description": "Get updates about the latest at Hoppscotch",
"unsubscribe": "Unsubscribe"
},
"settings": { "settings": {
"settings": "Settings" "settings": "Settings"
}, },

View File

@@ -1,16 +1,16 @@
<template> <template>
<div class="md:grid md:grid-cols-3 md:gap-4 border-divider border-b py-8"> <div class="md:grid md:grid-cols-3 md:gap-4 border-divider border-b py-8">
<div class="px-8 md:col-span-1"> <div class="px-8 md:col-span-1">
<h3 class="heading">{{ t('configs.dataSharing.title') }}</h3> <h3 class="heading">{{ t('configs.data-sharing.title') }}</h3>
<p class="my-1 text-secondaryLight"> <p class="my-1 text-secondaryLight">
{{ t('configs.dataSharing.description') }} {{ t('configs.data-sharing.description') }}
</p> </p>
</div> </div>
<div class="mt-5 mx-8 md:col-span-2"> <div class="mt-5 mx-8 md:col-span-2">
<section v-if="dataSharingConfigs"> <section v-if="dataSharingConfigs">
<h4 class="font-semibold text-secondaryDark"> <h4 class="font-semibold text-secondaryDark">
{{ t('configs.dataSharing.title') }} {{ t('configs.data-sharing.title') }}
</h4> </h4>
<div class="space-y-4 py-4"> <div class="space-y-4 py-4">
@@ -19,7 +19,7 @@
:on="dataSharingConfigs.enabled" :on="dataSharingConfigs.enabled"
@change="dataSharingConfigs.enabled = !dataSharingConfigs.enabled" @change="dataSharingConfigs.enabled = !dataSharingConfigs.enabled"
> >
{{ t('configs.dataSharing.toggle_description') }} {{ t('configs.data-sharing.toggle_description') }}
</HoppSmartToggle> </HoppSmartToggle>
</div> </div>
</div> </div>
@@ -28,7 +28,7 @@
outline outline
filled filled
:icon="IconShieldQuestion" :icon="IconShieldQuestion"
:label="t('configs.dataSharing.see_shared')" :label="t('configs.data-sharing.see_shared')"
to="http://docs.hoppscotch.io" to="http://docs.hoppscotch.io"
class="w-min my-2" class="w-min my-2"
/> />

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="flex flex-col items-center justify-center min-h-screen"> <div class="flex flex-col items-center justify-center min-h-screen">
<div class="text-center"> <div class="text-center">
<h2 class="text-lg">Welcome to</h2> <h2 class="text-lg">{{ t('data_sharing.welcome') }}</h2>
<img src="/assets/images/hoppscotch-title.svg" alt="" class="mt-2 w-56" /> <img src="/assets/images/hoppscotch-title.svg" alt="" class="mt-2 w-56" />
</div> </div>
<div <div
@@ -9,36 +9,40 @@
> >
<div> <div>
<div class="flex flex-col"> <div class="flex flex-col">
<p class="text-lg font-bold text-white">Make Hoppscotch Better</p> <p class="text-lg font-bold text-white">
{{ t('data_sharing.title') }}
</p>
<p class="text-sm font-light"> <p class="text-sm font-light">
Share anonymous data usage to improve Hoppscotch {{ t('data_sharing.description') }}
</p> </p>
<HoppSmartToggle <HoppSmartToggle
:on="shareData" :on="shareData"
@change="shareData = !shareData" @change="shareData = !shareData"
class="my-5 text-white w-min justify-start" class="my-5 text-white w-min justify-start"
> >
Share data and make Hoppscotch better {{ t('data_sharing.toggle_description') }}
</HoppSmartToggle> </HoppSmartToggle>
<HoppButtonSecondary <HoppButtonSecondary
outline outline
filled filled
:icon="IconShieldQuestion" :icon="IconShieldQuestion"
label="See what is shared" :label="t('data_sharing.see_shared')"
to="http://docs.hoppscotch.io" to="http://docs.hoppscotch.io"
class="w-min mx-auto mb-2" class="w-min mx-auto mb-2"
/> />
</div> </div>
<div class="mt-5"> <div class="mt-5">
<p class="text-lg font-bold text-white">Stay in Touch</p> <p class="text-lg font-bold text-white">
{{ t('newsletter.title') }}
</p>
<p class="text-sm font-light">Get updates about our latest news</p> <p class="text-sm font-light">Get updates about our latest news</p>
<HoppSmartToggle <HoppSmartToggle
:on="shareEmail" :on="shareEmail"
@change="shareEmail = !shareEmail" @change="shareEmail = !shareEmail"
class="my-5 text-white" class="my-5 text-white"
> >
Get updates about the latest at Hoppscotch {{ t('newsletter.toggle_description') }}
</HoppSmartToggle> </HoppSmartToggle>
</div> </div>
</div> </div>
@@ -46,7 +50,7 @@
<div class="flex flex-col w-48 mx-auto mt-5"> <div class="flex flex-col w-48 mx-auto mt-5">
<HoppButtonPrimary <HoppButtonPrimary
:icon="IconLogIn" :icon="IconLogIn"
label="Continue to Dashboard" :label="t('app.continue_to_dashboard')"
@click="submitSelection" @click="submitSelection"
/> />
<a href="http://docs.hoppscotch.io"> <a href="http://docs.hoppscotch.io">
@@ -54,7 +58,7 @@
outline outline
filled filled
:icon="IconBookOpenText" :icon="IconBookOpenText"
label="Read Documentation" :label="t('app.read_documentation')"
class="mt-3 px-5" class="mt-3 px-5"
/> />
</a> </a>
@@ -67,6 +71,7 @@
import { useMutation } from '@urql/vue'; import { useMutation } from '@urql/vue';
import { ref } from 'vue'; import { ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useI18n } from '~/composables/i18n';
import { useToast } from '~/composables/toast'; import { useToast } from '~/composables/toast';
import { auth } from '~/helpers/auth'; import { auth } from '~/helpers/auth';
import { import {
@@ -78,6 +83,7 @@ import IconBookOpenText from '~icons/lucide/book-open-text';
import IconLogIn from '~icons/lucide/log-in'; import IconLogIn from '~icons/lucide/log-in';
import IconShieldQuestion from '~icons/lucide/shield-question'; import IconShieldQuestion from '~icons/lucide/shield-question';
const t = useI18n();
const toast = useToast(); const toast = useToast();
const router = useRouter(); const router = useRouter();
const user = auth.getCurrentUser(); const user = auth.getCurrentUser();