translate removed
This commit is contained in:
parent
0c296ac494
commit
ec9940bfd7
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user