translate removed

This commit is contained in:
tonyrewin 2022-10-04 12:39:12 +03:00
parent 0c296ac494
commit ec9940bfd7
2 changed files with 0 additions and 18 deletions

View File

@ -29,13 +29,10 @@
},
"dependencies": {
"@aws-sdk/client-s3": "^3.178.0",
"@nanostores/i18n": "^0.7.0",
"@nanostores/persistent": "^0.7.0",
"@nanostores/router": "^0.7.0",
"@nanostores/solid": "^0.3.0",
"@solid-primitives/memo": "^1.0.2",
"axios": "^0.27.2",
"google-translate-api-x": "^10.4.1",
"loglevel": "^1.8.0",
"loglevel-plugin-prefix": "^0.8.4",
"mailgun.js": "^8.0.1",

View File

@ -1,15 +0,0 @@
import translate from 'google-translate-api-x'
import type { Shout } from '../graphql/types.gen'
export const translateHook = (aaa, locale) => {
if (aaa?.length > 0) {
console.log('[zine] articles loaded')
if (locale !== 'ru') {
// translate titles
aaa.forEach((a: Shout) =>
translate(a.title, { to: locale.get() }).then((res) => (a.title = res.text))
)
}
}
return aaa
}