Skip to content

Commit

Permalink
read event name as const eventName from config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sebalis committed Dec 23, 2021
1 parent 5d49484 commit c4afcc1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
11 changes: 7 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const MONTH = 30 * 24 * 60 * 60 * 1000;
// Load config
import * as config from './config';

const eventName = config.eventName;

const isProduction = process.env.NODE_ENV === 'production';
if (!isProduction) {
log.warn('NODE_ENV is not set to production. Actual value: %s', process.env.NODE_ENV);
Expand Down Expand Up @@ -138,13 +140,13 @@ app.get('/', (req: PotentiallyAuthenticatedRequest, res) => {
const { isAuthorized } = req;
const scheduleVersion = Talk.getScheduleVersion();
return Talk.allSorted().then(talks =>
res.render('index', { talks, isAuthorized, scheduleVersion })
res.render('index', { talks, isAuthorized, eventName, scheduleVersion })
);
});

app.get('/impressum', (req: PotentiallyAuthenticatedRequest, res) => {
const { isAuthorized } = req;
res.render('impressum', { isAuthorized });
res.render('impressum', { isAuthorized, eventName });
});

function ensureExistence<T>(thing?: T | null): T {
Expand All @@ -171,6 +173,7 @@ app.get('/talks/:slug', (req: PotentiallyAuthenticatedRequest, res, next) => {
})
.then(({ talk, comments }) => {
res.render('talk', {
eventName,
talk,
comments,
uploadCount,
Expand Down Expand Up @@ -274,6 +277,6 @@ app.use((err: Error, req: express.Request, res: express.Response, next: express.
res.status(status).render('error', { status });
});

app.listen(9000, () => {
log.info('App listening on :9000');
app.listen(9009, () => {
log.info('App listening on :9009');
});
8 changes: 4 additions & 4 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"one": "Wir haben deine Datei erhalten.",
"other": "Wir haben deine %s Dateien erhalten."
},
"THANKS_FOR_HELPING": "Danke, dass du uns dabei hilfst, den 36c3 für alle zugänglich zu machen.",
"THANKS_FOR_HELPING": "Danke, dass du uns dabei hilfst, den %s für alle zugänglich zu machen.",
"Add a comment if you like": "Füge einen Kommentar hinzu, wenn du möchtest",
"We’ll only use the files you upload to help us provide simultaneous interpretations of talks at this event. We won’t share them outside our group of volunteers without your consent.": "Wir werden die Dateien, die du hochlädst, nur für unsere Simultanübersetzungen der Vorträge auf dem 36c3 nutzen. Wir werden sie nicht ohne deine Einwilligung mit anderen teilen.",
"We’ll only use the files you upload to help us provide simultaneous interpretations of talks at this event. We won’t share them outside our group of volunteers without your consent.": "Wir werden die Dateien, die du hochlädst, nur für unsere Simultanübersetzungen der Vorträge auf dem %s nutzen. Wir werden sie nicht ohne deine Einwilligung mit anderen teilen.",
"Once uploaded, we’ll only display part of the file name and the date of its last modification.": "Sobald deine Dateien hochgeladen sind, zeigen wir nur noch den Dateinamen und das Datum der letzen Änderung.",
"Upload Files": "Dateien hochladen",
"Uploaded So Far": "Bisher hochgeladen",
Expand All @@ -19,12 +19,12 @@
"Start typing to find talks by name or speaker": "Beginne zu tippen, um Vorträge nach Titel oder Vortragenden zu durchsuchen",
"%s files uploaded": "[0] Keine Datei hochgeladen|[1] 1 Datei hochgeladen|%s Dateien hochgeladen",
"Talks": "Talks",
"INTRO_TEXT": "Auch dieses Jahr werden wir wieder viele Vorträge auf dem 36c3 von Deutsch ins Englische übersetzen (und umgekehrt). Weil die Vorträge so ein riesiges Themenspektrum abdecken, bereiten wir gern für jeden Vortrag einen Glossar vor. Wenn du einen Vortrag auf dem Kongress hältst, kannst du uns helfen, indem du uns dein Material schickst, das uns dabei helfen kann, zum Beispiel Präsentationsfolien oder Manuskripte.",
"INTRO_TEXT": "Auch dieses Jahr werden wir wieder viele Vorträge auf dem %s von Deutsch ins Englische übersetzen (und umgekehrt). Weil die Vorträge so ein riesiges Themenspektrum abdecken, bereiten wir gern für jeden Vortrag einen Glossar vor. Wenn du einen Vortrag auf dem Kongress hältst, kannst du uns helfen, indem du uns dein Material schickst, das uns dabei helfen kann, zum Beispiel Präsentationsfolien oder Manuskripte.",
"INTRO_GET_STARTED": "Um zu beginnen, wähle bitte deinen Vortrag aus der Liste.",
"We’ll take any file type, up to 50 MB each": "Wir nehmen alles; bis zu 50 MB pro Datei",
"Error %s": "Fehler %s",
"The requested page could not be found.": "Die gesuchte Seite wurde nicht gefunden.",
"HELP_US_TRANSLATE_EVENT": "Hilf uns, den 36c3 zu übersetzen",
"HELP_US_TRANSLATE_EVENT": "Hilf uns, den %s zu übersetzen",
"Questions? Email us at %s": "Noch Fragen? Du erreichst uns unter %s",
"DATE_TIME": "D. MMMM YYYY, HH:mm [UTC] Z",
"calculating": "wird berechnet",
Expand Down
8 changes: 4 additions & 4 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"one": "We’ve received your file.",
"other": "We’ve received your %s files."
},
"THANKS_FOR_HELPING": "Thanks for helping us make 36c3 more accessible.",
"THANKS_FOR_HELPING": "Thanks for helping us make %s more accessible.",
"Add a comment if you like": "Add a comment if you like",
"We’ll only use the files you upload to help us provide simultaneous interpretations of talks at this event. We won’t share them outside our group of volunteers without your consent.": "We’ll only use the files you upload to help us provide simultaneous interpretations of talks at 36c3. We won’t share them outside our group of volunteers without your consent.",
"We’ll only use the files you upload to help us provide simultaneous interpretations of talks at this event. We won’t share them outside our group of volunteers without your consent.": "We’ll only use the files you upload to help us provide simultaneous interpretations of talks at %s. We won’t share them outside our group of volunteers without your consent.",
"Once uploaded, we’ll only display part of the file name and the date of its last modification.": "Once uploaded, we’ll only display part of the file name and the date of its last modification.",
"Upload Files": "Upload Files",
"Uploaded so far": "Uploaded so far",
Expand All @@ -20,12 +20,12 @@
"%s files uploaded": "[0] No files uploaded|[1] 1 file uploaded|%s files uploaded",
"Uploaded So Far": "Uploaded So Far",
"Talks": "Talks",
"INTRO_TEXT": "As in previous years, many talks at 36c3 are going to be simultaneously translated from English to German (and vice-versa). Because talks cover such a huge array of topics, we like to prepare a glossary for each talk. If you’re speaking at the congress, you can really help us out by submitting any documents that can help us prepare a glossary, such as presentation slides or a manuscript.",
"INTRO_TEXT": "As in previous years, many talks at %s are going to be simultaneously translated from English to German (and vice-versa). Because talks cover such a huge array of topics, we like to prepare a glossary for each talk. If you’re speaking at the congress, you can really help us out by submitting any documents that can help us prepare a glossary, such as presentation slides or a manuscript.",
"INTRO_GET_STARTED": "To get started, choose your talk from the list below.",
"We’ll take any file type, up to 50 MB each": "We’ll take any file type, up to 50 MB each",
"Error %s": "Error %s",
"The requested page could not be found.": "The requested page could not be found.",
"HELP_US_TRANSLATE_EVENT": "Help Us Translate 36c3",
"HELP_US_TRANSLATE_EVENT": "Help Us Translate %s",
"Questions? Email": "Questions? Email",
"Questions? Email us at %s": "Questions? Email us at %s",
"DATE_TIME": "D MMMM YYYY HH:mm [UTC] Z",
Expand Down
6 changes: 3 additions & 3 deletions views/index.pug
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
extends layout.pug

block title
title= __('HELP_US_TRANSLATE_EVENT') + '' + __('SITE_NAME')
title= __('HELP_US_TRANSLATE_EVENT', eventName) + '' + __('SITE_NAME')

block scripts
script(type='text/javascript', src='static/index.js')

block content
h1= __('HELP_US_TRANSLATE_EVENT')
p= __('INTRO_TEXT')
h1= __('HELP_US_TRANSLATE_EVENT', eventName)
p= __('INTRO_TEXT', eventName)
p= __('INTRO_GET_STARTED')
p.input-group
label(for='filter').input-group-addon
Expand Down
4 changes: 2 additions & 2 deletions views/talk.pug
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ block content
else if commentCount > 0
= __('We’ve received your comment.')
=' '
strong= __('THANKS_FOR_HELPING')
strong= __('THANKS_FOR_HELPING', eventName)
else if nothingReceived
.alert.alert-danger
strong= __(`Sorry, we didn’t catch that.`)
Expand Down Expand Up @@ -44,7 +44,7 @@ block content
label(for='textarea-comment')= __('Add a comment if you like')
textarea#textarea-comment.form-control(rows=5, name='comment')
p.help-block
=__('We’ll only use the files you upload to help us provide simultaneous interpretations of talks at this event. We won’t share them outside our group of volunteers without your consent.')
=__('We’ll only use the files you upload to help us provide simultaneous interpretations of talks at this event. We won’t share them outside our group of volunteers without your consent.', eventName)
p.help-block
=__('Once uploaded, we’ll only display part of the file name and the date of its last modification.')
input.btn.btn-primary(type='submit', value=__('Upload Files'))
Expand Down

0 comments on commit c4afcc1

Please sign in to comment.