Skip to content

Commit

Permalink
Merge pull request #249 from markalbrand56/front_searchbar
Browse files Browse the repository at this point in the history
language addition home
  • Loading branch information
angelcast2002 authored Nov 14, 2023
2 parents f5093df + dec85dc commit 228a81d
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 15 deletions.
2 changes: 2 additions & 0 deletions uniEmpleos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"eslint": "^7.32.0 || ^8.2.0",
"i18next": "^23.7.6",
"joi": "^17.9.2",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-i18next": "^13.4.1",
"react-icons": "^4.11.0",
"react-quill": "^2.0.0",
"react-quilljs": "^1.3.3",
Expand Down
1 change: 1 addition & 0 deletions uniEmpleos/public/images/en.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions uniEmpleos/public/images/es.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions uniEmpleos/src/components/LanguageButton/LanguageButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React, { useState } from "react"
import { useTranslation } from "react-i18next"
import i18n from "../../i18n"
import style from "./LanguageButton.module.css"

const LanguageButton = () => {
const [language, setLanguage] = useState("es")

const changeLanguage = () => {
if (language === "es") {
setLanguage("en")
i18n.changeLanguage("en")
} else {
setLanguage("es")
i18n.changeLanguage("es")
}
}

return (
<div className={style.languageButton}>
<button
type="button"
className={style.mainButton}
onClick={changeLanguage}
>
<img
src={language === "es" ? "/images/en.svg" : "/images/es.svg"}
alt="English"
className={style.imgButton}
/>
</button>
</div>
)
}

export default LanguageButton
21 changes: 21 additions & 0 deletions uniEmpleos/src/components/LanguageButton/LanguageButton.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.languageButton{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin: 0;
position: fixed;
bottom: 10px;
right: 10px;
}

.mainButton{
border-radius: 10px;
background-color: transparent;
margin: 0;
}

.imgButton{
height: 40px;
width: 40px;
}
21 changes: 21 additions & 0 deletions uniEmpleos/src/i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import i18n from "i18next"
import { initReactI18next } from "react-i18next"
import enTranslations from "./locales/en/translation.json"
import esTranslations from "./locales/es/translation.json"

i18n.use(initReactI18next).init({
resources: {
en: {
translation: enTranslations,
},
es: {
translation: esTranslations,
},
},
lng: "en",
interpolation: {
escapeValue: false,
},
})

export default i18n
36 changes: 36 additions & 0 deletions uniEmpleos/src/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"home": {
"title1": "What is UniEmpleos?",
"desc1": "UniEmpleos is a platform that enables students from various universities in Guatemala to find job offers and professional internships.",
"title2": "How does it work?",
"desc2": "Companies publish their job offers and students can apply to them. The companies can view the profiles of the students and contact them."
},
"intro": {
"description": "Guatemalan lawyer with experience in strategic analysis, political analysis and advisory to boards. Currently, I am the Executive President of the National Civic Movement. I participated in the 2022-2023 cohort of the Millennium Leadership Program at the Atlantic Council. On this website, I share reflections and resources to understand the sociopolitical environment in which we live."
},
"podcast": {
"title": "Podcast",
"listen": "Listen",
"description": "We educate about the impact that politics, social relations, and economics have on society. We motivate to exercise individual sovereignty to achieve positive impacts on society. Being increasingly aware of the potential impact of our actions."
},
"resources": {
"title": "Resources",
"categories": [
"All",
"Press",
"News",
"Articles"
]
},
"analysis": {
"title": "Analysis"
},
"contact": {
"title": "Get in Touch",
"subtitle": "Contact",
"collaborate": "I want to collaborate",
"motto": "The republic is still alive",
"address": "Address",
"media": "Social Media"
}
}
36 changes: 36 additions & 0 deletions uniEmpleos/src/locales/es/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"home": {
"title1": "¿Qué es UniEmpleos?",
"desc1": "UniEmpleos es una plataforma que permite a los estudiantes de distintas Universidades de Guatemala encontrar ofertas de trabajo y prácticas profesionales.",
"title2": "¿Cómo funciona?",
"desc2": "Las empresas publican sus ofertas de trabajo y los estudiantes pueden postular a ellas. Las empresas pueden ver los perfiles de los estudiantes y contactarlos."
},
"intro": {
"description": "Abogado guatemalteco con experiencia en análisis estratégico, análisis político y asesorías a directivas. Actualmente soy Presidente Ejecutivo del Movimiento Cívico Nacional. Participé en el cohorte 2022-2023 del Millenium Leadership Program del Atlantic Council. En este website comparto reflexiones y recursos para comprender el entorno sociopolítico en el que vivimos."
},
"podcast": {
"title": "Podcast",
"listen": "Escuchar",
"description": "Educamos sobre el impacto que la política, relaciones sociales y economía tiene en la sociedad. Motivamos a ejercer la soberanía individual para lograr impactos positivos en la sociedad. Ser cada vez más conscientes del potencial impacto de nuestras acciones."
},
"resources": {
"title": "Recursos",
"categories": [
"Todo",
"Prensa",
"Noticias",
"Artículos"
]
},
"analysis": {
"title": "Análisis"
},
"contact": {
"title": "Ponte en Contacto",
"subtitle": "Contacto",
"collaborate": "Quiero colaborar",
"motto": "La república sigue viva",
"address": "Address",
"media": "Redes Sociales"
}
}
32 changes: 18 additions & 14 deletions uniEmpleos/src/pages/Home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import React from "react"
import { Player } from "@lottiefiles/react-lottie-player"
import styles from "./Home.module.css"
import Infocontainer from "../../components/Infocontainer/Infocontainer"
import Button from "../../components/Button/Button"
import { navigate } from "../../store"
import HeaderHome from "../../components/HeaderHome/HeaderHome"
import students from "./students.json"
import LanguageButton from "../../components/LanguageButton/LanguageButton"
import { useTranslation } from "react-i18next"

