diff --git a/data/locale.yml b/data/locale.yml index 8a636344e..bab5e7194 100644 --- a/data/locale.yml +++ b/data/locale.yml @@ -33,10 +33,46 @@ languages: community: title: Electron Community description: - Tools, boilerplates, videos, and more from Electron's - awesome - open-source contributors. Find or add - meetups near you. + Resources for connecting with people working on Electron. + channels: + help: + "For help or feedback on Electron app development, join the + atomio Slack, + post questions on + Discuss, + or see existing Electron-related questions on + Stack Overflow." + bugs: + "To report a bug in Electron, open an issue on the + electron/electron + repository." + feature_requests: + "To make a feature request, open an issue on the + electron/electron + repository." + code_of_conduct: + "To report violations of our + Code of Conduct, + email + coc@electronjs.org." + security: + "To report a security vulnerability in Electron, email + security@electronjs.org." + updates: + "To stay up to date on Electron developments, follow + @electronjs on Twitter, + and subscribe to the + Blog RSS feed." + other: + "For all other inquiries, email info@electronjs.org." + language_communities: + title: Language Communities + description: + "The Electron community spans the globe, and English is not everyone's first language. + Find + documentation in your language, + or join one of the language communities below:" + tools: Tools boilerplates: Boilerplates components: Components diff --git a/lib/i18n.js b/lib/i18n.js index 136af6574..0cde19522 100644 --- a/lib/i18n.js +++ b/lib/i18n.js @@ -12,7 +12,9 @@ const websiteKeys = Object.keys(flat(websiteStrings)) locales.forEach(locale => { websiteKeys.forEach(key => { const deepKey = `website.${locale}.${key}` - if (!get(i18n, deepKey)) { + // Always use local locale.yml data for English, + // and backfill to English for missing entries in other languages. + if (locale === 'en-US' || !get(i18n, deepKey)) { set(i18n, deepKey, get(websiteStrings, key)) } }) diff --git a/routes/contact.js b/routes/contact.js deleted file mode 100644 index 54ce2d6ac..000000000 --- a/routes/contact.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = (req, res) => { - res.render('contact', Object.assign(req.context, {})) -} diff --git a/server.js b/server.js index 597e1a2bc..8b1f9bc48 100644 --- a/server.js +++ b/server.js @@ -69,7 +69,7 @@ app.get('/awesome', (req, res) => res.redirect('/community')) app.get('/blog.json', routes.feed.blog) app.get('/blog.xml', routes.feed.blog) app.get('/community', routes.community) -app.get('/contact', routes.contact) +app.get('/contact', (req, res) => res.redirect(301, '/community')) app.get('/devtron', routes.devtron) app.get('/docs', routes.docs.index) app.get('/docs/versions', (req, res) => res.redirect(301, '/releases')) diff --git a/test/index.js b/test/index.js index bb66b821f..333f01fe4 100644 --- a/test/index.js +++ b/test/index.js @@ -324,6 +324,12 @@ describe('electronjs.org', () => { const $ = cheerio.load(res.text) $('.subtron .container-narrow h1').text().should.eq(i18n.website['vi-VN'].community.title) }) + + test('/contact redirects to /community', async () => { + const res = await supertest(app).get('/contact') + res.statusCode.should.be.equal(301) + res.headers.location.should.equal('/community') + }) }) describe('localized strings for client-side code', () => { diff --git a/views/community.html b/views/community.html index a6e45f981..65ebfad8f 100644 --- a/views/community.html +++ b/views/community.html @@ -7,8 +7,33 @@
-
+
+

📣 {{{localized.community.channels.updates}}}

+

🙋 {{{localized.community.channels.help}}}

+

🐞 {{{localized.community.channels.bugs}}}

+

💡 {{{localized.community.channels.feature_requests}}}

+

👎 {{{localized.community.channels.code_of_conduct}}}

+

🙊 {{{localized.community.channels.security}}}

+

❓ {{{localized.community.channels.other}}}

+
+
+

{{localized.community.language_communities.title}}

+ +

{{{localized.community.language_communities.description}}}

+ + +
+ +

{{localized.community.tools}}

{{#each items}} diff --git a/views/contact.html b/views/contact.html deleted file mode 100644 index 1d0e9dc35..000000000 --- a/views/contact.html +++ /dev/null @@ -1,36 +0,0 @@ -
-
-

Get in touch

-
-
- -
-
- -
-

GitHub

-

@electron

-
- -
-

Twitter

-

@electronjs

-
- -
-

Slack

-

atomio.slack.com

-
- - - -
-

Email

-

info@electronjs.org

-
- -
-