Skip to content

Commit 2474b90

Browse files
authored
Merge pull request #14 from coderbunker/translation-namespaces
[ADD] Translation namespaces
2 parents cef26db + ad20728 commit 2474b90

File tree

10 files changed

+24
-52
lines changed

10 files changed

+24
-52
lines changed

gatsby-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = {
4949
languages: [`en`, `fr`],
5050
defaultLanguage: `en`,
5151
// if you are using Helmet, you must include siteUrl, and make sure you add http:https
52-
siteUrl: `https://example.com/`,
52+
siteUrl: `https://coderbunker.ca/`,
5353
// you can pass any i18next options
5454
i18nextOptions: {
5555
interpolation: {

locales/en/translation.json

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
{
22
"Home": "Accueil",
3-
"Hi people": "Bonjour!",
4-
"Welcome to your new Gatsby site.": "Bienvenue à votre site Gatsby.",
5-
"Now go build something great.": "Allez bâtir quelque chose d'extraordinaire.",
6-
"Go to page 2": "Allez à la page 2",
7-
"Page two": "Page deux",
8-
"Hi from the second page": "Salut de page deux",
9-
"Welcome to page 2": "Bienvenue à la page deux",
10-
"Go back to the homepage": "Retour à la Maison",
113
"Introducing Coderbunker in the ": "Présentation de Coderbunker dans le ",
124
"North": "Nord",
135
"We empower freelancer community to excel in long term projects.": "Nous permettons à une communauté des pigistes d'exceller dans les projets à long terme.",
@@ -24,14 +16,6 @@
2416
"Connect": "Connectez-vous",
2517
" With Us": " avec nous",
2618
"We fuel your tech capability with our network of freelancers.": "Nous alimentons votre capacité technologique avec notre réseau de pigistes.",
27-
"25 years experience in software development": "25 ans d'expérience dans le développement de logiciels",
28-
"System Administrator": "Administrateur Système",
29-
"Background in university research (quantum chemistry, attosecond science)": "Expérience en recherche universitaire (Chimie Quantique, science attoseconde)",
30-
"5 years of experience in software development": "5 ans d'expérience en développement logiciel",
31-
"Prototyping, agility, design, R&D": "Prototypage, agilité, design, R&D",
32-
"Python, Bash, Javascript, C/C++, Fortran": "Python, Bash, Javascript, C/C++, Fortran",
33-
"Devops (Linux, Ansible, Cloud, Docker)": "Devops (Linux, Ansible, Cloud, Docker)",
34-
"Data analysis": "Analyse de données",
3519
"Have a Project? Interested in Joining Force?": "Vous avez un projet? Vous êtes intéressés à vous joindre à nous?",
3620
"We strive to raise the bar of technical expertise.": "Nous élevons la barre de l'expertise technique",
3721
"We keep it simple.": "Nous favorisons la simplicité",
@@ -40,5 +24,9 @@
4024
"Assemble the team based on your problem. Convert dollars to value right away.": "Assemblez une équipe rapidement basé sur vos défis. Convertissez rapidement des dollars en valeur",
4125
"Iteratively develop": "Développement itératif",
4226
"Continual improvement to develop a tailored. sustainable and scalable solution.": "Amélioration constante pour développer des solutions durables et évolutives",
43-
"We are 50+ International Digital Talents and growing!": "Nous sommes 50+ talents digital international et en croissance"
27+
"We are 50+ International Digital Talents and growing!": "Nous sommes 50+ talents digital international et en croissance",
28+
"Name": "Nom",
29+
"Email": "Courriel",
30+
"Message": "Message",
31+
"Send": "Envoyer"
4432
}

locales/fr/team.fr.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"25 years experience in software development": "25 ans d'expérience dans le développement de logiciels",
3+
"System Administrator": "Administrateur Système",
4+
"Background in university research (quantum chemistry, attosecond science)": "Expérience en recherche universitaire (Chimie Quantique, science attoseconde)",
5+
"5 years of experience in software development": "5 ans d'expérience en développement logiciel",
6+
"Prototyping, agility, design, R&D": "Prototypage, agilité, design, R&D",
7+
"Python, Bash, Javascript, C/C++, Fortran": "Python, Bash, Javascript, C/C++, Fortran",
8+
"Devops (Linux, Ansible, Cloud, Docker)": "Devops (Linux, Ansible, Cloud, Docker)",
9+
"Data analysis": "Analyse de données"
10+
}

src/components/carousel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Carousel() {
88

99
// query all team pics
1010
const data = useStaticQuery(graphql`{
11-
allFile(filter: {absolutePath: {regex: "/team/"}}, sort: {fields: base}) {
11+
allFile(filter: {absolutePath: {regex: "/portraits/"}}, sort: {fields: base}) {
1212
edges {
1313
node {
1414
base

src/components/contact-form.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect } from "react"
2-
import { Trans } from 'gatsby-plugin-react-i18next';
2+
import { Trans, useTranslation } from 'gatsby-plugin-react-i18next';
33
import styled from 'styled-components';
44

55
import { AiOutlineMail } from 'react-icons/ai';
@@ -81,9 +81,10 @@ export default function ContactForm() {
8181
document.documentElement.style.setProperty("scroll-snap-type", "y mandatory")
8282
})
8383
}
84-
8584
}
8685

86+
const {t} = useTranslation();
87+
8788
return (
8889
<ContactFormStyles
8990
onSubmit={handleSubmit}
@@ -130,14 +131,14 @@ export default function ContactForm() {
130131
<textarea
131132
name="message"
132133
rows="3"
133-
placeholder="Message"
134+
placeholder={t('Message')}
134135
className="mb-2 md:mb-4"
135136
onFocus={handleFocus}
136137
onChange={handleChange}
137138
value={formState.message}
138139
/>
139140
<input type="hidden" name="form-name" value="contact" />
140-
<ButtonRed dataAos="fade-right" dataAosDelay="200" type="submit" text="Send" style={{ float: `right` }} />
141+
<ButtonRed dataAos="fade-right" dataAosDelay="200" type="submit" text={t('Send')} style={{ float: `right` }} />
141142
</ContactFormStyles>
142143
)
143144
}

src/components/stacked-avatar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { GatsbyImage } from "gatsby-plugin-image";
55
export default function StackedAvatar() {
66
// query all team pics
77
const data = useStaticQuery(graphql`{
8-
allFile(filter: {absolutePath: {regex: "/team/"}}, sort: {fields: base}) {
8+
allFile(filter: {absolutePath: {regex: "/portraits/"}}, sort: {fields: base}) {
99
edges {
1010
node {
1111
base

src/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function IndexPage() {
3535

3636
export const query = graphql`
3737
query($language: String!) {
38-
locales: allLocale(filter: {language: {eq: $language}}) {
38+
locales: allLocale(filter: {ns: {in: ["index", "team.fr"]}, language: {eq: $language}}) {
3939
edges {
4040
node {
4141
ns

0 commit comments

Comments
 (0)