Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a mismatch in next-i18next #996

Open
JerryFan626 opened this issue Aug 29, 2023 · 5 comments
Open

There is a mismatch in next-i18next #996

JerryFan626 opened this issue Aug 29, 2023 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@JerryFan626
Copy link

Describe the bug
There is a mismatch in next-i18next

Extension Version
i18n Ally v2.11.0

Framework/i18n package you are using
next-i18next

To Reproduce

// vscode/setting.json
{
  "i18n-ally.localesPaths": "public/locales",
  "i18n-ally.keystyle": "nested"
}
import { GetStaticPaths } from 'next';
import { useTranslation } from 'next-i18next';
import { getLocaleProps } from '@/utils/locale';

export const getStaticProps = getLocaleProps(['home', 'common']);

function Home() {
  const { t } = useTranslation('home');

  // An error occurs here, and it keeps saying that home.nav.home was not found
  return <div>{t('nav.home')}</div>;
}

export default Home;

Device Infomation

  • OS:
  • Version:
  • VS Code Version:

Extension Log
Go to View -> Output -> i18n Ally, and paste the content below. You should mask any sensitive information


Screenshots

@JerryFan626 JerryFan626 added the bug Something isn't working label Aug 29, 2023
@terales
Copy link
Collaborator

terales commented Aug 30, 2023

@aranard @chazeah this looks like a regression related to #926

Can you look into it, please?

@terales terales added the help wanted Extra attention is needed label Aug 30, 2023
@aranard
Copy link
Contributor

aranard commented Aug 30, 2023

Hi @terales, what makes you think this is related to #926? I'm not seeing anything in the bug report that shows an immediate connection. Were you able to reproduce and found more information?

@aranard
Copy link
Contributor

aranard commented Aug 30, 2023

Investigating this further, I still don't see a connection to my change. #926 was an enhancement only to the "custom" framework, which the configuration in this issue does not appear to be using.

The release also included this change #941, which modified editor and core key detection code. This seems more likely related. If there's something I'm missing, let me know and I can continue to look into it.

@terales
Copy link
Collaborator

terales commented Aug 30, 2023

Thank you for the research and sorry for the wrong attribution, @aranard!

@Angeart, can you look into this issue as it seems to be a regression related to #941, please?

@Angeart
Copy link
Contributor

Angeart commented Sep 1, 2023

@terales
@fanjinyu-fjy
I think it's not related.
You might want to have to just turn on "i18n-ally.namespace": true on setting.json.

I checked working with below settings.

{
  "i18n-ally.enabledFrameworks": [
    "react-i18next"
  ],
  "i18n-ally.namespace": true,
  "i18n-ally.keystyle": "nested",
  }

public/
├─ locales/
│  ├─ en/
│  │  ├─ common.json
│  │  ├─ foo.json

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Development

No branches or pull requests

4 participants