r1tsuu / payload-plugin-translator Goto Github PK
View Code? Open in Web Editor NEWPayload 3.0 enchantment packages
License: MIT License
Payload 3.0 enchantment packages
License: MIT License
Hi,
I gave this one a spin too and found some issues:
admin: {position: 'sidebar'}
). There are no translatable fields in the sidebar.admin: { condition: ()=>false}
)Thank you!
hey can you give me full example how to use deepl , big thanks to you
Hi there,
The breaking changes in beta.49 regarding imports (https://github.com/payloadcms/payload/releases/tag/v3.0.0-beta.49) probably affect all of the plugins. :/
It would be awesome if this plugin has a parameter option to add your own translation service.
Translator seems to choke somehow when using nested lexical richText fields inside of Tabs.
Only thing i noticed is that once the "from" locale has a non-null value for the richText lexical field, it seems to work,
[19:45:44] ERROR: TypeError: Cannot use 'in' operator to search for 'root' in null at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/traverseFields.js:148:42) at Array.forEach (<anonymous>) at traverseFields (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/traverseFields.js:16:12) at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/traverseFields.js:106:17) at Array.forEach (<anonymous>) at traverseFields (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/traverseFields.js:16:12) at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/traverseFields.js:24:21) at Array.forEach (<anonymous>) at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/traverseFields.js:19:28) at Array.forEach (<anonymous>) at traverseFields (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/traverseFields.js:16:12) at translateOperation (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/operation.js:40:68) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.translateEndpoint [as handler] (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_xtbks235xned2z5xhtjfa67fa4/node_modules/@payload-enchants/translator/dist/translate/endpoint.js:13:20) at async eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_next@1_pfszsfkw2eyeo7aevrugd5uhta/node_modules/@payloadcms/next/dist/routes/rest/index.js:546:44) at async /workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:63352 at async eP.execute (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:54549) at async eP.handle (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:64693) at async doRender (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1419:42) at async responseGenerator (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1640:40) at async DevServer.renderToResponseWithComponentsImpl (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1665:28) at async DevServer.renderPageComponent (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1978:24) at async DevServer.renderToResponseImpl (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:2016:32) at async DevServer.pipeImpl (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:908:25) at async NextNodeServer.handleCatchallRenderRequest (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js:273:17) at async DevServer.handleRequestImpl (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:804:17) at async /workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:339:20 at async Span.traceAsyncFn (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/trace/trace.js:157:20) at async DevServer.handleRequest (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:336:24) at async invokeRender (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:175:21) at async handleRequest (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:354:24) at async requestHandlerImpl (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:378:13) at async Server.requestListener (/workspaces/summed-cms-payload-plugin/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/start-server.js:142:13)
First of all, I'd like to thank you for making this package. It's a huge timesaver.
bump-payload
currently only looks for the root package.json.
It would be nice to also check other recursive package.json files in a monorepo, possibly using something like list-monorepo-packages.
When copying collections with several layers of nesting, the IDs of the children are getting copied as well, which results in the following error:
ERROR: TypeError: Cannot read properties of undefined (reading 'pages_blocks_accordion_block_items_pkey')
In this case the structure looks like this:
Page
(collection)
Block
(array)
Accordion
(array)
Item
(object)It seems like the IDs for everything are getting pulled in from the original doc, and payload adds unique constraints for the block and collection ids. For example, a block within one page can't share an ID with a block in another collection.
Hi,
When adding the docs reorder plugin, the field is visible (but readonly) in the form. Maybe it is possible to add a classname to it using the field configuration which would allow for it to be hidden visually or expose a configuration flag as plugin option to allow setting it as a hidden field.
I would go with a plugin option to set it to hidden: true
.
Also open to submit this via PR if you think this feature would be good.
Hi,
I have a rather complex collection structure. I can post it here if you would like to test.
This is what I do:
Similarly, when I use "AI Translate":
=> All fields in an array structure that were previously containing text are now empty, including those marked as localised: true
. Number fields seem to be unaffected by this.
When I reload the page, the fields contain the values they should contain.
Could it be that arrays are not handled yet?
Hi,
Say I have a jobs and organizations collections, where jobs has a relationship field organization to organizations. Both of the collections are enabled in the cached local API config for revalidation and are revalidating successfully upon change.
However, when I update an organization, the nested field title of organization doesn't update, i.e. jobs.docs[0].organization.title.
const jobs = await cachedPayload.find({
collection: 'jobs',
depth: 1,
})
Initial API shows this:
{
"docs": [
{
"id": "6692b9c62095d45df53a4c6a",
"title": "Published Job 1",
"organization": {
"id": "6692ad052095d45df53a4880",
"title": "Organization 1",
"slug": "organization-1",
},
...
}
]
...
}
After changing:
{
"docs": [
{
"id": "6692b9c62095d45df53a4c6a",
"title": "Published Job 1",
"organization": {
"id": "6692ad052095d45df53a4880",
"title": "Organization 1 Changed",
"slug": "organization-1",
},
...
}
]
...
}
But on the frontend, the cached response still shows organization.title as "Organization 1".
I thought, okay, I actually should also revalidate the job itself, which I did, and nothing changed.
Enabling useSimpleCacheStrategy: true,
in the config fixed this, but as I understand this calls revalidation after any change in the database, and I don't think that'll be very performant when there'll be thousands of documents.
Maybe I'm missing something, or maybe that's a bug. Appreciate any help, thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.