1
0
Fork 0

fix(backend): Various fixes for UK langauge support

This commit is contained in:
joostdecock 2023-08-05 19:18:53 +02:00
parent 2210f26e03
commit 0b441eed58
9 changed files with 33 additions and 29 deletions

View file

@ -118,16 +118,19 @@ model CuratedSet {
nameEs String @default("") nameEs String @default("")
nameFr String @default("") nameFr String @default("")
nameNl String @default("") nameNl String @default("")
nameUk String @default("")
notesDe String @default("") notesDe String @default("")
notesEn String @default("") notesEn String @default("")
notesEs String @default("") notesEs String @default("")
notesFr String @default("") notesFr String @default("")
notesNl String @default("") notesNl String @default("")
notesUk String @default("")
tagsDe String @default("") tagsDe String @default("")
tagsEn String @default("") tagsEn String @default("")
tagsEs String @default("") tagsEs String @default("")
tagsFr String @default("") tagsFr String @default("")
tagsNl String @default("") tagsNl String @default("")
tagsUk String @default("")
measies String @default("{}") measies String @default("{}")
patterns Pattern[] patterns Pattern[]
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt

View file

@ -29,6 +29,7 @@ const createSetData = (data) => ({
tagsEs: JSON.stringify(data.tagsEs), tagsEs: JSON.stringify(data.tagsEs),
tagsNl: JSON.stringify(data.tagsNl), tagsNl: JSON.stringify(data.tagsNl),
tagsFr: JSON.stringify(data.tagsFr), tagsFr: JSON.stringify(data.tagsFr),
tagsUk: JSON.stringify(data.tagsUk),
}) })
// CIS Female Adult // CIS Female Adult
@ -40,11 +41,13 @@ sets.push(
nameEs: `Cis-Mujer Adulta - Talla ${size} (UE)`, nameEs: `Cis-Mujer Adulta - Talla ${size} (UE)`,
nameFr: `Cis-Femme Adulte - Taille ${size} (UE)`, nameFr: `Cis-Femme Adulte - Taille ${size} (UE)`,
nameNl: `Cis-Dame Volwassene - Maat ${size} (EU)`, nameNl: `Cis-Dame Volwassene - Maat ${size} (EU)`,
nameUk: `Cis-Female Adult - Size ${size} (EU)`,
tagsEn: ['cis-female', 'adults', 'eu'], tagsEn: ['cis-female', 'adults', 'eu'],
tagsDe: ['cis-weiblich', 'erwachsene', 'eu'], tagsDe: ['cis-weiblich', 'erwachsene', 'eu'],
tagsEs: ['cis-mujer', 'adulta', 'ue'], tagsEs: ['cis-mujer', 'adulta', 'ue'],
tagsFr: ['cis-femme', 'adulte', 'ue'], tagsFr: ['cis-femme', 'adulte', 'ue'],
tagsNl: ['cis-dame', 'volwassenen', 'eu'], tagsNl: ['cis-dame', 'volwassenen', 'eu'],
tagsUk: ['cis-female', 'adults', 'eu'],
measies: cisFemaleAdult[size], measies: cisFemaleAdult[size],
}) })
) )
@ -59,11 +62,13 @@ sets.push(
nameEs: `Cis-Hombre Adulto - Talla ${size} (UE)`, nameEs: `Cis-Hombre Adulto - Talla ${size} (UE)`,
nameFr: `Cis-Homme Adulte - Taille ${size} (UE)`, nameFr: `Cis-Homme Adulte - Taille ${size} (UE)`,
nameNl: `Cis-Heer Volwassene - Maat ${size} (EU)`, nameNl: `Cis-Heer Volwassene - Maat ${size} (EU)`,
nameUk: `Cis-Male Adult - Size ${size} (EU)`,
tagsEn: ['cis-male', 'adults', 'eu'], tagsEn: ['cis-male', 'adults', 'eu'],
tagsDe: ['cis-männlich', 'erwachsene', 'eu'], tagsDe: ['cis-männlich', 'erwachsene', 'eu'],
tagsEs: ['cis-hombre', 'adulto', 'ue'], tagsEs: ['cis-hombre', 'adulto', 'ue'],
tagsFr: ['cis-homme', 'adulte', 'ue'], tagsFr: ['cis-homme', 'adulte', 'ue'],
tagsNl: ['cis-heer', 'volwassenen', 'eu'], tagsNl: ['cis-heer', 'volwassenen', 'eu'],
tagsUk: ['cis-male', 'adults', 'eu'],
measies: cisMaleAdult[size], measies: cisMaleAdult[size],
}) })
) )
@ -78,11 +83,13 @@ sets.push(
nameEs: `Cis-Mujer Muñeca - ${size}%`, nameEs: `Cis-Mujer Muñeca - ${size}%`,
nameFr: `Cis-Femme Poupée - ${size}%`, nameFr: `Cis-Femme Poupée - ${size}%`,
nameNl: `Cis-Dame Pop - ${size}%`, nameNl: `Cis-Dame Pop - ${size}%`,
nameUk: `Cis-Female Doll - ${size}%`,
tagsEn: ['cis-female', 'dolls'], tagsEn: ['cis-female', 'dolls'],
tagsDe: ['cis-weiblich', 'puppen'], tagsDe: ['cis-weiblich', 'puppen'],
tagsEs: ['cis-mujer', 'muñecas'], tagsEs: ['cis-mujer', 'muñecas'],
tagsFr: ['cis-femme', 'poupées'], tagsFr: ['cis-femme', 'poupées'],
tagsNl: ['cis-dame', 'poppen'], tagsNl: ['cis-dame', 'poppen'],
tagsUk: ['cis-female', 'dolls'],
measies: cisFemaleDoll[size], measies: cisFemaleDoll[size],
}) })
) )
@ -97,11 +104,13 @@ sets.push(
nameEs: `Cis-Hombre Muñeca - ${size}%`, nameEs: `Cis-Hombre Muñeca - ${size}%`,
nameFr: `Cis-Homme Poupée - ${size}%`, nameFr: `Cis-Homme Poupée - ${size}%`,
nameNl: `Cis-Heer Pop - ${size}%`, nameNl: `Cis-Heer Pop - ${size}%`,
nameUk: `Cis-Male Doll - ${size}%`,
tagsEn: ['cis-male', 'dolls'], tagsEn: ['cis-male', 'dolls'],
tagsDe: ['cis-männlich', 'puppen'], tagsDe: ['cis-männlich', 'puppen'],
tagsEs: ['cis-hombre', 'muñecas'], tagsEs: ['cis-hombre', 'muñecas'],
tagsFr: ['cis-homme', 'poupées'], tagsFr: ['cis-homme', 'poupées'],
tagsNl: ['cis-heer', 'poppen'], tagsNl: ['cis-heer', 'poppen'],
tagsUk: ['cis-male', 'dolls'],
measies: cisMaleDoll[size], measies: cisMaleDoll[size],
}) })
) )
@ -116,11 +125,13 @@ sets.push(
nameEs: `Cis-Mujer Gigante - ${size}%`, nameEs: `Cis-Mujer Gigante - ${size}%`,
nameFr: `Cis-Femme Géante - ${size}%`, nameFr: `Cis-Femme Géante - ${size}%`,
nameNl: `Cis-Dame Reuzin - ${size}%`, nameNl: `Cis-Dame Reuzin - ${size}%`,
nameUk: `Cis-Female Giant - ${size}%`,
tagsEn: ['cis-female', 'giants'], tagsEn: ['cis-female', 'giants'],
tagsDe: ['cis-weiblich', 'riesen'], tagsDe: ['cis-weiblich', 'riesen'],
tagsEs: ['cis-mujer', 'gigantes'], tagsEs: ['cis-mujer', 'gigantes'],
tagsFr: ['cis-femme', 'géants'], tagsFr: ['cis-femme', 'géants'],
tagsNl: ['cis-dame', 'reuzen'], tagsNl: ['cis-dame', 'reuzen'],
tagsUk: ['cis-female', 'giants'],
measies: cisFemaleGiant[size], measies: cisFemaleGiant[size],
}) })
) )
@ -135,11 +146,13 @@ sets.push(
nameEs: `Cis-Hombre Gigante - ${size}%`, nameEs: `Cis-Hombre Gigante - ${size}%`,
nameFr: `Cis-Homme Géant - ${size}%`, nameFr: `Cis-Homme Géant - ${size}%`,
nameNl: `Cis-Heer Reus - ${size}%`, nameNl: `Cis-Heer Reus - ${size}%`,
nameUk: `Cis-Male Giant - ${size}%`,
tagsEn: ['cis-male', 'giants'], tagsEn: ['cis-male', 'giants'],
tagsDe: ['cis-männlich', 'riesen'], tagsDe: ['cis-männlich', 'riesen'],
tagsEs: ['cis-hombre', 'gigantes'], tagsEs: ['cis-hombre', 'gigantes'],
tagsFr: ['cis-homme', 'géants'], tagsFr: ['cis-homme', 'géants'],
tagsNl: ['cis-heer', 'reuzen'], tagsNl: ['cis-heer', 'reuzen'],
tagsUk: ['cis-male', 'giants'],
measies: cisMaleGiant[size], measies: cisMaleGiant[size],
}) })
) )

