Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update locales to include french #1094

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = {
},
i18n: {
translationsPath: `${__dirname}/src/i18n/translations`,
additionalLocales: ['jp', 'kr', 'pt', 'es'],
additionalLocales: ['jp', 'kr', 'pt', 'es', 'fr'],
},
layout: {
component: require.resolve('./src/layouts'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const onPreRenderHTML = ({
replaceHeadComponents,
pathname,
}) => {
const languages = { kr: 'ko', jp: 'ja', es: 'es', pt: 'pt-br' };
const languages = { kr: 'ko', jp: 'ja', es: 'es', pt: 'pt-br', fr: 'fr-fr' };

const getCurrentLanguage = () => {
let matchingLanguage = 'en';
Expand Down
1 change: 1 addition & 0 deletions packages/gatsby-theme-newrelic/src/components/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const i18nNetlifySites = [
'docs-website-jp.netlify.app/jp/',
'docs-website-es.netlify.app/es/',
'docs-website-pt.netlify.app/pt/',
'docs-website-fr.netlify.app/fr/',
];
const isI18nNetlifySite = (to) =>
i18nNetlifySites.some((site) => to.includes(site));
Expand Down
89 changes: 89 additions & 0 deletions packages/gatsby-theme-newrelic/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"404": {
"headingText": "Hmm... We can't find this",
"searchInputLabel": "Try refining your search.",
"searchResultMessage": "Were you looking for any of these?",
"docsHomeMessage": "Go back to <1>{{nrSubDomain}} home</1>.",
"fileIssueMessage": "Still can't find what you're looking for?"
},
"button": {
"close": "Close",
"copied": "Copied",
"copy": "Copy",
"login": "Log in",
"startNow": "Start now"
},
"callout": {
"tip": "Tip",
"caution": "Caution",
"important": "Important",
"course": "Course"
},
"github": {
"createIssue": "Create issue",
"editPage": "Edit this doc"
},
"contributing": {
"guide": "Suggest a change and learn how to <1>contribute</1>"
},
"cookieConsent": {
"title": "This site uses cookies",
"statement": "We use cookies and other similar technologies (\"Cookies\") on our websites and services to enhance your experience and to provide you with relevant content. By using our websites and services you are agreeing to the use of cookies. You can read more <2>here</2>. If you consent to our cookies, please click <4>Yes</4>.",
"agree": "Yes",
"disagree": "No"
},
"feedback": {
"question": "Was this doc helpful?",
"yes": "Yes",
"no": "No",
"comments": "Tell us more (optional)",
"email": "Your email (optional)",
"emailDisclaimer": "We'll only use this email for follow-up questions about your feedback.",
"validEmail": "Please provide a valid email",
"submitButton": "Submit feedback",
"submitMessage": "Thanks for your detailed feedback",
"reset": "Reset"
},
"footer": {
"copyright": "Copyright {{copyrightSymbol}} {{year}} New Relic Inc.",
"careers": "Careers",
"terms": "Terms of Service",
"dmcaPolicy": "DMCA Policy",
"privacyNotice": "Privacy Notice",
"privacyChoices": "Your Privacy Choices",
"cookiePolicy": "Cookie Policy",
"ukSlaveryAct": "UK Slavery Act"
},
"inlineSignup": {
"ctaButton": "Start now",
"ctaText": "Sign up and install",
"emailLabel": "Company Email",
"emailValidationHint": "Please format your email like \"[email protected]\"",
"nameLabel": "Name",
"nameValidationHint": "Please enter your name",
"submitError": "An error occurred trying to create your account. Please try again later.",
"terms": "100 GB + 1 user free. Forever. No credit card required.<1 />By signing up you're agreeing to <4>Terms of Service</4> and <8>Services Privacy Notice.</8>"
},
"licenseKey": {
"buttonText": "license key",
"popover": {
"header": "License key",
"explainer": "Your license key is used to associate your incoming data with your account.",
"learnMore": "Learn more",
"getYourKey": "Get your key",
"createAccount": "Create account"
}
},
"mobileNav": {
"header": "Pages"
},
"relatedResources": {
"title": "Related resources"
},
"searchInput": {
"placeholder": "Search docs"
},
"tableOfContents": {
"title": "On this page"
}
}
9 changes: 8 additions & 1 deletion packages/gatsby-theme-newrelic/src/utils/config/i18n.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DEFAULT_NAMESPACE = 'translation';
const SUPPORTED_LOCALES = ['en', 'jp', 'kr', 'es', 'pt'];
const SUPPORTED_LOCALES = ['en', 'jp', 'kr', 'es', 'pt', 'fr'];
const THEME_NAMESPACE = 'gatsby-theme-newrelic';

const LOCALE_CONFIGS = {
Expand Down Expand Up @@ -38,6 +38,13 @@ const LOCALE_CONFIGS = {
hrefLang: 'pt',
isDefault: false,
},
fr: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add 'fr' here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💀 yep definitely. without it it won't pick up the french json we use for a lot of our components but i didn't test that because we don't have any json in french yet, whoops

name: 'French',
localName: 'Français',
locale: 'fr',
hrefLang: 'fr',
isDefault: false,
},
};

const uniq = (arr) => [...new Set(arr)];
Expand Down
Loading