You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i changed the controller configuration in strapi using this function :
module.exports = ({ strapi }) => ({
async find(ctx) {
if (ctx.query.locale === 'all') {
const localesArray = await strapi.plugins.i18n.services.locales.find()
const locales = localesArray.map(locale => locale.code);
let data = [];
for (let locale of locales) {
ctx.query.locale = locale;
const response = await super.find(ctx);
if (response) data.push(response.data);
};
const meta = {};
return { data, meta };
}
return await super.find(ctx);
}
});
so i can get all the locales. It is kind of working but only for two pages. For the rest of the pages it either returns only the default locale or i can no longer see it in the Graphql schema. The problem with the data missing from graphql happens when i add
pluginOptions: {
i18n: {
locale: 'all',
},
},
to the singleType configuration, which is needed, so i can get all locales.
Those are three examples for one that is working, one that is only returning the default locale and, one that is not appearing in graphql after this configuration (landing-page)
The text was updated successfully, but these errors were encountered:
Hey Nevena, sorry for the delay. I'm not familiar with this plugin personally. @laurenskling Helps maintain this one. Hopefully, he can jump in and help. If not feel free to open up a PR and I'll do my best to review but will trust you on much of it.
I don't use i18n myself, so I have no clue how it works. Hopefully someone else in the community can shine light on this?
moonmeister
changed the title
gatsby-source-strapi: SingleType internationalization bug
bug(gatsby-source-strapi): SingleType internationalization bug
Mar 5, 2023
i changed the controller configuration in strapi using this function :
module.exports = ({ strapi }) => ({
async find(ctx) {
if (ctx.query.locale === 'all') {
const localesArray = await strapi.plugins.i18n.services.locales.find()
const locales = localesArray.map(locale => locale.code);
}
});
so i can get all the locales. It is kind of working but only for two pages. For the rest of the pages it either returns only the default locale or i can no longer see it in the Graphql schema. The problem with the data missing from graphql happens when i add
to the singleType configuration, which is needed, so i can get all locales.
Those are three examples for one that is working, one that is only returning the default locale and, one that is not appearing in graphql after this configuration (landing-page)
The text was updated successfully, but these errors were encountered: