Strapi findOne (i18n) in nuxt js need help

I had the same problem with findOne and ?_locale. I created controller logic that works for my project. This works if all localizations for the page share the same slug. I can also show how I did that if needed.

const { sanitizeEntity } = require('strapi-utils');

module.exports = {

  async findOne(ctx) {
    const { slug } = ctx.params;
    const { _locale }  = ctx.query;

    // a request example would be 'http://localhost:1337/blog-posts/blog-post-1?_locale=fr-CA'
    // the findOne by slug AND locale logic
    if (_locale) {
      const localeEntity = await strapi.services['blog-post'].find({ _locale, slug })
      return sanitizeEntity(localeEntity, { model: strapi.models['blog-post'] });
    };


    // the findOne by slug logic
    const entity = await strapi.services['blog-post'].findOne({ slug });
    return sanitizeEntity(entity, { model: strapi.models['blog-post'] });
  },
};