const Home = () => {
const handleNav = (path) => {
navigate(path)
}

const { t } = useTranslation()
return (
<div className={styles.homeContainer}>
<div className={styles.topcontent}>
Expand All @@ -23,15 +20,21 @@ const Home = () => {
<h1>Uni</h1>
</div>
<div className={styles.lottie}>
<Player autoplay loop src={students}
<Player
autoplay
loop
src={students}
style={{ height: "500px", width: "500px" }}
/>
</div>
<div className={styles.titlephone}>
<h1>UniEmpleos</h1>
</div>
<div className={styles.lottiephone}>
<Player autoplay loop src={students}
<Player
autoplay
loop
src={students}
style={{ height: "400px", width: "400px" }}
/>
</div>
Expand All @@ -41,21 +44,22 @@ const Home = () => {
</div>
<div className={styles.info}>
<Infocontainer
title="¿Qué es UniEmpleos?"
text="UniEmpleos es una plataforma que permite a los estudiantes de distintas
Universidades de Guatemala encontrar ofertas de trabajo y prácticas profesionales."
title={t("home.title1")}
text={t("home.desc1")}
backgroundColor="#A08AE5"
textColor="#fff"
/>
<Infocontainer
title="¿Cómo funciona?"
text="Las empresas publican sus ofertas de trabajo y los estudiantes
pueden postular a ellas. Las empresas pueden ver los perfiles de los estudiantes y contactarlos."
title={t("home.title2")}
text={t("home.desc2")}
backgroundColor="#94BD0F"
textColor="#fff"
/>
</div>
</div>
<div className={styles.footer}>
<LanguageButton />
</div>
</div>
)
}
Expand Down
29 changes: 28 additions & 1 deletion uniEmpleos/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.14.8", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.0", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6":
"@babel/runtime@^7.14.8", "@babel/runtime@^7.22.5", "@babel/runtime@^7.23.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.0", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6":
version "7.23.2"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885"
integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==
Expand Down Expand Up @@ -9190,6 +9190,13 @@ html-minifier-terser@^5.0.1:
relateurl "^0.2.7"
terser "^4.6.3"

html-parse-stringify@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz#dfc1017347ce9f77c8141a507f233040c59c55d2"
integrity sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==
dependencies:
void-elements "3.1.0"

html-tags@^3.1.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.3.1.tgz#a04026a18c882e4bba8a01a3d39cfe465d40b5ce"
Expand Down Expand Up @@ -9285,6 +9292,13 @@ human-signals@^2.1.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==

i18next@^23.7.6:
version "23.7.6"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-23.7.6.tgz#7328e76c899052d5d33d930164612dd21e575f74"
integrity sha512-O66BhXBw0fH4bEJMA0/klQKPEbcwAp5wjXEL803pdAynNbg2f4qhLIYlNHJyE7icrL6XmSZKPYaaXwy11kJ6YQ==
dependencies:
"@babel/runtime" "^7.23.2"

iconv-lite@0.4.24:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
Expand Down Expand Up @@ -12634,6 +12648,14 @@ react-helmet-async@^1.0.7:
react-fast-compare "^3.2.0"
shallowequal "^1.1.0"

react-i18next@^13.4.1:
version "13.4.1"
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.4.1.tgz#cc1fc0422b4652524c8f2f7856fa9b3db4c4dfae"
integrity sha512-z02JvLbt6Gavbuhr4CBOI6vasLypo+JSLvMgUOGeOMPv1g6spngfAb9jWAPwvuavPlKYU4dro9yRduflwyBeyA==
dependencies:
"@babel/runtime" "^7.22.5"
html-parse-stringify "^3.0.1"

react-icons@^4.11.0:
version "4.11.0"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.11.0.tgz#4b0e31c9bfc919608095cc429c4f1846f4d66c65"
Expand Down Expand Up @@ -14965,6 +14987,11 @@ vm-browserify@^1.0.1:
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==

void-elements@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09"
integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==

w3c-xmlserializer@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073"
Expand Down

0 comments on commit 228a81d

Please sign in to comment.