Skip to content

Commit

Permalink
Merge pull request #1094 from newrelic/liz/update-locales
Browse files Browse the repository at this point in the history
Update locales to include french
  • Loading branch information
LizBaker authored Oct 16, 2024
2 parents a77fe8f + 08e23ea commit c5b3deb
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 3 deletions.
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: {
name: 'French',
localName: 'Français',
locale: 'fr',
hrefLang: 'fr',
isDefault: false,
},
};

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

0 comments on commit c5b3deb

Please sign in to comment.