From 1ffe6e586140b23fb882e67b27a48f2cabd1de05 Mon Sep 17 00:00:00 2001 From: Kobina Koomson Date: Thu, 29 Aug 2024 16:36:45 +0000 Subject: [PATCH] Dev -> Canary (#384) * scraped static texts on all pages * got text from modals as well * added common languages offered * setting up redux for manual language selection * hooked dropdown to redux data * feat: lang selection working with dummy data set. Selection persists too * whole of homepage now depends on static text object * interactions, comment box, events and testimonial section all looking good * one testimonial, one events page :fire: * several changes json object for static text and testing with dummy translations * language is now automatically added to apiCall * fixed bug with comment component translation * more translations, and tweaks to page json structure * testimonial form now translated too * getting started with languages offered page * still setting up multi select on dropdown. checkbox in dropdown is not checking yet * removing language works locally * setup admin lang selector and docked it at the top of campaign edit page * dropdown for language context on admin side now works with admin selected languages * remove log * Now changed to toggles * removed comments and added translation for fallback text * removed logs * edited toggles * add language back in there * sort languages * translated more fallback texts * translated preview mode & events too * paused on admin tans for now * removed comments and limited languages * now loads language list from api * better config log * version number bump * point to dev * Bump BUILD_VERSION to 1.1.1 * user language * remove about * version number resolution * upgrade * Bump BUILD_VERSION to 1.1.4 * en-us * Bump BUILD_VERSION to 1.1.5 * toggling languages works for admins * client side loads from toggle list * dont show ribbon when no list is provided * dash will be provided if only one enabled language * fix nav issue * english cant be toggled, several tweaks to frontend logic * pre testimonial translations setup for homepage area * translated more dialogs * resolved some circular imports * cp for language selectino modal * language modal setup with several bug fixes also done * fixed testimonial form translation & height issues * now added flags * Bump BUILD_VERSION to 1.1.6 * squashed conflicts * Bump BUILD_VERSION to 1.1.7 * added caret * fixed single and no language logic * bump * Bump BUILD_VERSION to 1.1.9 * now looks for language only when data is loaded * removed logs * optional lang * Bump BUILD_VERSION to 1.1.10 * made messenger pull from local storage (#347) * Bump BUILD_VERSION to 1.1.11 * Prevent language override for admin users This change ensures that the user language parameter is not appended to the API call when the user is an admin. This avoids any conflict or unintended behavior for admin-level operations, enhancing the robustness of language handling in the messaging API. * Add optional chaining in various string splitting operations Refactor the code to use optional chaining for string split operations to ensure error prevention on null or undefined values. This change improves the robustness of the code, particularly for scenarios where split might be called on potentially nullable strings. * Bump BUILD_VERSION to 1.1.12 * in the process of setting up custom loading messages to inform user of unsupported languages * resolved conflict with chosen language that is not supported by campaign * separating languages from language obj * initial box now translates * about only available from english * capture weird screen dimensions with media queries * blanket notification now in approuter * tighter media query * eventos * more date objs translated too * No preferred language should fallback to english * Bump BUILD_VERSION to 1.1.13 * Fix: Broken community portal link (#379) * Add dynamic URL support for community portal Updated the COMMUNITY_PORTAL_URL to dynamically generate the base URL depending on the environment. Added a utility function `getCommunityPortalBaseURL` to handle this logic. * Refactor community portal URL logic Consolidate community portal URLs into a single `BASE_URL` constant. This change simplifies URL management and reduces redundancy in the codebase. The `getCommunityPortalBaseURL` function has been removed and replaced with a cleaner variable definition. * Fix incorrect branching condition for production environment The `if (IS_PROD)` condition has been changed to `else if (IS_PROD)` to ensure it is mutually exclusive with previous conditions. This prevents the production URL assignment from being skipped if a prior condition is satisfied. * Bump BUILD_VERSION to 1.1.14 * fixed other, and doubly sending user language * filter instead of map * fixed "other" on sharing modal * Bump BUILD_VERSION to 1.1.15 * translated comment section * news letter trans * translated a few toasts * remove logs * Bump BUILD_VERSION to 1.1.16 * Bump BUILD_VERSION to 1.1.17 * spanish continue * added the link for volunteering * manual bump * Bump BUILD_VERSION to 1.1.19 --------- Co-authored-by: frimpongopoku Co-authored-by: Version Update Bot Co-authored-by: Tahiru Abdullai Co-authored-by: Abdullai Tahiru <42780120+abdullai-t@users.noreply.github.com> --- package.json | 2 +- src/api/messenger.js | 3 + src/assets/styles/tablet-ish.css | 14 + src/assets/styles/universal.css | 1 + src/components/language/LanguageSelector.js | 56 +- src/components/pieces/BlanketNotification.js | 58 + src/config/config.json | 2 +- src/redux/actions/actions.js | 84 +- src/redux/reducers/reducers.js | 15 + src/redux/reducers/state.js | 7 + src/redux/redux-action-types.js | 3 + src/routes/AppRouter.js | 7 +- .../commenting/CommentComponentForModal.js | 10 +- src/user-portal/pages/footer/Footer.js | 11 + .../pages/forms/CommunitySelector.js | 2 +- src/user-portal/pages/forms/JoinUsForm.js | 15 +- .../pages/landing-page/CampaignNotLive.js | 11 +- src/user-portal/pages/landing-page/DoMore.js | 4 +- .../pages/landing-page/LandingPage.js | 11 +- src/user-portal/pages/sharing/ShareBox.js | 5 +- .../technology/CommentDeleteConfirmation.js | 16 +- .../technology/TechnologyFullViewPage.js | 29 +- .../pages/testimonials/TestimonialBox.js | 1 + .../internationalization/json-statics.js | 1088 +++++++++-------- src/utils/utils.js | 31 +- 25 files changed, 879 insertions(+), 607 deletions(-) create mode 100644 src/assets/styles/tablet-ish.css create mode 100644 src/components/pieces/BlanketNotification.js diff --git a/package.json b/package.json index d5e9d801..03356d08 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "start": "react-scripts start", + "start": "PORT=3002 react-scripts start", "build": "CI=false react-scripts build", "build:dev": "NODE_ENV=development REACT_APP_TARGET_ENV=development CI=false react-scripts build", "build:canary": "NODE_ENV=canary REACT_APP_TARGET_ENV=canary CI=false react-scripts build", diff --git a/src/api/messenger.js b/src/api/messenger.js index 9d38103b..7d1866b0 100644 --- a/src/api/messenger.js +++ b/src/api/messenger.js @@ -28,13 +28,16 @@ export async function apiCall(destinationUrl, dataToSend = {}, relocationPage = const data = { // __is_prod: IS_PROD || IS_CANARY, // __is_admin_site: true, + ...(lang && !portalIsAdmin() ? { __user_language: lang } : {}), ...dataToSend, }; const formData = new FormData(); + // if (lang && !portalIsAdmin()) formData.append("__user_language", lang); Object.keys(data).map((k) => formData.append(k, data[k])); if (lang && !portalIsAdmin()) formData.append("__user_language", lang); + if (!destinationUrl || destinationUrl.length < 2) { return { success: false, error: "Invalid URL passed to apiCall" }; } diff --git a/src/assets/styles/tablet-ish.css b/src/assets/styles/tablet-ish.css new file mode 100644 index 00000000..fe77fede --- /dev/null +++ b/src/assets/styles/tablet-ish.css @@ -0,0 +1,14 @@ +@media only screen and (min-width: 768px) and (max-width: 1280px) { + .lang-s-p-override { + right: 0px !important; + } + .lang-s-ribbon { + background: white; + /* right:0px; */ + border-top-left-radius: 50px; + border-bottom-left-radius: 50px; + padding: 10px; + box-shadow: var(--elevate-3); + padding-left: 20px; + } +} diff --git a/src/assets/styles/universal.css b/src/assets/styles/universal.css index 74b6df0d..5da7287b 100644 --- a/src/assets/styles/universal.css +++ b/src/assets/styles/universal.css @@ -1,5 +1,6 @@ @import url(./mobile-only.css); @import url(pc-only.scss); +@import url(tablet-ish.css); @import url(./elevations.css); @import url("https://fonts.googleapis.com/css?family=Google+Sans:200,300,400,400i,500,600,700,900"); @import url("https://fonts.googleapis.com/css?family=Roboto+Slab:400,700"); diff --git a/src/components/language/LanguageSelector.js b/src/components/language/LanguageSelector.js index 0a59da16..a9cc5159 100644 --- a/src/components/language/LanguageSelector.js +++ b/src/components/language/LanguageSelector.js @@ -11,8 +11,7 @@ import LanguageSelectionModal from "./LanguageSelectionModal"; const DEFAULT = { name: "--", code: "---" }; function LanguageSelector() { - const campaign = useSelector((state) => state?.campaign); - const languages = campaign?.languages || []; + const languages = useSelector((state) => state?.usersListOfLanguages); const activeLanguage = useSelector((state) => state?.activeLanguage); const { modals } = getStaticText(); const staticT = modals?.languageSelectionModal || {}; @@ -25,7 +24,6 @@ function LanguageSelector() { dispatch(toggleUniversalModal(data)); }; - const getLangLetters = (code) => code?.split("-")[0] || ""; const setActiveLanguage = (lang, reload = true) => { setActiveLanguageInStorage(lang); @@ -35,23 +33,15 @@ function LanguageSelector() { return (
{ - if (noLanguages) return; - openModal({ - noFooter: true, - show: true, - title: staticT?.title?.text || "Choose a Language", - component: () => , - }); - }} + className="touchable-opacity lang-s-p-override" style={{ position: "absolute", top: 0, right: 50, display: "flex", - flexDirection: "row", + flexDirection: "column", alignItems: "center", + justifyContent: "center", fontSize: 18, height: "100%", fontWeight: "bold", @@ -59,18 +49,32 @@ function LanguageSelector() { textTransform: "uppercase", }} > - {/* */} - flag - {getLangLetters(activeLanguage)} - {!noLanguages && ( - <> - - - )} +
{ + if (noLanguages) return; + openModal({ + noFooter: true, + show: true, + title: staticT?.title?.text || "Choose a Language", + component: () => , + }); + }} + className="lang-s-ribbon" + style={{ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "center" }} + > + {/* */} + flag + {getLangLetters(activeLanguage)} + {!noLanguages && ( + <> + + + )} +
); return ( diff --git a/src/components/pieces/BlanketNotification.js b/src/components/pieces/BlanketNotification.js new file mode 100644 index 00000000..de90af41 --- /dev/null +++ b/src/components/pieces/BlanketNotification.js @@ -0,0 +1,58 @@ +import React, { useEffect } from "react"; + +function BlanketNotification({ render, message, title, durationToReload, reloadText }) { + const Canvas = ({ children }) => ( +
+ {children} +
+ ); + + useEffect(() => { + if (durationToReload) { + const interval = setInterval(() => { + durationToReload--; + if (durationToReload === 0) window.location.reload(); + }, durationToReload * 1000); + return () => clearInterval(interval); + } + }, [durationToReload]); + + if (render) return {render()}; + return ( + +
+ {title &&
{title}
} +

{message || "..."}

+ {durationToReload && ( + window.location.reload()} + > + {reloadText || "Or click to reload now!"} + + )} +
+
+ ); +} + +export default BlanketNotification; diff --git a/src/config/config.json b/src/config/config.json index 8b1ae804..850a9bca 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,3 +1,3 @@ { - "BUILD_VERSION": "1.1.12" + "BUILD_VERSION": "1.1.19" } diff --git a/src/redux/actions/actions.js b/src/redux/actions/actions.js index 5ae533f2..beb507f1 100644 --- a/src/redux/actions/actions.js +++ b/src/redux/actions/actions.js @@ -28,6 +28,8 @@ import { ADMIN_UPDATE_OFFERED_LANGUAGES, DEFAULT_ENGLISH_CODE, PREFERRED_LANGUAGE_STORAGE_KEY, + USER_NOTIFICATION, + SET_USERS_LIST_OF_LANGUAGES, } from "../redux-action-types"; import { signOut } from "firebase/auth"; import store from "./../store"; @@ -55,6 +57,12 @@ export const setActiveLanguageInStorage = (isoCode) => { localStorage.setItem(PREFERRED_LANGUAGE_STORAGE_KEY, isoCode); }; +export const setUsersListOfLanguages = (data) => { + return { type: SET_USERS_LIST_OF_LANGUAGES, payload: data }; +}; +export const setNotificationBlanket = (data) => { + return { type: USER_NOTIFICATION, payload: data }; +}; export const updateOfferedLanguageAction = (data) => { return { type: ADMIN_UPDATE_OFFERED_LANGUAGES, payload: data }; }; @@ -159,6 +167,30 @@ export const updateUserAction = (payload, cb) => { }; }; +const fetchStartupContent = (params) => { + const { campaignId, userContent, dispatch, cb, languageCode } = params || {}; + const languageParams = { __user_language: languageCode }; + Promise.all([ + apiCall(CAMPAIGN_INFORMATION_URL, { id: campaignId, ...userContent, ...languageParams }), + apiCall(CAMPAIGN_VIEW_URL, { + campaign_id: campaignId, + url: window.location.href, + ...languageParams, + }), + ]) + .then((response) => { + const [campaignInformation] = response; + const data = campaignInformation.data; + dispatch(loadCampaignInformation(data)); + if (data) { + dispatch(setNavigationMenuAction(data?.navigation || [])); + dispatch(setTestimonialsActions(data?.my_testimonials || [])); + cb && cb(data, campaignInformation?.success); + } + }) + .catch((e) => console.log("ERROR_IN_INNIT:", e?.toString())); +}; + export const appInnitAction = (campaignId, cb) => { let savedUser = localStorage.getItem(USER_STORAGE_KEY); savedUser = JSON.parse(savedUser); @@ -168,29 +200,35 @@ export const appInnitAction = (campaignId, cb) => { dispatch(loadUserObjAction(savedUser)); // use saved user to run a request to bring in the most recent changes to the user const userContent = user?.email ? { email: user.email } : {}; - Promise.all([ - apiCall(CAMPAIGN_INFORMATION_URL, { id: campaignId, ...userContent }), - apiCall(CAMPAIGN_VIEW_URL, { - campaign_id: campaignId, - url: window.location.href, - }), - ]) - .then((response) => { - const [campaignInformation, campaignViewResponse] = response; - const data = campaignInformation.data; - // console.log("INSIDE INNIT", data, campaignId); - dispatch(loadCampaignInformation(data)); - if (data) { - let activeLang = localStorage.getItem(PREFERRED_LANGUAGE_STORAGE_KEY) || "en-US"; - const found = findInLanguageList(activeLang, data?.languages); - if (!found) activeLang = DEFAULT_ENGLISH_CODE; - dispatch(loadActiveLanguageAction(activeLang)); - dispatch(setNavigationMenuAction(data?.navigation || [])); - dispatch(setTestimonialsActions(data?.my_testimonials || [])); - cb && cb(data, campaignInformation?.success); - } - }) - .catch((e) => console.log("ERROR_IN_INNIT:", e?.toString())); + apiCall("/campaigns.supported_languages.list", { campaign_id: campaignId }).then((response) => { + const languages = response?.data || []; + dispatch(setUsersListOfLanguages(languages?.filter((l) => l?.is_active))); + const prefLang = localStorage.getItem(PREFERRED_LANGUAGE_STORAGE_KEY); + const startUpObj = { campaignId, userContent, dispatch, cb, languageCode: DEFAULT_ENGLISH_CODE }; + if (!prefLang) return fetchStartupContent(startUpObj); + const found = findInLanguageList(prefLang, languages); + const notActive = !found?.is_active; + const languageCode = found ? found?.code : DEFAULT_ENGLISH_CODE; + dispatch(loadActiveLanguageAction(languageCode)); + + if (notActive) { + setActiveLanguageInStorage(DEFAULT_ENGLISH_CODE); + return dispatch( + setNotificationBlanket({ + title: "Please Note (Unsupported Language)", + durationToReload: 3, + message: ( + + Your preferred language {found?.name} is no longer supported by this campaign. We have set your + language to English. In 3 seconds, this page will reload with all features in English... + + ), + }), + ); + } + + fetchStartupContent({ ...startUpObj, languageCode }); + }); }; }; diff --git a/src/redux/reducers/reducers.js b/src/redux/reducers/reducers.js index 0280c306..513eeaaa 100644 --- a/src/redux/reducers/reducers.js +++ b/src/redux/reducers/reducers.js @@ -25,9 +25,12 @@ import { SET_STATIC_TEXT_HEAP, SET_TESTIMONIALS, SET_USER_OBJ, + SET_USERS_LIST_OF_LANGUAGES, TOGGLE_UNIVERSAL_MODAL, UPDATE_EVENT_OBJ, UPDATE_TESTIMONIALS_OBJ, + USER_NOTIFICATION, + } from "../redux-action-types"; // import defaultStaticText from "./../../utils/default-static-text.json"; @@ -53,6 +56,18 @@ const DEFAULT_STATIC_TEXT = { "it-IT": ITALIAN, }; +export const reducerForSettingUserLanguageList = (state = [], action = {}) => { + if (action.type === SET_USERS_LIST_OF_LANGUAGES) { + return action.payload; + } + return state; +}; +export const reducerForSettingNotificationBlanket = (state = null, action = {}) => { + if (action.type === USER_NOTIFICATION) { + return action.payload; + } + return state; +}; export const doNothingReducer = (state = [], action = {}) => { if (action.type === DO_NOTHING) { return action.payload; diff --git a/src/redux/reducers/state.js b/src/redux/reducers/state.js index ac025d37..e8c15066 100644 --- a/src/redux/reducers/state.js +++ b/src/redux/reducers/state.js @@ -23,6 +23,10 @@ import { universalModalReducer, userObjectReducer, reducerForCampaignOfferedLanguages, + reducerForSettingUserNotification, + reducerForSettingNotificationBlanket, + reducerForSettingUserLanguageList, + } from "./reducers"; import { loadCampaignInformation } from "../actions/actions"; @@ -49,4 +53,7 @@ export default combineReducers({ staticTextHeap: staticTextHeapReducer, activeLanguage: setActiveLanguageReducer, campaignOfferedLanguages: reducerForCampaignOfferedLanguages, + blanketNotification: reducerForSettingNotificationBlanket, + usersListOfLanguages: reducerForSettingUserLanguageList, + }); diff --git a/src/redux/redux-action-types.js b/src/redux/redux-action-types.js index 29b2d27f..4b77abd8 100644 --- a/src/redux/redux-action-types.js +++ b/src/redux/redux-action-types.js @@ -23,3 +23,6 @@ export const SET_ACTIVE_LANGUAGE = "SET_ACTIVE_LANGUAGE"; export const ADMIN_UPDATE_OFFERED_LANGUAGES = "ADMIN_UPDATE_OFFERED_LANGUAGES"; export const DEFAULT_ENGLISH_CODE = "en-US"; export const PREFERRED_LANGUAGE_STORAGE_KEY = "PREFERRED_LANGUAGE"; +export const USER_NOTIFICATION = "USER_NOTIFICATION"; +export const SET_USERS_LIST_OF_LANGUAGES = "SET_USERS_LIST_OF_LANGUAGES"; + diff --git a/src/routes/AppRouter.js b/src/routes/AppRouter.js index f39f9398..2022d2ba 100644 --- a/src/routes/AppRouter.js +++ b/src/routes/AppRouter.js @@ -10,7 +10,7 @@ import { toggleUniversalModal, getStaticText, } from "../redux/actions/actions"; -import { connect } from "react-redux"; +import { connect, useSelector } from "react-redux"; import CustomModal from "../components/modal/CustomModal"; import TechnologyFullViewPage from "../user-portal/pages/technology/TechnologyFullViewPage"; import OneEvent from "../user-portal/pages/events/OneEvent"; @@ -28,6 +28,7 @@ import Dummy from "../admin-portal/pages/auth/Dummy"; import { setPageTitle } from "../utils/utils"; import JoinUsForm from "../user-portal/pages/forms/JoinUsForm"; import AddOfferedLanguages from "../admin-portal/internationalization/AddOfferedLanguages"; +import BlanketNotification from "../components/pieces/BlanketNotification"; export const NavigateWithParams = ({ to, ...props }) => { const params = useParams(); @@ -163,7 +164,7 @@ function AppRouter({ // navigation, }) { const { modals } = getStaticText(); - const params = useParams(); + const blanketNotification = useSelector((state) => state.blanketNotification); useEffect(() => { let pageName = "ME Campaign"; @@ -192,6 +193,8 @@ function AppRouter({ cb && cb(); }; + if (blanketNotification) return ; + return ( <> toggleModal({ show: false, component: <> })} {...modalOptions} /> diff --git a/src/user-portal/pages/commenting/CommentComponentForModal.js b/src/user-portal/pages/commenting/CommentComponentForModal.js index 314fda25..7f2a7fb3 100644 --- a/src/user-portal/pages/commenting/CommentComponentForModal.js +++ b/src/user-portal/pages/commenting/CommentComponentForModal.js @@ -5,6 +5,7 @@ import { relativeTimeAgo } from "../../../utils/utils"; import Notification from "../../../components/pieces/Notification"; import { apiCall } from "../../../api/messenger"; import CommentDeleteConfirmation from "../technology/CommentDeleteConfirmation"; +import { TRANSLATION_HELPERS_LINK } from "../footer/Footer"; function CommentComponentForModal({ comments, @@ -101,7 +102,7 @@ function CommentComponentForModal({ overflowY: "scroll", minHeight: 250, maxHeight: 500, - paddingBottom: 130, + paddingBottom: 150, }} ref={comBox} > @@ -132,7 +133,8 @@ function CommentComponentForModal({ }} > - {user?.full_name || "..."} {isForCurrentUser ? " (Yours)" : ""}{" "} + {user?.full_name || "..."}{" "} + {isForCurrentUser ? (staticT?.yours?.text ? `(${staticT?.yours?.text})` : "" || " (Yours)") : ""}{" "} {" "} {community && " from "} {community} @@ -146,6 +148,7 @@ function CommentComponentForModal({ }} > onDelete && onDelete(com, (rem) => setCommentItems([...(rem || [])].reverse()))} /> @@ -205,6 +208,9 @@ function CommentComponentForModal({ {staticT?.button?.text || " Comment"} + + Would you like to help translate this site? + diff --git a/src/user-portal/pages/footer/Footer.js b/src/user-portal/pages/footer/Footer.js index 50a41834..4bda5904 100644 --- a/src/user-portal/pages/footer/Footer.js +++ b/src/user-portal/pages/footer/Footer.js @@ -11,6 +11,8 @@ import CONFIG from "../../../config/config.json"; import { getStaticText } from "../../../redux/actions/actions"; const EXCLUDED_FOOTER_MENU_KEYS = ["deals", "vendors"]; +export const TRANSLATION_HELPERS_LINK = + "https://docs.google.com/forms/d/1ay2paNG3x_gZL8hhzmghIYSEuHDA_I4MRZJf7cEt_00/viewform?edit_requested=true"; function Footer({ toggleModal, campaign, authUser, staticT }) { const { footer } = getStaticText(); const navigator = useNavigate(); @@ -115,6 +117,7 @@ function Footer({ toggleModal, campaign, authUser, staticT }) { borderWidth: 0, padding: "8px 30px", marginTop: 15, + marginBottom: 15, borderRadius: 5, fontWeight: "bold", width: "100%", @@ -140,7 +143,12 @@ function Footer({ toggleModal, campaign, authUser, staticT }) {

)} + + + Would you like to help translate this site? + + Build Version {CONFIG.BUILD_VERSION} @@ -222,6 +230,9 @@ const MobileFooter = ({ signUpForNewsletter, renderMenus, customization, staticT > {staticT?.subscribe_button?.text || " Subscribe"} + + Would you like to help translate this site? + - {OTHER} + {staticT?.other?.text || OTHER} diff --git a/src/user-portal/pages/forms/JoinUsForm.js b/src/user-portal/pages/forms/JoinUsForm.js index 53b0624a..064135f5 100644 --- a/src/user-portal/pages/forms/JoinUsForm.js +++ b/src/user-portal/pages/forms/JoinUsForm.js @@ -27,7 +27,7 @@ function JoinUsForm({ const [email, setEmail] = useState(""); const [error, setError] = useState(""); const [loading, setLoading] = useState(false); - const { modals } = getStaticText(); + const { modals, toasts } = getStaticText(); const staticT = modals?.join || {}; useState(() => { @@ -49,18 +49,21 @@ function JoinUsForm({ const makeNotification = (message, good = false) => { setError({ message, good }); }; - const joinUs = () => { if (onConfirm) return onConfirm({ data: form, close }); // if (authUser) return alert("You've already followed. Thank you very much!"); const emailIsValid = validateEmail(email); - if (!emailIsValid) return makeNotification("Please provide a valid email address..."); + if (!emailIsValid) + return makeNotification(toasts?.join?.noEmail?.text || "Please provide a valid email address..."); const { comId, zipcode, valueForOther } = form || {}; var otherContent = {}; - if (!comId) return makeNotification("Please select a community..."); + if (!comId) return makeNotification(toasts?.join?.noCommunity?.text || "Please select a community..."); if (comId === OTHER) { otherContent = { community_name: valueForOther, zipcode, is_other: true }; - if (!zipcode || !valueForOther) return makeNotification("Please provide the zipcode & community name..."); + if (!zipcode || !valueForOther) + return makeNotification( + toasts?.join?.noZipcodeAndOther?.text || "Please provide the zipcode & community name...", + ); } setLoading(true); @@ -71,7 +74,7 @@ function JoinUsForm({ ...otherContent, }; payload = processPayload ? processPayload(payload) : payload; - makeNotification("Well done, thank you for joining us!", true); + makeNotification(toasts?.join?.joined?.text || "Well done, thank you for joining us!", true); apiCall(apiURL || "/campaigns.follow", payload).then((response) => { setLoading(false); if (!response?.success) { diff --git a/src/user-portal/pages/landing-page/CampaignNotLive.js b/src/user-portal/pages/landing-page/CampaignNotLive.js index b5fb6a3d..3995b232 100644 --- a/src/user-portal/pages/landing-page/CampaignNotLive.js +++ b/src/user-portal/pages/landing-page/CampaignNotLive.js @@ -5,9 +5,7 @@ import { getStaticText } from "../../../redux/actions/actions"; function CampaignNotLive({ campaign }) { const [show, setShow] = useState(true); - const { inPreview: staticT } = getStaticText(); - console.log(""); if (campaign?.is_published || !show) return <>; return ( @@ -19,14 +17,7 @@ function CampaignNotLive({ campaign }) {

- +
diff --git a/src/user-portal/pages/landing-page/DoMore.js b/src/user-portal/pages/landing-page/DoMore.js index 38d884e2..4506483d 100644 --- a/src/user-portal/pages/landing-page/DoMore.js +++ b/src/user-portal/pages/landing-page/DoMore.js @@ -4,6 +4,7 @@ import { Col, Container, Row } from "react-bootstrap"; import SectionTitle from "../../../components/pieces/SectionTitle"; import { useSelector } from "react-redux"; import OptimumWrapper from "../wrappers/OptimumWrapper"; +import {BASE_URL, getCommunityPortalBaseURL} from "../../../utils/utils"; const DoMore = (props) => { const { optimum } = props; @@ -23,7 +24,6 @@ function DoMoreComponent({ staticT }) { const { communities, communities_section } = campaign || {}; const { title, description } = communities_section || {}; - const COMMUNITY_PORTAL_URL = "https://communities.massenergize.org/"; return (
{/* */} @@ -79,7 +79,7 @@ function DoMoreComponent({ staticT }) {
  • { - window.open(`${COMMUNITY_PORTAL_URL}${community?.subdomain}`); + window.open(`${BASE_URL}${community?.subdomain}`); }} className="touchable-opacity body-font" style={{ diff --git a/src/user-portal/pages/landing-page/LandingPage.js b/src/user-portal/pages/landing-page/LandingPage.js index 9cebb9f0..b46be10a 100644 --- a/src/user-portal/pages/landing-page/LandingPage.js +++ b/src/user-portal/pages/landing-page/LandingPage.js @@ -30,6 +30,7 @@ import CoachesSectionWithFilters from "../coaches/CoachesSectionWithFilters"; import ShareBox from "../sharing/ShareBox"; import Hero from "../banner/Hero"; import { useMediaQuery } from "react-responsive"; +import BlanketNotification from "../../../components/pieces/BlanketNotification"; function LandingPage({ toggleModal, @@ -44,8 +45,9 @@ function LandingPage({ }) { const [mounted, setMounted] = useState(false); const isMobile = useMediaQuery({ maxWidth: MOBILE_WIDTH }); - const { modals, loader, pages, share: shareStaticT, inPreview: previewStaticT } = getStaticText(); + const { loader, pages, share: shareStaticT, inPreview: previewStaticT } = getStaticText(); const homepageStaticT = pages?.homepage || {}; + const blanketNotification = useSelector((state) => state.blanketNotification); const coachesRef = useRef(); const eventsRef = useRef(); @@ -113,8 +115,10 @@ function LandingPage({ }; const tellUsWhereYouAreFrom = (justLoadedCampaign) => { + if (blanketNotification) return; const user = authUser || localStorage.getItem(USER_STORAGE_KEY); const firstTime = !user || user === "null"; + const { modals } = getStaticText(); if (!firstTime) return; toggleModal({ @@ -211,7 +215,10 @@ function LandingPage({ item.key !== "other"); + items = [...rem, { key: "other", text: staticT?.other?.text || "Other", icon: "", alias: "" }]; + const { user } = authUser || {}; const generateLink = (obj) => { const path = new URL(window.location.href); diff --git a/src/user-portal/pages/technology/CommentDeleteConfirmation.js b/src/user-portal/pages/technology/CommentDeleteConfirmation.js index 9fc42adc..4a51c65e 100644 --- a/src/user-portal/pages/technology/CommentDeleteConfirmation.js +++ b/src/user-portal/pages/technology/CommentDeleteConfirmation.js @@ -1,6 +1,6 @@ import React, { useEffect, useState } from "react"; -function CommentDeleteConfirmation ({ onDelete, show }) { +function CommentDeleteConfirmation({ onDelete, show, staticT }) { const [isDeleting, setIsDeleting] = useState(false); if (!show) return <>; @@ -13,20 +13,16 @@ function CommentDeleteConfirmation ({ onDelete, show }) { if (isDeleting) return ( - Are you sure? - onDelete && onDelete()} - className="touchable-opacity" - style={{ ...common }} - > - YES + {staticT?.deletion?.title?.text || "Are you sure?"} + onDelete && onDelete()} className="touchable-opacity" style={{ ...common }}> + {staticT?.deletion?.buttons?.yes?.text || "YES"} setIsDeleting(false)} style={{ ...common, color: "#a52424" }} > - NO + {staticT?.deletion?.buttons?.no?.text || "NO"} ); @@ -42,7 +38,7 @@ function CommentDeleteConfirmation ({ onDelete, show }) { fontWeight: "bold", }} > - Delete{" "} + {staticT?.deletion?.delete?.text || "Delete"} ); } diff --git a/src/user-portal/pages/technology/TechnologyFullViewPage.js b/src/user-portal/pages/technology/TechnologyFullViewPage.js index 8bc86ded..7411f8de 100644 --- a/src/user-portal/pages/technology/TechnologyFullViewPage.js +++ b/src/user-portal/pages/technology/TechnologyFullViewPage.js @@ -67,6 +67,7 @@ function TechnologyFullViewPage({ const { pages } = getStaticText(); const one_technology_page = pages?.one_technology_page || {}; const { sections, loader, share: shareStaticT } = one_technology_page; + const modalStaticT = sections?.comments?.modal || {}; // const [idsToRefMap, setidsToRefMap] = useState({}); const coachesRef = useRef(); const vendorsRef = useRef(); @@ -205,15 +206,16 @@ function TechnologyFullViewPage({ }; // NB: Dont worry, I will merge the two trigger fxns into one, when there is more time - const triggerRegistration = () => { + const triggerRegistration = (options) => { + const { staticT } = options || {}; toggleModal({ show: true, - title: `Before you continue, we would like to know you`, + title: staticT?.preComment?.title?.text || `Before you continue, we would like to know you`, iconName: "fa-comment", component: ({ close }) => ( { close && close(); triggerCommentBox(user); @@ -225,9 +227,9 @@ function TechnologyFullViewPage({ }); }; - const triggerCommentBox = (userObject) => { + const triggerCommentBox = (userObject, options) => { const { user } = userObject || {}; - if (!user) return triggerRegistration(); + if (!user) return triggerRegistration(options); toggleModal({ show: true, title: sections?.comments?.title?.text || "Read comments or add yours", @@ -316,7 +318,7 @@ function TechnologyFullViewPage({ {image?.url && {"event"}} triggerCommentBox(authUser)} + openCommentBox={() => triggerCommentBox(authUser, { staticT: modalStaticT })} liked={technology?.has_liked} likes={likes} like={() => like(authUser?.user)} @@ -471,7 +473,12 @@ function TechnologyFullViewPage({ color: !isForCurrentUser ? "var(--app-main-color)" : "var(--app-accent-3)", }} > - {user?.full_name || "..."} {isForCurrentUser ? " (Yours)" : ""} + {user?.full_name || "..."}{" "} + {isForCurrentUser + ? modalStaticT?.yours?.text + ? `(${modalStaticT?.yours?.text})` + : "" || " (Yours)" + : ""} {message.substr(0, COMMENT_LENGTH)} @@ -500,7 +507,11 @@ function TechnologyFullViewPage({ flexDirection: "row", }} > - deleteComment(com)} /> + deleteComment(com)} + /> triggerCommentBox(authUser)} + onClick={() => triggerCommentBox(authUser, { staticT: modalStaticT })} >

    diff --git a/src/user-portal/pages/testimonials/TestimonialBox.js b/src/user-portal/pages/testimonials/TestimonialBox.js index 67d66193..ad5eb9b1 100644 --- a/src/user-portal/pages/testimonials/TestimonialBox.js +++ b/src/user-portal/pages/testimonials/TestimonialBox.js @@ -55,6 +55,7 @@ function TestimonialBox({ title, user, image, body, campaign_technology, campaig height: 50, objectFit: "cover", borderRadius: 5, + marginRight: 12, // marginTop: 7, }} src={image?.url} diff --git a/src/utils/internationalization/json-statics.js b/src/utils/internationalization/json-statics.js index a555bd7c..df8de15d 100644 --- a/src/utils/internationalization/json-statics.js +++ b/src/utils/internationalization/json-statics.js @@ -1,6 +1,15 @@ // All items here are dummies used to test the internationalization feature +// Use this to translate: https://translate.google.com/ export const ENGLISH = { + toasts: { + join: { + noEmail: { text: "Please provide a valid email address..." }, + noCommunity: { text: "Please select a community..." }, + noZipcodeAndOther: { text: "Please provide the zipcode & community name..." }, + joined: { text: "Well done, thank you for joining us!" }, + }, + }, inPreview: { button: { text: "Preview Mode" }, notice: { @@ -40,6 +49,7 @@ export const ENGLISH = { }, pages: { homepage: { + about: { text: "About " }, share: { button: { copied: { text: "Copied!" }, copy: { text: "Copy Link" } }, title: { text: "Share Campaign" }, @@ -91,6 +101,7 @@ export const ENGLISH = { }, one_technology_page: { share: { + other: { text: "Other" }, button: { copied: { text: "Copied!" }, copy: { text: "Copy Link" } }, title: { text: "Share" }, hint: { text: "You can copy the link and share it" }, @@ -115,6 +126,17 @@ export const ENGLISH = { see_more: { text: "See More Comments" }, call_to_add: { text: "Add a comment" }, modal: { + preComment: { + title: { text: "Before you continue, we would like to know you" }, + buttons: { continue: { text: "Continue" }, cancel: { text: "Cancel" } }, + email: { text: "Email" }, + }, + deletion: { + delete: { text: "Delete" }, + title: { text: "Are you sure?" }, + buttons: { yes: { text: "Yes" }, no: { text: "No" } }, + }, + yours: { text: "Yours" }, title: "Read comments or add yours", relative_data: { text: "50 days ago" }, name: { text: "Your name" }, @@ -212,6 +234,7 @@ export const ENGLISH = { buttons: { continue: { text: "Continue" }, cancel: { text: "Cancel" } }, }, community_selection: { + other: { text: "Other" }, selection_label: { text: "What community do you live in?" }, text_after_selection: { text: "We will direct you to the right resources based on where you are from -" }, form: { @@ -240,414 +263,450 @@ export const ENGLISH = { }, }; -export const GERMAN = { +export const SPANISH = { + toasts: { + join: { + noEmail: { text: "Por favor, proporcione una dirección de correo electrónico válida..." }, + noCommunity: { text: "Por favor, seleccione una comunidad..." }, + noZipcodeAndOther: { text: "Por favor, proporcione el código postal y el nombre de la comunidad..." }, + joined: { text: "¡Bien hecho, gracias por unirse a nosotros!" }, + }, + }, inPreview: { - button: { text: "Vorschau-Modus" }, + button: { text: "Modo de Vista Previa" }, notice: { - text: "ist noch nicht veröffentlicht. Die Administratoren arbeiten noch daran. Bitte kommen Sie später zurück, wenn es fertig ist...", + text: "aún no está publicado. Los administradores siguen trabajando en ello. Por favor, vuelva más tarde cuando esté completo...", }, }, forms: { testimonials: { - title: { - text: "Titel*", - placeholder: "Geben Sie den Titel des Testimonials ein...", - label: "Erzählen Sie uns Ihre Geschichte!", - }, + title: { text: "Título*", placeholder: "Ingrese el título del testimonio...", label: "¡Cuéntenos su historia!" }, image: { - label: "Fügen Sie ein Bild in Ihr Testimonial ein", - text: "Datei wählen", - placeholder: "Keine Datei ausgewählt", + label: "Incluya una imagen en su testimonio", + text: "Elegir archivo", + placeholder: "Ningún archivo seleccionado", }, - community: { label: "Wählen Sie Ihre Gemeinschaft", placeholder: "---Wählen Sie Ihre Gemeinschaft---" }, + community: { label: "Seleccione su comunidad", placeholder: "---Seleccione su comunidad---" }, technology: { - label: "Unter welcher Technologie fällt dieses Testimonial?", - placeholder: "---Wählen Sie die Technologie---", + label: "¿Bajo qué tecnología está este testimonio?", + placeholder: "---Seleccione la tecnología---", }, - description: { placeholder: "Beginnen Sie hier, Ihre Geschichte zu erzählen..." }, - buttons: { cancel: { text: "Abbrechen" }, submit: { text: "Einreichen" } }, + description: { placeholder: "Comience a contar su historia aquí..." }, + buttons: { cancel: { text: "Cancelar" }, submit: { text: "Enviar" } }, }, }, loader: { - text: "Kampagnendetails abrufen...", + text: "Obteniendo detalles de la campaña...", }, - share: { text: "Teilen" }, + share: { text: "Compartir" }, footer: { - modal: { title: { prefix: "Folgen" }, cancel: { text: "Abbrechen" }, ok: { text: "Abonnieren" } }, + modal: { title: { prefix: "Seguir" }, cancel: { text: "Cancelar" }, ok: { text: "Suscribirse" } }, news_letter: { - subscribe_button: { text: "Newsletter abonnieren" }, - subscribe_message: { text: "Sie sind bereits abonniert mit " }, + subscribe_button: { text: "Suscribirse a nuestro Boletín" }, + subscribe_message: { text: "Ya estás suscrito con " }, }, - quick_links: { text: "Schnellzugriffe" }, + quick_links: { text: "Enlaces rápidos" }, }, navbar: { - home: { text: "Startseite" }, - tech: { text: "Technologien" }, - coaches: { text: "Trainer" }, - events: { text: "Veranstaltungen" }, - vendors: { text: "Anbieter" }, - Deals: { text: "Angebote" }, + home: { text: "Inicio" }, + tech: { text: "Tecnologías" }, + coaches: { text: "Entrenadores" }, + events: { text: "Eventos" }, + vendors: { text: "Vendedores" }, + Deals: { text: "Ofertas" }, }, pages: { homepage: { share: { - button: { copied: { text: "Kopiert!" }, copy: { text: "Link kopieren" } }, - title: { text: "Kampagne teilen" }, - hint: { text: "Sie können den Link kopieren und teilen" }, - instruction: { text: "Bitte wählen Sie eine Plattform aus, auf der Sie diese Technologie teilen möchten" }, + button: { copied: { text: "¡Copiado!" }, copy: { text: "Copiar enlace" } }, + title: { text: "Compartir campaña" }, + hint: { text: "Puedes copiar el enlace y compartirlo" }, + instruction: { text: "Por favor, selecciona una plataforma en la que te gustaría compartir esta tecnología" }, }, sections: { key_contact: { - text: "Hauptkontakt", + text: "Contacto principal", }, about_box: { - button: "Mehr erfahren", + button: "Saber más", }, getting_started_section: { - quote: { text: "Zitat" }, - coach: { text: "Trainer" }, - learn_more: { text: "Mehr erfahren" }, + quote: { text: "Cita" }, + coach: { text: "Entrenador" }, + learn_more: { text: "Saber más" }, communities: { - text: "Gemeinschaften", - title: "Gemeinschaften", - description: "Verbinden Sie sich mit Ihrer Gemeinschaft und sehen Sie sich weitere Aktionen an", + text: "Comunidades", + title: "Comunidades", + description: "Conéctate con tu comunidad y descubre otras acciones", }, }, testimonials_section: { scrollable: { - text: "Scrollen Sie von links nach rechts, um weitere Testimonials zu sehen, oder verwenden Sie die Pfeiltasten (oben rechts), um zu scrollen", + text: "Desplázate de izquierda a derecha para ver más testimonios, o usa los botones de flecha (arriba a la derecha) para desplazarte", }, - title: { text: "Testimonials" }, - call_to_add_testimonial: { text: "Fügen Sie hier Ihr Testimonial hinzu" }, - call_to_hide_testimonial: { text: "Testimonial-Formular ausblenden" }, - call_to_filter: { text: "Testimonials filtern nach" }, - full_view: { text: "Vollansicht" }, + title: { text: "Testimonios" }, + call_to_add_testimonial: { text: "Agrega tu testimonio aquí" }, + call_to_hide_testimonial: { text: "Ocultar formulario de testimonio" }, + call_to_filter: { text: "Filtrar testimonios por" }, + full_view: { text: "Vista completa" }, }, events_section: { - title: { text: "Veranstaltungen" }, + title: { text: "Eventos" }, scrollable: { - text: "Scrollen Sie von links nach rechts, um weitere Veranstaltungen zu sehen, oder verwenden Sie die Pfeiltasten (oben rechts), um zu scrollen", + text: "Desplázate de izquierda a derecha para ver más eventos, o usa los botones de flecha (arriba a la derecha) para desplazarte", }, - call_to_filter: { text: "Testimonials filtern nach" }, - card: { online: { text: "Online" }, both: { text: "Beide" }, in_person: { text: "Persönlich" } }, + call_to_filter: { text: "Filtrar testimonios por" }, + card: { online: { text: "En línea" }, both: { text: "Ambos" }, in_person: { text: "En persona" } }, }, coaches_section: { - call_to_filter: { text: "Testimonials filtern nach" }, - get_help: { text: "Hilfe erhalten" }, - help_modal: { title: "Hilfe erhalten" }, + call_to_filter: { text: "Filtrar testimonios por" }, + get_help: { text: "Obtener ayuda" }, + help_modal: { title: "Obtener ayuda" }, }, }, }, one_technology_page: { share: { - button: { copied: { text: "Kopiert!" }, copy: { text: "Link kopieren" } }, - title: { text: "Teilen" }, - hint: { text: "Sie können den Link kopieren und teilen" }, - instruction: { text: "Bitte wählen Sie eine Plattform aus, auf der Sie diese Technologie teilen möchten" }, + other: { text: "Otro" }, + button: { copied: { text: "¡Copiado!" }, copy: { text: "Copiar enlace" } }, + title: { text: "Compartir" }, + hint: { text: "Puedes copiar el enlace y compartirlo" }, + instruction: { text: "Por favor, selecciona una plataforma en la que te gustaría compartir esta tecnología" }, }, loader: { - text: "Technologiedetails abrufen...", + text: "Obteniendo detalles de la tecnología...", }, sections: { - see_more: { text: "Mehr sehen..." }, - see_less: { text: "Weniger sehen..." }, + see_more: { text: "Ver más..." }, + see_less: { text: "Ver menos..." }, get_updates: { - button: { text: "Updates erhalten" }, - description: { text: "Updates erhalten über" }, - title: { text: "Updates erhalten über" }, - confirm_button: { text: "Updates erhalten" }, - cancel_button: { text: "Abbrechen" }, + button: { text: "Obtener actualizaciones" }, + description: { text: "Obtener actualizaciones sobre" }, + title: { text: "Obtener actualizaciones sobre" }, + confirm_button: { text: "Obtener actualizaciones" }, + cancel_button: { text: "Cancelar" }, }, comments: { - title: { text: "Kommentare" }, - see_more_trunc: { text: "Mehr sehen" }, - see_more: { text: "Mehr Kommentare sehen" }, - call_to_add: { text: "Einen Kommentar hinzufügen" }, + title: { text: "Comentarios" }, + see_more_trunc: { text: "Ver más" }, + see_more: { text: "Ver más comentarios" }, + call_to_add: { text: "Agregar un comentario" }, modal: { - title: "Lesen Sie Kommentare oder fügen Sie Ihren hinzu", - relative_data: { text: "vor 50 Tagen" }, - name: { text: "Ihr Name" }, - name_placeholder: { text: "Wer macht diesen Kommentar?" }, - comment_placeholder: { text: "Kommentar hier eingeben" }, - button: { text: "Kommentieren" }, - no_comments: { text: "Noch keine Kommentare, fügen Sie Ihren hinzu!" }, + preComment: { + title: { text: "Antes de continuar, nos gustaría saber de usted" }, + buttons: { continue: { text: "Continuar" }, cancel: { text: "Cancelar" } }, + email: { text: "Email" }, + }, + deletion: { + delete: { text: "Eliminar" }, + title: { text: "¿Está seguro?" }, + buttons: { yes: { text: "Sí" }, no: { text: "No" } }, + }, + yours: { text: "Tuyo" }, + title: "Leer comentarios o agregar el tuyo", + relative_data: { text: "hace 50 días" }, + name: { text: "Tu nombre" }, + name_placeholder: { text: "¿Quién está haciendo este comentario?" }, + comment_placeholder: { text: "Escribe tu comentario aquí" }, + button: { text: "Comentar" }, + no_comments: { text: "Aún no hay comentarios, ¡agrega el tuyo!" }, }, }, interactions: { - like: { text: "Gefällt mir", plural: "Gefällt mir" }, - comment: { text: "Kommentar", plural: "Kommentare" }, - view: { text: "Ansicht", plural: "Ansichten" }, - share: { text: "Teilen", plural: "Geteilt" }, + like: { text: "Me gusta", plural: "Me gusta" }, + comment: { text: "Comentario", plural: "Comentarios" }, + view: { text: "Vista", plural: "Vistas" }, + share: { text: "Compartir", plural: "Compartidos" }, }, testimonials_section: { - title: { text: "Testimonials" }, - call_to_add_testimonial: { text: "Fügen Sie hier Ihr Testimonial hinzu" }, - full_view: { text: "Vollansicht" }, + title: { text: "Testimonios" }, + call_to_add_testimonial: { text: "Agrega tu testimonio aquí" }, + full_view: { text: "Vista completa" }, }, coaches_section: { - button: { text: "Hilfe erhalten" }, + button: { text: "Obtener ayuda" }, }, do_more: { title: { - text: "Teilnehmende Gemeinschaften", + text: "Comunidades Participantes", }, }, events_section: { - title: { text: "Veranstaltungen" }, + title: { text: "Eventos" }, card: { - online: { text: "Online" }, - both: { text: "Beides" }, - in_person: { text: "Persönlich" }, + online: { text: "En línea" }, + both: { text: "Ambos" }, + in_person: { text: "En persona" }, }, }, why_section: { - why: { text: "Warum" }, + why: { text: "Por qué" }, }, take_action_section: { - title: { text: "Handeln" }, + title: { text: "Tomar Acción" }, coaches: { - title: "Stellen Sie eine Frage", - description: "Freiwillige aus der Gemeinschaft sind bereit, Fragen zu beantworten, egal ob groß oder klein", - button: { text: "Hilfe bekommen" }, + title: "Haz una pregunta", + description: "Voluntarios de la comunidad están listos para responder preguntas, grandes o pequeñas", + button: { text: "Obtener Ayuda" }, }, incentives: { - title: "Zeig mir das Geld", - description: "Es wird besser! Sehen Sie alle Anreize, die Ihnen zur Verfügung stehen.", - button: { text: "Anreize" }, + title: "Enséñame el dinero", + description: "¡Mejora! Vea todos los incentivos disponibles para usted.", + button: { text: "Incentivos" }, }, vendors: { - title: "Finden Sie einen Anbieter", - description: "Die entscheidende Frage - wer sollte Ihr Projekt anbieten?", - button: { text: "Anbieter" }, + title: "Encuentra un Vendedor", + description: "La pregunta crítica - ¿quién debería cotizar su proyecto?", + button: { text: "Vendedores" }, }, }, vendors_section: { - title: { text: "Anbieter" }, + title: { text: "Vendedores" }, + }, }, }, one_testimonial_page: { loader: { - text: "Testimonial-Details abrufen...", + text: "Obteniendo detalles del testimonio...", }, sections: { - call_to_add_testimonial: { text: "Fügen Sie hier Ihr Testimonial hinzu" }, - call_to_hide_testimonial: { text: "Testimonial-Formular ausblenden" }, - form: { title: { text: "Fügen Sie Ihr Testimonial hinzu" } }, + call_to_add_testimonial: { text: "Agrega tu testimonio aquí" }, + call_to_hide_testimonial: { text: "Ocultar formulario de testimonio" }, + form: { title: { text: "Agrega tu testimonio" } }, sidebar: { - other_testimonials: { text: "Weitere Testimonials" }, - call_to_add_testimonial: { text: "Testimonial hinzufügen" }, - call_to_hide_testimonial: { text: "Formular ausblenden" }, + other_testimonials: { text: "Otros testimonios" }, + call_to_add_testimonial: { text: "Agregar testimonio" }, + call_to_hide_testimonial: { text: "Ocultar formulario" }, }, }, }, one_event_page: { loader: { - text: "Veranstaltungsdetails abrufen...", + text: "Obteniendo detalles del evento...", }, sections: { - card: { online: { text: "Online" }, both: { text: "Beide" }, in_person: { text: "Persönlich" } }, - call_to_download: { text: "In Ihren Kalender herunterladen" }, + card: { online: { text: "En línea" }, both: { text: "Ambos" }, in_person: { text: "En persona" } }, + call_to_download: { text: "Descargar a tu calendario" }, apple_calendar: { text: "ICAL" }, google_calendar: { text: "Google Calendar" }, - call_to_register: { text: "Registrieren/Beitreten" }, + call_to_register: { text: "Registrar/Unirse" }, }, }, }, modals: { languageSelectionModal: { - title: { text: "Wählen Sie eine Sprache" }, + title: { text: "Elija un idioma" }, }, whereFrom: { - title: { text: "Bitte sagen Sie uns, woher Sie kommen" }, + title: { text: "Por favor, díganos de dónde es" }, buttons: { - no: { text: "NEIN" }, - submit: { text: "Okay, erledigt!" }, + no: { text: "NO" }, + submit: { text: "¡Vale, listo!" }, }, }, preTestimonial: { - title: { text: "Bevor Sie ein Testimonial hinzufügen, möchten wir Sie kennenlernen" }, + title: { text: "Antes de agregar un testimonio, nos gustaría conocerte" }, buttons: { - continue: { text: "Fortfahren" }, - cancel: { text: "Abbrechen" }, + continue: { text: "Continuar" }, + cancel: { text: "Cancelar" }, }, }, community_selection: { - selection_label: { text: "In welcher Gemeinschaft leben Sie?" }, - text_after_selection: { text: "Wir leiten Sie basierend auf Ihrem Standort zu den richtigen Ressourcen -" }, + other: { text: "Otro" }, + selection_label: { text: "¿En qué comunidad vives?" }, + text_after_selection: { text: "Te dirigiremos a los recursos adecuados según tu ubicación -" }, form: { zipcode: { - text: "Postleitzahl", - label: "Geben Sie Ihre Postleitzahl ein (Bearbeitbar)", - placeholder: "Postleitzahl hier eingeben...", + text: "Código postal", + label: "Introduce tu código postal (Editable)", + placeholder: "Introduce el código postal aquí...", }, - community_name: { text: "Gemeinschaftsname", placeholder: "In welcher Gemeinschaft leben Sie?" }, + community_name: { text: "Nombre de la comunidad", placeholder: "¿En qué comunidad vives?" }, }, buttons: { - close: { text: "Schließen" }, - submit: { text: "Los geht's" }, - }, - success: { text: "Danke, dass Sie beigetreten sind!" }, + close: { text: "Cerrar" }, + submit: { text: "Vamos" }, + }, + success: { text: "¡Gracias por unirte!" }, }, join: { - email: { text: "E-Mail", placeholder: "E-Mail hier eingeben..." }, - buttons: { cancel: { text: "Abbrechen" }, ok: { text: "Los geht's" } }, + email: { text: "Correo electrónico", placeholder: "Introduce tu correo electrónico aquí..." }, + buttons: { cancel: { text: "Cancelar" }, ok: { text: "Vamos" } }, }, help: { - buttons: { cancel: { text: "Abbrechen" }, ok: { text: "Los geht's" } }, - title: { text: "Hilfe erhalten" }, - selection_hint: { text: "Wir leiten Sie basierend auf Ihrem Standort zu den richtigen Ressourcen" }, + buttons: { cancel: { text: "Cancelar" }, ok: { text: "Vamos" } }, + title: { text: "Obtener ayuda" }, + selection_hint: { text: "Te dirigiremos a los recursos adecuados según tu ubicación" }, }, }, }; -export const SPANISH = { +export const PORTUGUESE = { + toasts: { + join: { + noEmail: { text: "Por favor, forneça um endereço de e-mail válido..." }, + noCommunity: { text: "Por favor, selecione uma comunidade..." }, + noZipcodeAndOther: { text: "Por favor, forneça o código postal e o nome da comunidade..." }, + join: { text: "Muito bem, obrigado por se juntar a nós!" }, + }, + }, inPreview: { - button: { text: "Modo de Vista Previa" }, + button: { text: "Modo de Pré-visualização" }, notice: { - text: "aún no está publicado. Los administradores siguen trabajando en ello. Por favor, vuelva más tarde cuando esté completo...", + text: "ainda não foi publicado. Os administradores ainda estão trabalhando nisso. Por favor, volte mais tarde quando estiver completo...", }, }, forms: { testimonials: { - title: { text: "Título*", placeholder: "Ingrese el título del testimonio...", label: "¡Cuéntenos su historia!" }, + title: { text: "Título*", placeholder: "Insira o título do depoimento...", label: "Conte-nos sua história!" }, image: { - label: "Incluya una imagen en su testimonio", - text: "Elegir archivo", - placeholder: "Ningún archivo seleccionado", - }, - community: { label: "Seleccione su comunidad", placeholder: "---Seleccione su comunidad---" }, - technology: { - label: "¿Bajo qué tecnología está este testimonio?", - placeholder: "---Seleccione la tecnología---", + label: "Inclua uma imagem no seu depoimento", + text: "Escolher arquivo", + placeholder: "Nenhum arquivo escolhido", }, - description: { placeholder: "Comience a contar su historia aquí..." }, + community: { label: "Selecione sua comunidade", placeholder: "---Selecione sua comunidade---" }, + technology: { label: "A qual tecnologia pertence este depoimento?", placeholder: "---Selecione a tecnologia---" }, + description: { placeholder: "Comece a contar sua história aqui..." }, buttons: { cancel: { text: "Cancelar" }, submit: { text: "Enviar" } }, }, }, loader: { - text: "Obteniendo detalles de la campaña...", + text: "Buscando detalhes da campanha...", }, - share: { text: "Compartir" }, + share: { text: "Compartilhar" }, footer: { - modal: { title: { prefix: "Seguir" }, cancel: { text: "Cancelar" }, ok: { text: "Suscribirse" } }, + modal: { title: { prefix: "Seguir" }, cancel: { text: "Cancelar" }, ok: { text: "Assinar" } }, news_letter: { - subscribe_button: { text: "Suscribirse a nuestro Boletín" }, - subscribe_message: { text: "Ya estás suscrito con " }, + subscribe_button: { text: "Assine nossa boletim informativo" }, + subscribe_message: { text: "Você já se inscreveu com " }, }, - quick_links: { text: "Enlaces rápidos" }, + quick_links: { text: "Links Rápidos" }, }, navbar: { - home: { text: "Inicio" }, - tech: { text: "Tecnologías" }, - coaches: { text: "Entrenadores" }, + home: { text: "Início" }, + tech: { text: "Tecnologias" }, + coaches: { text: "Treinadores" }, events: { text: "Eventos" }, - vendors: { text: "Vendedores" }, + vendors: { text: "Fornecedores" }, Deals: { text: "Ofertas" }, }, pages: { homepage: { share: { - button: { copied: { text: "¡Copiado!" }, copy: { text: "Copiar enlace" } }, - title: { text: "Compartir campaña" }, - hint: { text: "Puedes copiar el enlace y compartirlo" }, - instruction: { text: "Por favor, selecciona una plataforma en la que te gustaría compartir esta tecnología" }, + + button: { copied: { text: "Copiado!" }, copy: { text: "Copiar Link" } }, + title: { text: "Compartilhar Campanha" }, + hint: { text: "Você pode copiar o link e compartilhá-lo" }, + instruction: { text: "Selecione uma plataforma na qual você gostaria de compartilhar esta tecnologia" }, }, sections: { key_contact: { - text: "Contacto principal", + text: "Contato Principal", }, about_box: { - button: "Saber más", + button: "Saiba Mais", }, getting_started_section: { - quote: { text: "Cita" }, - coach: { text: "Entrenador" }, - learn_more: { text: "Saber más" }, + quote: { text: "Citação" }, + coach: { text: "Treinador" }, + learn_more: { text: "Saiba Mais" }, communities: { text: "Comunidades", title: "Comunidades", - description: "Conéctate con tu comunidad y descubre otras acciones", + description: "Conecte-se com sua comunidade e confira outras ações", }, }, testimonials_section: { scrollable: { - text: "Desplázate de izquierda a derecha para ver más testimonios, o usa los botones de flecha (arriba a la derecha) para desplazarte", + text: "Role da esquerda para a direita para ver mais depoimentos, ou use os botões de seta (canto superior direito) para rolar", }, - title: { text: "Testimonios" }, - call_to_add_testimonial: { text: "Agrega tu testimonio aquí" }, - call_to_hide_testimonial: { text: "Ocultar formulario de testimonio" }, - call_to_filter: { text: "Filtrar testimonios por" }, - full_view: { text: "Vista completa" }, + title: { text: "Depoimentos" }, + call_to_add_testimonial: { text: "Adicione seu depoimento aqui" }, + call_to_hide_testimonial: { text: "Ocultar formulário de depoimento" }, + call_to_filter: { text: "Filtrar depoimentos por" }, + full_view: { text: "Visualização Completa" }, }, events_section: { - title: { text: "Testimonios" }, + title: { text: "Eventos" }, scrollable: { - text: "Desplázate de izquierda a derecha para ver más eventos, o usa los botones de flecha (arriba a la derecha) para desplazarte", + text: "Role da esquerda para a direita para ver mais eventos, ou use os botões de seta (canto superior direito) para rolar", }, - call_to_filter: { text: "Filtrar testimonios por" }, - card: { online: { text: "En línea" }, both: { text: "Ambos" }, in_person: { text: "En persona" } }, + call_to_filter: { text: "Filtrar depoimentos por" }, + card: { online: { text: "Online" }, both: { text: "Ambos" }, in_person: { text: "Presencial" } }, }, coaches_section: { - call_to_filter: { text: "Filtrar testimonios por" }, - get_help: { text: "Obtener ayuda" }, - help_modal: { title: "Obtener ayuda" }, + call_to_filter: { text: "Filtrar depoimentos por" }, + get_help: { text: "Obter Ajuda" }, + help_modal: { title: "Obter Ajuda" }, }, }, }, one_technology_page: { share: { - button: { copied: { text: "¡Copiado!" }, copy: { text: "Copiar enlace" } }, - title: { text: "Compartir" }, - hint: { text: "Puedes copiar el enlace y compartirlo" }, - instruction: { text: "Por favor, selecciona una plataforma en la que te gustaría compartir esta tecnología" }, + other: { text: "Outro" }, + button: { copied: { text: "Copiado!" }, copy: { text: "Copiar Link" } }, + title: { text: "Compartilhar" }, + hint: { text: "Você pode copiar o link e compartilhá-lo" }, + instruction: { text: "Selecione uma plataforma na qual você gostaria de compartilhar esta tecnologia" }, }, loader: { - text: "Obteniendo detalles de la tecnología...", + text: "Buscando detalhes da tecnologia...", }, sections: { - see_more: { text: "Ver más..." }, + see_more: { text: "Ver mais..." }, see_less: { text: "Ver menos..." }, get_updates: { - button: { text: "Obtener actualizaciones" }, - description: { text: "Obtener actualizaciones sobre" }, - title: { text: "Obtener actualizaciones sobre" }, - confirm_button: { text: "Obtener actualizaciones" }, + button: { text: "Receber Atualizações" }, + description: { text: "Receber atualizações sobre" }, + title: { text: "Receber atualizações sobre" }, + confirm_button: { text: "Receber Atualizações" }, cancel_button: { text: "Cancelar" }, }, comments: { - title: { text: "Comentarios" }, - see_more_trunc: { text: "Ver más" }, - see_more: { text: "Ver más comentarios" }, - call_to_add: { text: "Agregar un comentario" }, + title: { text: "Comentários" }, + see_more_trunc: { text: "Ver mais" }, + see_more: { text: "Ver mais comentários" }, + call_to_add: { text: "Adicionar um comentário" }, modal: { - title: "Leer comentarios o agregar el tuyo", - relative_data: { text: "hace 50 días" }, - name: { text: "Tu nombre" }, - name_placeholder: { text: "¿Quién está haciendo este comentario?" }, - comment_placeholder: { text: "Escribe tu comentario aquí" }, + preComment: { + title: { text: "Antes de continuar, gostaríamos de saber sobre você" }, + buttons: { continue: { text: "Continuar" }, cancel: { text: "Cancelar" } }, + email: { text: "E-mail" }, + }, + deletion: { + delete: { text: "Excluir" }, + title: { text: "Tem certeza?" }, + buttons: { yes: { text: "Sim" }, no: { text: "Não" } }, + }, + yours: { text: "Seu" }, + title: "Leia comentários ou adicione o seu", + relative_data: { text: "50 dias atrás" }, + name: { text: "Seu nome" }, + name_placeholder: { text: "Quem está fazendo este comentário?" }, + comment_placeholder: { text: "Digite o comentário aqui" }, button: { text: "Comentar" }, - no_comments: { text: "Aún no hay comentarios, ¡agrega el tuyo!" }, + no_comments: { text: "Ainda não há comentários, adicione o seu!" }, }, }, interactions: { - like: { text: "Me gusta", plural: "Me gusta" }, - comment: { text: "Comentario", plural: "Comentarios" }, - view: { text: "Vista", plural: "Vistas" }, - share: { text: "Compartir", plural: "Compartidos" }, + like: { text: "Curtir", plural: "Curtidas" }, + comment: { text: "Comentar", plural: "Comentários" }, + view: { text: "Visualizar", plural: "Visualizações" }, + share: { text: "Compartilhar", plural: "Compartilhamentos" }, }, testimonials_section: { - title: { text: "Testimonios" }, - call_to_add_testimonial: { text: "Agrega tu testimonio aquí" }, - full_view: { text: "Vista completa" }, + title: { text: "Depoimentos" }, + call_to_add_testimonial: { text: "Adicione seu depoimento aqui" }, + full_view: { text: "Visualização Completa" }, }, coaches_section: { - button: { text: "Obtener ayuda" }, + button: { text: "Obter Ajuda" }, }, do_more: { title: { @@ -657,109 +716,375 @@ export const SPANISH = { events_section: { title: { text: "Eventos" }, card: { - online: { text: "En línea" }, + online: { text: "Online" }, both: { text: "Ambos" }, - in_person: { text: "En persona" }, + in_person: { text: "Presencial" }, }, }, why_section: { - why: { text: "Por qué" }, + why: { text: "Por quê" }, }, take_action_section: { - title: { text: "Tomar Acción" }, + title: { text: "Tomar Ação" }, coaches: { - title: "Haz una pregunta", - description: "Voluntarios de la comunidad están listos para responder preguntas, grandes o pequeñas", - button: { text: "Obtener Ayuda" }, + title: "Faça uma pergunta", + description: "Voluntários da comunidade estão prontos para responder perguntas, grandes ou pequenas", + button: { text: "Obter Ajuda" }, }, incentives: { - title: "Enséñame el dinero", - description: "¡Mejora! Vea todos los incentivos disponibles para usted.", + title: "Mostre-me o dinheiro", + description: "Fica melhor! Veja todos os incentivos disponíveis para você.", button: { text: "Incentivos" }, }, vendors: { - title: "Encuentra un Vendedor", - description: "La pregunta crítica - ¿quién debería cotizar su proyecto?", - button: { text: "Vendedores" }, + title: "Encontre um Fornecedor", + description: "A questão crítica - quem deve cotar seu projeto?", + button: { text: "Fornecedores" }, }, }, vendors_section: { - title: { text: "Vendedores" }, + title: { text: "Fornecedores" }, }, }, }, one_testimonial_page: { loader: { - text: "Obteniendo detalles del testimonio...", + text: "Buscando detalhes do depoimento...", }, sections: { - call_to_add_testimonial: { text: "Agrega tu testimonio aquí" }, - call_to_hide_testimonial: { text: "Ocultar formulario de testimonio" }, - form: { title: { text: "Agrega tu testimonio" } }, + call_to_add_testimonial: { text: "Adicione seu depoimento aqui" }, + call_to_hide_testimonial: { text: "Ocultar formulário de depoimento" }, + form: { title: { text: "Adicione seu depoimento" } }, sidebar: { - other_testimonials: { text: "Otros testimonios" }, - call_to_add_testimonial: { text: "Agregar testimonio" }, - call_to_hide_testimonial: { text: "Ocultar formulario" }, + other_testimonials: { text: "Outros Depoimentos" }, + call_to_add_testimonial: { text: "Adicionar Depoimento" }, + call_to_hide_testimonial: { text: "Ocultar Formulário" }, }, }, }, one_event_page: { loader: { - text: "Obteniendo detalles del evento...", + text: "Buscando detalhes do evento...", }, sections: { - card: { online: { text: "En línea" }, both: { text: "Ambos" }, in_person: { text: "En persona" } }, - call_to_download: { text: "Descargar a tu calendario" }, + card: { online: { text: "Online" }, both: { text: "Ambos" }, in_person: { text: "Presencial" } }, + call_to_download: { text: "Baixar para o seu calendário" }, apple_calendar: { text: "ICAL" }, google_calendar: { text: "Google Calendar" }, - call_to_register: { text: "Registrar/Unirse" }, + call_to_register: { text: "Registrar/Participar" }, }, }, }, modals: { languageSelectionModal: { - title: { text: "Elija un idioma" }, + title: { text: "Escolha um Idioma" }, }, whereFrom: { - title: { text: "Por favor, díganos de dónde es" }, + title: { text: "Por favor, diga-nos de onde você é" }, buttons: { - no: { text: "NO" }, - submit: { text: "¡Vale, listo!" }, + no: { text: "NÃO" }, + submit: { text: "Ok, pronto!" }, }, }, preTestimonial: { - title: { text: "Antes de agregar un testimonio, nos gustaría conocerte" }, + title: { text: "Antes de adicionar um depoimento, gostaríamos de conhecê-lo" }, buttons: { continue: { text: "Continuar" }, cancel: { text: "Cancelar" }, }, }, community_selection: { - selection_label: { text: "¿En qué comunidad vives?" }, - text_after_selection: { text: "Te dirigiremos a los recursos adecuados según tu ubicación -" }, + other: { text: "Outro" }, + selection_label: { text: "Em qual comunidade você mora?" }, + text_after_selection: { text: "Nós direcionaremos você para os recursos corretos com base na sua localização -" }, form: { zipcode: { - text: "Código postal", - label: "Introduce tu código postal (Editable)", - placeholder: "Introduce el código postal aquí...", + text: "CEP", + label: "Digite seu CEP (Editável)", + placeholder: "Digite o CEP aqui...", }, - community_name: { text: "Nombre de la comunidad", placeholder: "¿En qué comunidad vives?" }, + community_name: { text: "Nome da Comunidade", placeholder: "Em qual comunidade você mora?" }, }, buttons: { - close: { text: "Cerrar" }, - submit: { text: "Vamos" }, + close: { text: "Fechar" }, + submit: { text: "Vamos lá" }, }, - success: { text: "¡Gracias por unirte!" }, + success: { text: "Obrigado por se juntar a nós!" }, }, join: { - email: { text: "Correo electrónico", placeholder: "Introduce tu correo electrónico aquí..." }, - buttons: { cancel: { text: "Cancelar" }, ok: { text: "Vamos" } }, + email: { text: "Email", placeholder: "Digite o email aqui..." }, + buttons: { cancel: { text: "Cancelar" }, ok: { text: "Vamos lá" } }, }, help: { - buttons: { cancel: { text: "Cancelar" }, ok: { text: "Vamos" } }, - title: { text: "Obtener ayuda" }, - selection_hint: { text: "Te dirigiremos a los recursos adecuados según tu ubicación" }, + buttons: { cancel: { text: "Cancelar" }, ok: { text: "Vamos lá" } }, + title: { text: "Obter Ajuda" }, + selection_hint: { text: "Nós direcionaremos você para os recursos corretos com base na sua localização" }, + }, + }, +}; + +export const GERMAN = { + inPreview: { + button: { text: "Vorschau-Modus" }, + notice: { + text: "ist noch nicht veröffentlicht. Die Administratoren arbeiten noch daran. Bitte kommen Sie später zurück, wenn es fertig ist...", + }, + }, + forms: { + testimonials: { + title: { + text: "Titel*", + placeholder: "Geben Sie den Titel des Testimonials ein...", + label: "Erzählen Sie uns Ihre Geschichte!", + }, + image: { + label: "Fügen Sie ein Bild in Ihr Testimonial ein", + text: "Datei wählen", + placeholder: "Keine Datei ausgewählt", + }, + community: { label: "Wählen Sie Ihre Gemeinschaft", placeholder: "---Wählen Sie Ihre Gemeinschaft---" }, + technology: { + label: "Unter welcher Technologie fällt dieses Testimonial?", + placeholder: "---Wählen Sie die Technologie---", + }, + description: { placeholder: "Beginnen Sie hier, Ihre Geschichte zu erzählen..." }, + buttons: { cancel: { text: "Abbrechen" }, submit: { text: "Einreichen" } }, + }, + }, + + loader: { + text: "Kampagnendetails abrufen...", + }, + share: { text: "Teilen" }, + footer: { + modal: { title: { prefix: "Folgen" }, cancel: { text: "Abbrechen" }, ok: { text: "Abonnieren" } }, + news_letter: { + subscribe_button: { text: "Newsletter abonnieren" }, + subscribe_message: { text: "Sie sind bereits abonniert mit " }, + }, + quick_links: { text: "Schnellzugriffe" }, + }, + navbar: { + home: { text: "Startseite" }, + tech: { text: "Technologien" }, + coaches: { text: "Trainer" }, + events: { text: "Veranstaltungen" }, + vendors: { text: "Anbieter" }, + Deals: { text: "Angebote" }, + }, + pages: { + homepage: { + share: { + button: { copied: { text: "Kopiert!" }, copy: { text: "Link kopieren" } }, + title: { text: "Kampagne teilen" }, + hint: { text: "Sie können den Link kopieren und teilen" }, + instruction: { text: "Bitte wählen Sie eine Plattform aus, auf der Sie diese Technologie teilen möchten" }, + }, + sections: { + key_contact: { + text: "Hauptkontakt", + }, + + about_box: { + button: "Mehr erfahren", + }, + getting_started_section: { + quote: { text: "Zitat" }, + coach: { text: "Trainer" }, + learn_more: { text: "Mehr erfahren" }, + communities: { + text: "Gemeinschaften", + title: "Gemeinschaften", + description: "Verbinden Sie sich mit Ihrer Gemeinschaft und sehen Sie sich weitere Aktionen an", + }, + }, + testimonials_section: { + scrollable: { + text: "Scrollen Sie von links nach rechts, um weitere Testimonials zu sehen, oder verwenden Sie die Pfeiltasten (oben rechts), um zu scrollen", + }, + title: { text: "Testimonials" }, + call_to_add_testimonial: { text: "Fügen Sie hier Ihr Testimonial hinzu" }, + call_to_hide_testimonial: { text: "Testimonial-Formular ausblenden" }, + call_to_filter: { text: "Testimonials filtern nach" }, + full_view: { text: "Vollansicht" }, + }, + events_section: { + title: { text: "Veranstaltungen" }, + scrollable: { + text: "Scrollen Sie von links nach rechts, um weitere Veranstaltungen zu sehen, oder verwenden Sie die Pfeiltasten (oben rechts), um zu scrollen", + }, + call_to_filter: { text: "Testimonials filtern nach" }, + card: { online: { text: "Online" }, both: { text: "Beide" }, in_person: { text: "Persönlich" } }, + }, + coaches_section: { + call_to_filter: { text: "Testimonials filtern nach" }, + get_help: { text: "Hilfe erhalten" }, + help_modal: { title: "Hilfe erhalten" }, + }, + }, + }, + one_technology_page: { + share: { + button: { copied: { text: "Kopiert!" }, copy: { text: "Link kopieren" } }, + title: { text: "Teilen" }, + hint: { text: "Sie können den Link kopieren und teilen" }, + instruction: { text: "Bitte wählen Sie eine Plattform aus, auf der Sie diese Technologie teilen möchten" }, + }, + loader: { + text: "Technologiedetails abrufen...", + }, + sections: { + see_more: { text: "Mehr sehen..." }, + see_less: { text: "Weniger sehen..." }, + get_updates: { + button: { text: "Updates erhalten" }, + description: { text: "Updates erhalten über" }, + title: { text: "Updates erhalten über" }, + confirm_button: { text: "Updates erhalten" }, + cancel_button: { text: "Abbrechen" }, + }, + comments: { + title: { text: "Kommentare" }, + see_more_trunc: { text: "Mehr sehen" }, + see_more: { text: "Mehr Kommentare sehen" }, + call_to_add: { text: "Einen Kommentar hinzufügen" }, + modal: { + title: "Lesen Sie Kommentare oder fügen Sie Ihren hinzu", + relative_data: { text: "vor 50 Tagen" }, + name: { text: "Ihr Name" }, + name_placeholder: { text: "Wer macht diesen Kommentar?" }, + comment_placeholder: { text: "Kommentar hier eingeben" }, + button: { text: "Kommentieren" }, + no_comments: { text: "Noch keine Kommentare, fügen Sie Ihren hinzu!" }, + }, + }, + interactions: { + like: { text: "Gefällt mir", plural: "Gefällt mir" }, + comment: { text: "Kommentar", plural: "Kommentare" }, + view: { text: "Ansicht", plural: "Ansichten" }, + share: { text: "Teilen", plural: "Geteilt" }, + }, + testimonials_section: { + title: { text: "Testimonials" }, + call_to_add_testimonial: { text: "Fügen Sie hier Ihr Testimonial hinzu" }, + full_view: { text: "Vollansicht" }, + }, + coaches_section: { + button: { text: "Hilfe erhalten" }, + }, + do_more: { + title: { + text: "Teilnehmende Gemeinschaften", + }, + }, + events_section: { + title: { text: "Veranstaltungen" }, + card: { + online: { text: "Online" }, + both: { text: "Beides" }, + in_person: { text: "Persönlich" }, + }, + }, + why_section: { + why: { text: "Warum" }, + }, + take_action_section: { + title: { text: "Handeln" }, + coaches: { + title: "Stellen Sie eine Frage", + description: "Freiwillige aus der Gemeinschaft sind bereit, Fragen zu beantworten, egal ob groß oder klein", + button: { text: "Hilfe bekommen" }, + }, + incentives: { + title: "Zeig mir das Geld", + description: "Es wird besser! Sehen Sie alle Anreize, die Ihnen zur Verfügung stehen.", + button: { text: "Anreize" }, + }, + vendors: { + title: "Finden Sie einen Anbieter", + description: "Die entscheidende Frage - wer sollte Ihr Projekt anbieten?", + button: { text: "Anbieter" }, + }, + }, + vendors_section: { + title: { text: "Anbieter" }, + }, + }, + }, + + one_testimonial_page: { + loader: { + text: "Testimonial-Details abrufen...", + }, + sections: { + call_to_add_testimonial: { text: "Fügen Sie hier Ihr Testimonial hinzu" }, + call_to_hide_testimonial: { text: "Testimonial-Formular ausblenden" }, + form: { title: { text: "Fügen Sie Ihr Testimonial hinzu" } }, + sidebar: { + other_testimonials: { text: "Weitere Testimonials" }, + call_to_add_testimonial: { text: "Testimonial hinzufügen" }, + call_to_hide_testimonial: { text: "Formular ausblenden" }, + }, + }, + }, + one_event_page: { + loader: { + text: "Veranstaltungsdetails abrufen...", + }, + sections: { + card: { online: { text: "Online" }, both: { text: "Beide" }, in_person: { text: "Persönlich" } }, + call_to_download: { text: "In Ihren Kalender herunterladen" }, + apple_calendar: { text: "ICAL" }, + google_calendar: { text: "Google Calendar" }, + call_to_register: { text: "Registrieren/Beitreten" }, + }, + }, + }, + modals: { + languageSelectionModal: { + title: { text: "Wählen Sie eine Sprache" }, + }, + whereFrom: { + title: { text: "Bitte sagen Sie uns, woher Sie kommen" }, + buttons: { + no: { text: "NEIN" }, + submit: { text: "Okay, erledigt!" }, + }, + }, + preTestimonial: { + title: { text: "Bevor Sie ein Testimonial hinzufügen, möchten wir Sie kennenlernen" }, + buttons: { + continue: { text: "Fortfahren" }, + cancel: { text: "Abbrechen" }, + }, + }, + community_selection: { + other: { text: "Andere" }, + selection_label: { text: "In welcher Gemeinschaft leben Sie?" }, + text_after_selection: { text: "Wir leiten Sie basierend auf Ihrem Standort zu den richtigen Ressourcen -" }, + form: { + zipcode: { + text: "Postleitzahl", + label: "Geben Sie Ihre Postleitzahl ein (Bearbeitbar)", + placeholder: "Postleitzahl hier eingeben...", + }, + community_name: { text: "Gemeinschaftsname", placeholder: "In welcher Gemeinschaft leben Sie?" }, + }, + buttons: { + close: { text: "Schließen" }, + submit: { text: "Los geht's" }, + }, + success: { text: "Danke, dass Sie beigetreten sind!" }, + }, + join: { + email: { text: "E-Mail", placeholder: "E-Mail hier eingeben..." }, + buttons: { cancel: { text: "Abbrechen" }, ok: { text: "Los geht's" } }, + }, + help: { + buttons: { cancel: { text: "Abbrechen" }, ok: { text: "Los geht's" } }, + title: { text: "Hilfe erhalten" }, + selection_hint: { text: "Wir leiten Sie basierend auf Ihrem Standort zu den richtigen Ressourcen" }, }, }, }; @@ -866,6 +1191,8 @@ export const FRENCH = { }, one_technology_page: { share: { + other: { text: "Autre" }, + button: { copied: { text: "Copié!" }, copy: { text: "Copier le lien" } }, title: { text: "Partager" }, hint: { text: "Vous pouvez copier le lien et le partager" }, @@ -1001,6 +1328,7 @@ export const FRENCH = { }, }, community_selection: { + other: { text: "Autre" }, selection_label: { text: "Dans quelle communauté vivez-vous?" }, text_after_selection: { text: "Nous vous dirigerons vers les bonnes ressources en fonction de votre localisation -", @@ -1257,6 +1585,7 @@ export const CHINESE = { }, }, community_selection: { + other: { text: "其他" }, selection_label: { text: "你居住在哪个社区?" }, text_after_selection: { text: "我们将根据你的位置为你指引到正确的资源 -" }, form: { @@ -1285,262 +1614,6 @@ export const CHINESE = { }, }; -export const PORTUGUESE = { - inPreview: { - button: { text: "Modo de Pré-visualização" }, - notice: { - text: "ainda não foi publicado. Os administradores ainda estão trabalhando nisso. Por favor, volte mais tarde quando estiver completo...", - }, - }, - forms: { - testimonials: { - title: { text: "Título*", placeholder: "Insira o título do depoimento...", label: "Conte-nos sua história!" }, - image: { - label: "Inclua uma imagem no seu depoimento", - text: "Escolher arquivo", - placeholder: "Nenhum arquivo escolhido", - }, - community: { label: "Selecione sua comunidade", placeholder: "---Selecione sua comunidade---" }, - technology: { label: "A qual tecnologia pertence este depoimento?", placeholder: "---Selecione a tecnologia---" }, - description: { placeholder: "Comece a contar sua história aqui..." }, - buttons: { cancel: { text: "Cancelar" }, submit: { text: "Enviar" } }, - }, - }, - - loader: { - text: "Buscando detalhes da campanha...", - }, - share: { text: "Compartilhar" }, - footer: { - modal: { title: { prefix: "Seguir" }, cancel: { text: "Cancelar" }, ok: { text: "Assinar" } }, - news_letter: { - subscribe_button: { text: "Assine nossa Newsletter" }, - subscribe_message: { text: "Você já se inscreveu com " }, - }, - quick_links: { text: "Links Rápidos" }, - }, - navbar: { - home: { text: "Início" }, - tech: { text: "Tecnologias" }, - coaches: { text: "Treinadores" }, - events: { text: "Eventos" }, - vendors: { text: "Fornecedores" }, - Deals: { text: "Ofertas" }, - }, - pages: { - homepage: { - share: { - button: { copied: { text: "Copiado!" }, copy: { text: "Copiar Link" } }, - title: { text: "Compartilhar Campanha" }, - hint: { text: "Você pode copiar o link e compartilhá-lo" }, - instruction: { text: "Selecione uma plataforma na qual você gostaria de compartilhar esta tecnologia" }, - }, - sections: { - key_contact: { - text: "Contato Principal", - }, - - about_box: { - button: "Saiba Mais", - }, - getting_started_section: { - quote: { text: "Citação" }, - coach: { text: "Treinador" }, - learn_more: { text: "Saiba Mais" }, - communities: { - text: "Comunidades", - title: "Comunidades", - description: "Conecte-se com sua comunidade e confira outras ações", - }, - }, - testimonials_section: { - scrollable: { - text: "Role da esquerda para a direita para ver mais depoimentos, ou use os botões de seta (canto superior direito) para rolar", - }, - title: { text: "Depoimentos" }, - call_to_add_testimonial: { text: "Adicione seu depoimento aqui" }, - call_to_hide_testimonial: { text: "Ocultar formulário de depoimento" }, - call_to_filter: { text: "Filtrar depoimentos por" }, - full_view: { text: "Visualização Completa" }, - }, - events_section: { - title: { text: "Eventos" }, - scrollable: { - text: "Role da esquerda para a direita para ver mais eventos, ou use os botões de seta (canto superior direito) para rolar", - }, - call_to_filter: { text: "Filtrar depoimentos por" }, - card: { online: { text: "Online" }, both: { text: "Ambos" }, in_person: { text: "Presencial" } }, - }, - coaches_section: { - call_to_filter: { text: "Filtrar depoimentos por" }, - get_help: { text: "Obter Ajuda" }, - help_modal: { title: "Obter Ajuda" }, - }, - }, - }, - one_technology_page: { - share: { - button: { copied: { text: "Copiado!" }, copy: { text: "Copiar Link" } }, - title: { text: "Compartilhar" }, - hint: { text: "Você pode copiar o link e compartilhá-lo" }, - instruction: { text: "Selecione uma plataforma na qual você gostaria de compartilhar esta tecnologia" }, - }, - loader: { - text: "Buscando detalhes da tecnologia...", - }, - sections: { - see_more: { text: "Ver mais..." }, - see_less: { text: "Ver menos..." }, - get_updates: { - button: { text: "Receber Atualizações" }, - description: { text: "Receber atualizações sobre" }, - title: { text: "Receber atualizações sobre" }, - confirm_button: { text: "Receber Atualizações" }, - cancel_button: { text: "Cancelar" }, - }, - comments: { - title: { text: "Comentários" }, - see_more_trunc: { text: "Ver mais" }, - see_more: { text: "Ver mais comentários" }, - call_to_add: { text: "Adicionar um comentário" }, - modal: { - title: "Leia comentários ou adicione o seu", - relative_data: { text: "50 dias atrás" }, - name: { text: "Seu nome" }, - name_placeholder: { text: "Quem está fazendo este comentário?" }, - comment_placeholder: { text: "Digite o comentário aqui" }, - button: { text: "Comentar" }, - no_comments: { text: "Ainda não há comentários, adicione o seu!" }, - }, - }, - interactions: { - like: { text: "Curtir", plural: "Curtidas" }, - comment: { text: "Comentar", plural: "Comentários" }, - view: { text: "Visualizar", plural: "Visualizações" }, - share: { text: "Compartilhar", plural: "Compartilhamentos" }, - }, - testimonials_section: { - title: { text: "Depoimentos" }, - call_to_add_testimonial: { text: "Adicione seu depoimento aqui" }, - full_view: { text: "Visualização Completa" }, - }, - coaches_section: { - button: { text: "Obter Ajuda" }, - }, - do_more: { - title: { - text: "Comunidades Participantes", - }, - }, - events_section: { - title: { text: "Eventos" }, - card: { - online: { text: "Online" }, - both: { text: "Ambos" }, - in_person: { text: "Presencial" }, - }, - }, - why_section: { - why: { text: "Por quê" }, - }, - take_action_section: { - title: { text: "Tomar Ação" }, - coaches: { - title: "Faça uma pergunta", - description: "Voluntários da comunidade estão prontos para responder perguntas, grandes ou pequenas", - button: { text: "Obter Ajuda" }, - }, - incentives: { - title: "Mostre-me o dinheiro", - description: "Fica melhor! Veja todos os incentivos disponíveis para você.", - button: { text: "Incentivos" }, - }, - vendors: { - title: "Encontre um Fornecedor", - description: "A questão crítica - quem deve cotar seu projeto?", - button: { text: "Fornecedores" }, - }, - }, - vendors_section: { - title: { text: "Fornecedores" }, - }, - }, - }, - - one_testimonial_page: { - loader: { - text: "Buscando detalhes do depoimento...", - }, - sections: { - call_to_add_testimonial: { text: "Adicione seu depoimento aqui" }, - call_to_hide_testimonial: { text: "Ocultar formulário de depoimento" }, - form: { title: { text: "Adicione seu depoimento" } }, - sidebar: { - other_testimonials: { text: "Outros Depoimentos" }, - call_to_add_testimonial: { text: "Adicionar Depoimento" }, - call_to_hide_testimonial: { text: "Ocultar Formulário" }, - }, - }, - }, - one_event_page: { - loader: { - text: "Buscando detalhes do evento...", - }, - sections: { - card: { online: { text: "Online" }, both: { text: "Ambos" }, in_person: { text: "Presencial" } }, - call_to_download: { text: "Baixar para o seu calendário" }, - apple_calendar: { text: "ICAL" }, - google_calendar: { text: "Google Calendar" }, - call_to_register: { text: "Registrar/Participar" }, - }, - }, - }, - modals: { - languageSelectionModal: { - title: { text: "Escolha um Idioma" }, - }, - whereFrom: { - title: { text: "Por favor, diga-nos de onde você é" }, - buttons: { - no: { text: "NÃO" }, - submit: { text: "Ok, pronto!" }, - }, - }, - preTestimonial: { - title: { text: "Antes de adicionar um depoimento, gostaríamos de conhecê-lo" }, - buttons: { - continue: { text: "Continuar" }, - cancel: { text: "Cancelar" }, - }, - }, - community_selection: { - selection_label: { text: "Em qual comunidade você mora?" }, - text_after_selection: { text: "Nós direcionaremos você para os recursos corretos com base na sua localização -" }, - form: { - zipcode: { - text: "CEP", - label: "Digite seu CEP (Editável)", - placeholder: "Digite o CEP aqui...", - }, - community_name: { text: "Nome da Comunidade", placeholder: "Em qual comunidade você mora?" }, - }, - buttons: { - close: { text: "Fechar" }, - submit: { text: "Vamos lá" }, - }, - success: { text: "Obrigado por se juntar a nós!" }, - }, - join: { - email: { text: "Email", placeholder: "Digite o email aqui..." }, - buttons: { cancel: { text: "Cancelar" }, ok: { text: "Vamos lá" } }, - }, - help: { - buttons: { cancel: { text: "Cancelar" }, ok: { text: "Vamos lá" } }, - title: { text: "Obter Ajuda" }, - selection_hint: { text: "Nós direcionaremos você para os recursos corretos com base na sua localização" }, - }, - }, -}; export const ITALIAN = { inPreview: { @@ -1778,6 +1851,7 @@ export const ITALIAN = { }, }, community_selection: { + other: { text: "Altro" }, selection_label: { text: "In quale comunità vivi?" }, text_after_selection: { text: "Ti indirizzeremo alle risorse corrette in base alla tua posizione -" }, form: { diff --git a/src/utils/utils.js b/src/utils/utils.js index a870d462..f063fb2b 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -4,6 +4,7 @@ import { ME_STATES } from "./States"; import { enUS, es, ptBR } from "date-fns/locale"; import { DEFAULT_ENGLISH_CODE, PREFERRED_LANGUAGE_STORAGE_KEY } from "src/redux/redux-action-types"; import { getPreferredLanguageISO } from "src/redux/actions/actions"; +import {IS_CANARY, IS_LOCAL, IS_PROD} from "../config/environment"; const LANG_CODE_TO_DATE_OBJ = { en: enUS, es, pt: ptBR }; // means when a new language is approved, we wld have to add it in here as well @@ -36,16 +37,23 @@ export function formatTimeRange(startDateString, endDateString) { } } +const getLocale = () => { + let locale = pruneLanuguage(getPreferredLanguageISO()); + return LANG_CODE_TO_DATE_OBJ[locale] || enUS; +}; export function formatDate(dateString, formatString = "MMM d, yyyy") { if (!dateString) return ""; + const locale = getLocale(); + const date = parseISO(dateString); - return format(date, formatString); + return format(date, formatString, { locale }); } export function formatTime(dateString, formatString = "HH:mm aaa") { if (!dateString) return ""; + const locale = getLocale(); const date = parseISO(dateString); - return format(date, formatString); + return format(date, formatString, { locale }); } const pruneLanuguage = (code) => { @@ -55,8 +63,7 @@ const pruneLanuguage = (code) => { }; export function relativeTimeAgo(datetimeString) { - let locale = pruneLanuguage(getPreferredLanguageISO()); - locale = LANG_CODE_TO_DATE_OBJ[locale] || enUS; + const locale = getLocale(); const date = parseISO(datetimeString); return formatDistanceToNow(date, { addSuffix: true, locale }); } @@ -291,3 +298,19 @@ export function isEmpty(value) { } return false; } + +let baseUrl; +if (IS_LOCAL) { + baseUrl = "http://massenergize.test:3000/"; +} else if (IS_CANARY) { + baseUrl = "https://communities-canary.massenergize.org/"; +} +else if (IS_PROD) { + baseUrl = "https://communities.massenergize.org/"; +} else { + baseUrl = "https://communities.massenergize.dev/"; +} + +export const BASE_URL = baseUrl + +// at this point you can set the value stored in `baseUrl` to ```javascript null``` since it's been copied into `BASE_URL` so it can be garbage collecte