@justanarthur/payload-plugin-translator 3.3.2 → 3.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js
CHANGED
|
@@ -303,8 +303,7 @@ var CustomButtonWithTranslator = ({ type }) => {
|
|
|
303
303
|
if (!id && !globalSlug)
|
|
304
304
|
return /* @__PURE__ */ jsx6(DefaultButton, {});
|
|
305
305
|
const { localization } = config;
|
|
306
|
-
|
|
307
|
-
if (isSourceLocale)
|
|
306
|
+
if (localization && locale.code === localization.defaultLocale)
|
|
308
307
|
return /* @__PURE__ */ jsx6(DefaultButton, {});
|
|
309
308
|
return /* @__PURE__ */ jsx6(TranslatorProvider, {
|
|
310
309
|
children: /* @__PURE__ */ jsxs4("div", {
|
package/dist/index.js
CHANGED
package/dist/jobs.js
CHANGED
|
@@ -107,10 +107,9 @@ var translateOperation2 = async (args) => {
|
|
|
107
107
|
payload: args.payload
|
|
108
108
|
};
|
|
109
109
|
const { collectionSlug, globalSlug, id, locale, localeFrom, overrideAccess } = args;
|
|
110
|
-
const localization = req.payload.config
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
throw new APIError3(`Refusing to translate into the default locale "${defaultLocale}" — it is the source of truth. Translate from it into a target locale instead.`, 400);
|
|
110
|
+
const { localization } = req.payload.config;
|
|
111
|
+
if (localization && locale === localization.defaultLocale) {
|
|
112
|
+
throw new APIError3(`Refusing to translate into the default locale "${localization.defaultLocale}" — it is the source of truth. Translate from it into a target locale instead.`, 400);
|
|
114
113
|
}
|
|
115
114
|
const { config, doc: dataFrom } = await findEntityWithConfig({
|
|
116
115
|
collectionSlug,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justanarthur/payload-plugin-translator",
|
|
3
3
|
"description": "Translator plugin for Payload CMS — automatic localization via Google, OpenAI, LibreTranslate, or custom resolvers.",
|
|
4
|
-
"version": "3.3.
|
|
4
|
+
"version": "3.3.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"files": [
|