View file

@ -35,8 +35,6 @@ const baseConfig = {
env: process.env.NODE_ENV || 'development', env: process.env.NODE_ENV || 'development',
// Maintainer contact // Maintainer contact
maintainer: 'joost@freesewing.org', maintainer: 'joost@freesewing.org',
// Backend API base URL
api: process.env.BACKEND_API_URL || 'https://backend3.freesewing.org',
// Feature flags // Feature flags
use: { use: {
github: envToBool(process.env.BACKEND_ENABLE_GITHUB), github: envToBool(process.env.BACKEND_ENABLE_GITHUB),

View file

@ -1,15 +1,5 @@
//import fs from 'fs'
//import path from 'path'
import { SubscriberModel } from '../models/subscriber.mjs' import { SubscriberModel } from '../models/subscriber.mjs'
/*
* Load pages for subscribe and unsubscribe confirmation
* Some people might find this extra step annoying,
* but GET requests should not make changes.
*/
//const index = fs.readFileSync(path.resolve('.', 'src', 'landing', 'index.html'))
//app.get('/', async (req, res) => res.set('Content-Type', 'text/html').status(200).send(index))
export function SubscribersController() {} export function SubscribersController() {}
/* /*

View file

@ -1,4 +1,4 @@
import { buttonRow, closingRow, headingRow, lead1Row, wrap } from '../shared/blocks.mjs' import { buttonRow, newsletterClosingRow, headingRow, lead1Row, wrap } from '../shared/blocks.mjs'
// Translations // Translations
import en from './en.json' assert { type: 'json' } import en from './en.json' assert { type: 'json' }
import de from './de.json' assert { type: 'json' } import de from './de.json' assert { type: 'json' }
@ -11,12 +11,12 @@ export const nlsubact = {
html: wrap.html(` html: wrap.html(`
${headingRow.html} ${headingRow.html}
${lead1Row.html} ${lead1Row.html}
${closingRow.html} ${newsletterClosingRow.html}
`), `),
text: wrap.text(` text: wrap.text(`
${headingRow.text} ${headingRow.text}
${lead1Row.text} ${lead1Row.text}
${closingRow.text} ${newsletterClosingRow.text}
`), `),
} }

View file

@ -51,11 +51,6 @@ export const newsletterClosingRow = {
{{ greeting }} {{ greeting }}
<br> <br>
joost joost
<br><br>
PS: {{ ps-pre-link}}
<a href="{{ psUrl }}" target="_blank" style="text-decoration: underline; color: #262626">
<b>{{ ps-link}}</b>
</a> {{ ps-post-link }}
</p> </p>
</td> </td>
</tr>`, </tr>`,

View file

@ -2,7 +2,6 @@ import { templates, translations } from '../templates/email/index.mjs'
import { SESv2Client, SendEmailCommand } from '@aws-sdk/client-sesv2' import { SESv2Client, SendEmailCommand } from '@aws-sdk/client-sesv2'
import mustache from 'mustache' import mustache from 'mustache'
import { log } from './log.mjs' import { log } from './log.mjs'
console.log(Object.keys(templates))
/* /*
* Exporting this closure that makes sure we have access to the * Exporting this closure that makes sure we have access to the

View file

@ -9,16 +9,19 @@ export const curatedSetTests = async (chai, config, expect, store) => {
nameEs: 'Medidas de ejemplo A', nameEs: 'Medidas de ejemplo A',
nameFr: 'Mesures exemple A', nameFr: 'Mesures exemple A',
nameNl: 'Voorbeel maten A', nameNl: 'Voorbeel maten A',
nameUk: 'Ukranian example A',
notesDe: 'Das sind die Notizen A', notesDe: 'Das sind die Notizen A',
notesEn: 'These are the notes A', notesEn: 'These are the notes A',
notesEs: 'Estas son las notas A', notesEs: 'Estas son las notas A',
notesFr: 'Ce sont les notes A', notesFr: 'Ce sont les notes A',
notesNl: 'Dit zijn de notities A', notesNl: 'Dit zijn de notities A',
notesUk: 'These are the ukranian notes A',
tagsDe: ['tagA', 'tagB'], tagsDe: ['tagA', 'tagB'],
tagsEn: ['tagA', 'tagB'], tagsEn: ['tagA', 'tagB'],
tagsEs: ['tagA', 'tagB'], tagsEs: ['tagA', 'tagB'],
tagsFr: ['tagA', 'tagB'], tagsFr: ['tagA', 'tagB'],
tagsNl: ['tagA', 'tagB'], tagsNl: ['tagA', 'tagB'],
tagsUk: ['tagA', 'tagB'],
measies: { measies: {
chest: 1000, chest: 1000,
neck: 420, neck: 420,
@ -30,16 +33,19 @@ export const curatedSetTests = async (chai, config, expect, store) => {
nameEs: 'Medidas de ejemplo B', nameEs: 'Medidas de ejemplo B',
nameFr: 'Mesures exemple B', nameFr: 'Mesures exemple B',
nameNl: 'Voorbeel maten B', nameNl: 'Voorbeel maten B',
nameUk: 'Ukranian example B',
notesDe: 'Das sind die Notizen B', notesDe: 'Das sind die Notizen B',
notesEn: 'These are the notes B', notesEn: 'These are the notes B',
notesEs: 'Estas son las notas B', notesEs: 'Estas son las notas B',
notesFr: 'Ce sont les notes B', notesFr: 'Ce sont les notes B',
notesNl: 'Dit zijn de notities B', notesNl: 'Dit zijn de notities B',
notesUk: 'These are the ukranian notes B',
tagsDe: ['tagA', 'tagB'], tagsDe: ['tagA', 'tagB'],
tagsEn: ['tagA', 'tagB'], tagsEn: ['tagA', 'tagB'],
tagsEs: ['tagA', 'tagB'], tagsEs: ['tagA', 'tagB'],
tagsFr: ['tagA', 'tagB'], tagsFr: ['tagA', 'tagB'],
tagsNl: ['tagA', 'tagB'], tagsNl: ['tagA', 'tagB'],
tagsUk: ['tagA', 'tagB'],
measies: { measies: {
chest: 930, chest: 930,
neck: 360, neck: 360,

View file

@ -9,13 +9,13 @@ import { subscriberTests } from './subscriber.mjs'
import { setup } from './shared.mjs' import { setup } from './shared.mjs'
const runTests = async (...params) => { const runTests = async (...params) => {
//await userTests(...params) await userTests(...params)
//await mfaTests(...params) await mfaTests(...params)
//await apikeyTests(...params) await apikeyTests(...params)
//await accountTests(...params) await accountTests(...params)
//await setTests(...params) await setTests(...params)
//await curatedSetTests(...params) await curatedSetTests(...params)
//await patternTests(...params) await patternTests(...params)
await subscriberTests(...params) await subscriberTests(...params)
} }