diff --git a/gatsby-browser.js b/gatsby-browser.js new file mode 100644 index 0000000..0e4e9c8 --- /dev/null +++ b/gatsby-browser.js @@ -0,0 +1,10 @@ +import React from 'react'; +import LanguageProvider from './src/context/LanguageContext'; + +export const wrapRootElement = ({ element }) => { + return ( + + {element} + + ); +}; \ No newline at end of file diff --git a/gatsby-ssr.js b/gatsby-ssr.js index 7baf090..c9ce0aa 100644 --- a/gatsby-ssr.js +++ b/gatsby-ssr.js @@ -1,7 +1,8 @@ import React from "react"; +import LanguageProvider from './src/context/LanguageContext'; const HtmlAttributes = { - lang: "en" + lang: "es" } const HeadComponents = [ @@ -28,3 +29,11 @@ export const onRenderBody = ({ setHeadComponents, setHtmlAttributes }) => { setHtmlAttributes(HtmlAttributes); setHeadComponents(HeadComponents); } + +export const wrapRootElement = ({ element }) => { + return ( + + {element} + + ); +} diff --git a/src/components/IntlProviderWrapper.jsx b/src/components/IntlProviderWrapper.jsx new file mode 100644 index 0000000..fdab298 --- /dev/null +++ b/src/components/IntlProviderWrapper.jsx @@ -0,0 +1,12 @@ +import React from 'react'; +import LanguageProvider from '../../../context/LanguageContext'; + +const IntlProviderWrapper = ({ children }) => { + return ( + + {children} + + ); +}; + +export default IntlProviderWrapper; \ No newline at end of file diff --git a/src/components/Navbars/LanguageSelector/LanguageSwitcher.jsx b/src/components/Navbars/LanguageSelector/LanguageSwitcher.jsx index 15fd732..623b491 100644 --- a/src/components/Navbars/LanguageSelector/LanguageSwitcher.jsx +++ b/src/components/Navbars/LanguageSelector/LanguageSwitcher.jsx @@ -1,52 +1,29 @@ -import React, { useEffect, useState } from 'react'; -import { IntlProvider, useIntl } from 'gatsby-plugin-intl'; -import { navigate } from 'gatsby'; +import React, { useContext } from 'react'; +import { LanguageContext } from '../../../context/LanguageContext'; const LanguageSwitcher = () => { - const [messages, setMessages] = useState({}); - const [languages, setLanguages] = useState([]); - const intl = useIntl(); - const currentLanguage = intl.locale; + const { languages, currentLanguage, changeLanguage } = useContext(LanguageContext); - useEffect(() => { - const fetchMessages = async () => { - try { - const response = await fetch('/data/language/languages.json'); - const data = await response.json(); - setMessages(data); - setLanguages(Object.keys(data)); - } catch (error) { - console.error('Error fetching texts:', error); - } - }; - - fetchMessages(); - }, []); - - const handleLanguageChange = (newLanguage) => { - const path = window.location.pathname; - const newPath = `/${newLanguage}${path.substring(3)}`; - navigate(newPath); - }; + if (!languages || languages.length === 0) { + return
Loading...
; + } return ( - -
+
+
    + {languages.map((lang) => ( + -
      - {languages.map((lang) => ( - - ))} -
    -
- + ))} + +
); }; diff --git a/src/components/Software/About.jsx b/src/components/Software/About.jsx index 3cc0b9d..eeb9769 100644 --- a/src/components/Software/About.jsx +++ b/src/components/Software/About.jsx @@ -35,7 +35,7 @@ const About = () => {

{ number.value }

- { number.title } + {intl.locale === 'en' ? number.title2 : number.title }
)) @@ -78,7 +78,7 @@ const About = () => { diff --git a/src/components/Software/Blog.jsx b/src/components/Software/Blog.jsx index e316604..733f8c0 100644 --- a/src/components/Software/Blog.jsx +++ b/src/components/Software/Blog.jsx @@ -7,9 +7,9 @@ import api from '../../common/api'; const Blog = () => { const intl = useIntl(); - const blog_title1= DOMPurify.sanitize(intl.formatMessage({ id: "blog_title1" }).trim().replace(/^"|"$/g, '')); - - const [dataBlog, setBlogs] = useState({blogs: [], faq: [],clients: []}); + //const blog_title1= DOMPurify.sanitize(intl.formatMessage({ id: "blog_title1" }).trim().replace(/^"|"$/g, '')); + const [dataBlog, setBlogs] = useState({blogs: [], faq: [],clients: [],text_traductions:[]}); + const blog_titleResult = intl.locale === 'es' ? dataBlog.text_traductions.blog_title1_es : dataBlog.text_traductions.en.blog_title1_en; useEffect(() => { const fetchData = async () => { @@ -30,8 +30,8 @@ const Blog = () => {
-
- {intl.formatMessage({ id: "all_articles" })} +
+ {intl.locale === 'es' ? dataBlog.text_traductions.all_articles_es : dataBlog.text_traductions.all_articles_en}
{ dataBlog.blogs.map((post, i) => ( @@ -45,18 +45,18 @@ const Blog = () => {
- { post.type } + { intl.locale === 'es' ? post.type.es : post.type.en } - { post.time } + { intl.locale === 'es' ? post.time_es : post.time_en } -
{ post.title }
+
{ intl.locale === 'es' ? post.title_es : post.title_en }
@@ -97,7 +97,7 @@ const Blog = () => { )) } - See More + {intl.locale === 'es' ? dataBlog.text_traductions.see_more_es : dataBlog.text_traductions.see_more_en}
diff --git a/src/components/Software/Header.jsx b/src/components/Software/Header.jsx index 0c456e7..075f3e3 100644 --- a/src/components/Software/Header.jsx +++ b/src/components/Software/Header.jsx @@ -1,39 +1,55 @@ -import React from 'react'; -import DOMPurify from 'dompurify'; +import React, { useEffect, useState } from 'react'; import { useIntl } from "gatsby-plugin-intl"; +import api from '../../common/api'; const Header = () => { const intl = useIntl(); - const header_1= DOMPurify.sanitize(intl.formatMessage({ id: "header_1" }).trim().replace(/^"|"$/g, '')); - + const [headers, setHeaders] = useState({es:[], en:[]}); + //const header_1= DOMPurify.sanitize(intl.formatMessage({ id: "header_1" }).trim().replace(/^"|"$/g, '')); + const header_1Result = intl.locale === 'es' ? headers.es.header_1 : headers.en.header_1 + + useEffect(() => { + const fetchData = async () => { + try { + const response = await api.get('headers', 'header.json'); + setHeaders(response); + } catch (error) { + console.error(error); + } + }; + + fetchData(); + }, []); + return ( +
-

-

{intl.formatMessage({ id: "header_2" })}

-
{intl.formatMessage({ id: "get_free_quotes" })} {intl.formatMessage({ id: "header_3" })}
+

+

+
{intl.locale === 'es' ? headers.es.header_2 : headers.en.header_2}{intl.locale === 'es' ? headers.es.header_3 : headers.en.header_3}
- +
diff --git a/src/components/Software/Services.jsx b/src/components/Software/Services.jsx index 559ea8b..fd64207 100644 --- a/src/components/Software/Services.jsx +++ b/src/components/Software/Services.jsx @@ -1,10 +1,26 @@ -import React from 'react'; +import React ,{ useEffect, useState }from 'react'; import { Link } from 'gatsby'; import { useIntl } from "gatsby-plugin-intl"; -import services from 'data/Software/services.json'; +//import services from '/static/data/services.json'; +import api from '../../common/api'; const Services = () => { const intl = useIntl(); + + const [services, setServices] = useState([]); + + useEffect(() => { + const fetchData = async () => { + try { + const response = await api.get('services','services.json'); + setServices(response); + } catch (error) { + console.error(error); + } + }; + + fetchData(); + }, []); return (
@@ -20,9 +36,9 @@ const Services = () => {
-
{ service.title }
+
{ intl.locale === 'en' ? service.title_en : service.title_es }
- { service.details } + {intl.locale === 'en' ? service.details_en : service.details_es}
{intl.formatMessage({ id: "see_projects" })}
diff --git a/src/context/LanguageContext.js b/src/context/LanguageContext.js new file mode 100644 index 0000000..a4cb1e0 --- /dev/null +++ b/src/context/LanguageContext.js @@ -0,0 +1,43 @@ +import React, { createContext, useState, useEffect } from 'react'; +import { IntlProvider } from 'gatsby-plugin-intl'; +import { navigate } from 'gatsby'; +export const LanguageContext = createContext(); + +const LanguageProvider = ({ children }) => { + const [messages, setMessages] = useState({}); + const [languages, setLanguages] = useState([]); + const [currentLanguage, setCurrentLanguage] = useState('es'); + + + useEffect(() => { + const fetchMessages = async () => { + try { + const response = await fetch('/data/language/languages.json'); + const data = await response.json(); + setMessages(data); + setLanguages(Object.keys(data)); + } catch (error) { + console.error('Error fetching texts:', error); + } + }; + + fetchMessages(); + }, []); + + const changeLanguage = (newLanguage) => { + setCurrentLanguage(newLanguage); + const path = window.location.pathname; + const newPath = `/${newLanguage}${path.substring(3)}`; + navigate(newPath); + }; + + return ( + + + {children} + + + ); +}; + +export default LanguageProvider; \ No newline at end of file diff --git a/src/data/Software/services.json b/src/data/Software/services.json index 134e7f8..bf6f495 100644 --- a/src/data/Software/services.json +++ b/src/data/Software/services.json @@ -1,22 +1,32 @@ -[ +{ + "services":[ { "icon": "/assets/img/icons/serv_icons/10.png", - "title": "IT Consultation", - "details": "We provide best IT solutions for any type of business as stragegy, management." + "title_es": "Consulta de TI", + "details_es": "Brindamos las mejores soluciones de TI para cualquier tipo de negocio como estrategia y gestión.", + "title_en": "IT Consultation", + "details_en": "We provide best IT solutions for any type of business as stragegy, management." }, { "icon": "/assets/img/icons/serv_icons/11.png", - "title": "Software Development", - "details": "We bring methods for design and development as website, mobile app, etc" + "title_es": "Desarrollo de software", + "details_es": "Aportamos métodos para el diseño y desarrollo como sitio web, aplicación móvil, etc.", + "title_en": "Software Development", + "details_en": "We bring methods for design and development as website, mobile app, etc" }, { "icon": "/assets/img/icons/serv_icons/12.png", - "title": "Data Security", - "details": "Analys & Management Big Data alway big issue of companies management." + "title_es": "Seguridad de datos", + "details_es": "Análisis y Gestión Big Data siempre es un gran tema en la gestión de las empresas.", + "title_en": "Data Security", + "details_en": "Analys & Management Big Data alway big issue of companies management." }, { "icon": "/assets/img/icons/serv_icons/13.png", - "title": "AI Machine Learning", - "details": "Turn AI & Machine Learning in the life. Enhance the quality and the effeciency" + "title_es": "Aprendizaje automático de IA", + "details_es": "Convierta la IA y el aprendizaje automático en la vida. Mejorar la calidad y la eficiencia.", + "title_en": "AI Machine Learning", + "details_en": "Turn AI & Machine Learning in the life. Enhance the quality and the effeciency" } -] \ No newline at end of file +] +} \ No newline at end of file diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 7e8c201..32f6639 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -25,7 +25,7 @@ const HomeSoftwareCompanyOnePage = () => { - + {/* */} diff --git a/static/assets/css/elements/_header.css b/static/assets/css/elements/_header.css index e4fbb30..5129e8b 100644 --- a/static/assets/css/elements/_header.css +++ b/static/assets/css/elements/_header.css @@ -194,7 +194,7 @@ header.style-3::before { header.style-3 .main-img { position: absolute; right: 0; - top: 200px; + top: 150px; width: 55%; height: calc(100% - 300px); -o-object-fit: contain; @@ -222,7 +222,7 @@ header.style-3 .main-img .circle { header.style-3 .main-img .logo_shap { position: absolute; - top: 37%; + top: 45%; right: 39%; width: 17%; } diff --git a/static/assets/css/style.css b/static/assets/css/style.css index 21ec0a2..6c1f757 100644 --- a/static/assets/css/style.css +++ b/static/assets/css/style.css @@ -2870,7 +2870,7 @@ header.style-3 { header.style-3 .main-img { position: absolute; right: 0; - top: 200px; + top: 150px; width: 55%; height: calc(100% - 300px); -o-object-fit: contain; @@ -2892,7 +2892,7 @@ header.style-3 { animation: rotate-center 100s linear infinite both; } header.style-3 .main-img .logo_shap { position: absolute; - top: 37%; + top: 45%; right: 39%; width: 17%; } header.style-3 .content .info .h1 { diff --git a/static/data/about.json b/static/data/about.json index aca5a82..132ff4d 100644 --- a/static/data/about.json +++ b/static/data/about.json @@ -2,27 +2,39 @@ "about": { "numbers": [ { - "value": "1,2k", - "title": "Projects done" + "value": "50", + "title": "Proyectos realizados", + "title2":"Projects done" }, { "value": "165", - "title": "satisfied clients" + "title": "Clientes satisfechos", + "title2":"satisfied clients" }, { - "value": "26", - "title": "awards winner" - }, - { - "value": "15", - "title": "years of experience" + "value": "5", + "title": "años de experiencia", + "title2":"years of experience" } ], "features": [ - "Latest IT Solutions & Integration With Blockchain", - "Over 100+ Payment Gateways Support", - "AI Machine & Deep Learning", - "Dedicated Support 24/7" + { + "titleEs":"Últimas soluciones de TI e integración con Blockchain", + "titleEn":"Latest IT Solutions & Integration With Blockchain" + }, + { + "titleEs":"Soporte para más de 100 pasarelas de pago", + "titleEn":"Over 100+ Payment Gateways Support" + }, + { + "titleEs":"Máquina de IA y aprendizaje profundo", + "titleEn":"AI Machine & Deep Learning" + }, + { + "titleEs":"Soporte dedicado 24/7", + "titleEn":"Dedicated Support 24/7" + } + ] } } \ No newline at end of file diff --git a/static/data/blog.json b/static/data/blog.json index 3806b2e..c111301 100644 --- a/static/data/blog.json +++ b/static/data/blog.json @@ -3,33 +3,39 @@ "blogs": [ { "cover": "/assets/img/blog/6.png", - "type": "tips & tricks", - "time": "12 Days ago", - "title": "How To Become A Python Develop Expert", + "type": { + "en": "tips & tricks", + "es": "trucos & tips" + }, + "time_en": "12 Days ago", + "title_en": "How To Become A Python Develop Expert", + "type_es": "trucos & tips", + "time_es": "Hace 12 días", + "title_es": "Cómo convertirse en un experto en desarrollo de Python", "userImage": "a", - "username": "Admin", - "comments": "24", - "views": "774k" + "username": "Admin" }, { "cover": "/assets/img/blog/7.png", - "type": "News", - "time": "5 Days ago", - "title": "AI With Fingerprint", + "type_en": "News", + "time_en": "5 Days ago", + "title_en": "AI With Fingerprint", + "type_es": "Noticias", + "time_es": "Hace 5 días", + "title_es": "IA con huella digital", "userImage": "a", - "username": "David", - "comments": "24", - "views": "774k" + "username": "Admin" }, { "cover": "/assets/img/blog/8.png", - "type": "tips & tricks", - "time": "1 month ago", - "title": "Solutions For Big Data Issue, Expert Perspective", + "type_en": "tips & tricks", + "time_en": "1 month ago", + "title_en": "Solutions For Big Data Issue, Expert Perspective", + "type_es": "trucos & tips", + "time_es": "Hace 1 mes", + "title_es": "Soluciones para el problema de Big Data, perspectiva de expertos", "userImage": "a", - "username": "Moussa", - "comments": "24", - "views": "774k" + "username": "Admin" } ], "faq": [ @@ -61,6 +67,17 @@ "/assets/img/logos/4.png", "/assets/img/logos/5.png", "/assets/img/logos/6.png" - ] + ], + "text_traductions":{ + "blog_title1_es":"

Nextream Noticias

", + "all_articles_es":"Ver artículos", + "by_es":"Por", + "see_more_es":"Ver Más", + "blog_title1_en":"

Nextream's Journal

", + "all_articles_en":"All Articles", + "by_en":"By", + "see_more_en":"See More" + } + +} } -} \ No newline at end of file diff --git a/static/data/header.json b/static/data/header.json new file mode 100644 index 0000000..b66787b --- /dev/null +++ b/static/data/header.json @@ -0,0 +1,23 @@ + + { + "headers":{ + "es": { + "header_1":"Haz tu vida más fácil con la ayuda de Nextream", + "header_2":"Ayudamos a las empresas a aumentar su valor mediante el desarrollo de software personalizado, diseño de productos, control de calidad y servicios de consultoría.", + "header_3":"Nos pondremos en contacto en 24h.", + "get_free_quotes": "¡Obtenga una cotización gratuita!", + "your_email":"Su correo electrónico *", + "inquiry_about":"Su consulta sobre", + "request_a_consultation":"¡Solicite una consulta!" + }, + "en": { + "get_free_quotes": "Get Free Quotes!", + "header_1":" Make your life easier with help from Nextream", + "header_2":"We help businesses elevate their value through custom software development, product design, QA & consultancy services.", + "header_3":"We’ll contact back in 24h", + "your_email":"Su correo electrónico *", + "inquiry_about":"Your inquiry about", + "request_a_consultation":"Request a consultation!" + } + } +} \ No newline at end of file diff --git a/static/data/services.json b/static/data/services.json index 134e7f8..e7ded28 100644 --- a/static/data/services.json +++ b/static/data/services.json @@ -1,22 +1,32 @@ -[ - { - "icon": "/assets/img/icons/serv_icons/10.png", - "title": "IT Consultation", - "details": "We provide best IT solutions for any type of business as stragegy, management." - }, - { - "icon": "/assets/img/icons/serv_icons/11.png", - "title": "Software Development", - "details": "We bring methods for design and development as website, mobile app, etc" - }, - { - "icon": "/assets/img/icons/serv_icons/12.png", - "title": "Data Security", - "details": "Analys & Management Big Data alway big issue of companies management." - }, - { - "icon": "/assets/img/icons/serv_icons/13.png", - "title": "AI Machine Learning", - "details": "Turn AI & Machine Learning in the life. Enhance the quality and the effeciency" - } -] \ No newline at end of file +{ + "services":[ + { + "icon": "/assets/img/icons/serv_icons/10.png", + "title_es": "Consulta de TI", + "details_es": "Brindamos las mejores soluciones de TI para cualquier tipo de negocio como estrategia y gestión.", + "title_en": "IT Consultation", + "details_en": "We provide best IT solutions for any type of business as stragegy, management." + }, + { + "icon": "/assets/img/icons/serv_icons/11.png", + "title_es": "Desarrollo de software", + "details_es": "Aportamos métodos para el diseño y desarrollo como sitio web, aplicación móvil, etc.", + "title_en": "Software Development", + "details_en": "We bring methods for design and development as website, mobile app, etc" + }, + { + "icon": "/assets/img/icons/serv_icons/12.png", + "title_es": "Seguridad de datos", + "details_es": "Análisis y Gestión Big Data siempre es un gran tema en la gestión de las empresas.", + "title_en": "Data Security", + "details_en": "Analys & Management Big Data alway big issue of companies management." + }, + { + "icon": "/assets/img/icons/serv_icons/13.png", + "title_es": "Aprendizaje automático de IA", + "details_es": "Convierta la IA y el aprendizaje automático en la vida. Mejorar la calidad y la eficiencia.", + "title_en": "AI Machine Learning", + "details_en": "Turn AI & Machine Learning in the life. Enhance the quality and the effeciency" + } + ] + } \ No newline at end of file diff --git a/static/data/testimonials.json b/static/data/testimonials.json index 27ec8cb..de5e386 100644 --- a/static/data/testimonials.json +++ b/static/data/testimonials.json @@ -17,6 +17,12 @@ "image": "/assets/img/testimonials/user2.jpeg", "author": "Lucas Digne", "positon": "Product Management at Invisionapp" + }, + { + "text": "“Iteck’s Experts really is amazing! high speciality, professional and friendly. Our profit increased so much. Really very satisfied!”", + "image": "/assets/img/testimonials/user2.jpeg", + "author": "Cesar Mendivil", + "positon": "Product Management at Invisionapp" } ] } \ No newline at end of file