Skip to content

[hard-string detection] false positive of string "i18n" #600

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

Closed
zxf4399 opened this issue Jun 23, 2021 · 7 comments
Closed

[hard-string detection] false positive of string "i18n" #600

zxf4399 opened this issue Jun 23, 2021 · 7 comments
Assignees
Labels
bug Something isn't working sp:5

Comments

@zxf4399
Copy link

zxf4399 commented Jun 23, 2021

Extract text into i18n messages with one text, please support current file.

@antfu
Copy link
Contributor

antfu commented Jun 23, 2021

We are already working on that. Please wait for the next release (within a week). Thanks

@zxf4399
Copy link
Author

zxf4399 commented Jun 24, 2021

Thanks

@zxf4399
Copy link
Author

zxf4399 commented Jul 6, 2021

@antfu
image
I find v2.6.10 extract all don't support tsx

@antfu
Copy link
Contributor

antfu commented Jul 6, 2021

Do you have i18n-ally.enabledFramework configured? If so, you will need to add general to the list to enable it

@zxf4399
Copy link
Author

zxf4399 commented Jul 6, 2021

Do you have i18n-ally.enabledFramework configured? If so, you will need to add general to the list to enable it

You are right! But i find some error in hard-coded strings like
image
I dont't want to show i18n in the list. Can you tell me how to remove it?

@antfu antfu changed the title Support extract all text into i18n messages? [hard-string detection] false positive of string "i18n" Jul 6, 2021
@antfu antfu added bug Something isn't working and removed feature request labels Jul 6, 2021
@zxf4399
Copy link
Author

zxf4399 commented Jul 7, 2021

@antfu Actually i want to need plain text such as 你好 in Hard-coded strings [beta] list, not't ${retStr},${v} while my displayLanguage is zh.

@terales
Copy link
Collaborator

terales commented Jul 7, 2021

Wow, great catch!

So there are two points:

  • filter out false positives with removing variables${retStr}, ${v} -> ,
  • exclude detection of strings that contains only alphanumerics and all lowercased and without spaces (i18n).

@terales terales added the sp:5 label Jul 7, 2021
@terales terales added this to the Weekly cycle 020 milestone Jul 14, 2021
@antfu antfu closed this as completed in 4f764bb Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sp:5
Development

No branches or pull requests

3 participants