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

help function doesn't show preview text #1122

Open
ZehuaZhang opened this issue Apr 7, 2024 · 1 comment
Open

help function doesn't show preview text #1122

ZehuaZhang opened this issue Apr 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ZehuaZhang
Copy link

Using next-intl,t = useTranslation('key'), passing t to a helper function

function test(t: ReturnType<typeof useTranslations<'namespace'>>) {
}

typescript definition is working, but extension shows this local key name not found, and didn't show preview text.

@ZehuaZhang ZehuaZhang added the bug Something isn't working label Apr 7, 2024
@mikayelucraft
Copy link

mikayelucraft commented Apr 9, 2024

I have the same issue

const PasswordFormSchemaGen = (
  t: ReturnType<typeof useTranslations<"error">>,
) =>
  z
    .object({
      [InputNames.oldPassword]: z.string().regex(passwordValidation, {
        message: t("password_8_upper_special"),
      }),
      [InputNames.newPassword]: z.string().regex(passwordValidation, {
        message: t("password_8_upper_special"),
      }),
      [InputNames.cNewPassword]: z.string().regex(passwordValidation, {
        message: t("password_8_upper_special"),
      }),
    })
    .refine(
      (data) => data[InputNames.newPassword] === data[InputNames.cNewPassword],
      {
        path: [InputNames.cNewPassword],
        message: t("password_does_match"),
      },
    )
    .refine(
      (data) => data[InputNames.oldPassword] === data[InputNames.newPassword],
      {
        path: [InputNames.newPassword],
        message: t("can_not use_prev"),
      },
    );

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

No branches or pull requests

2 participants