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

add support for chinese lang #33

Merged
merged 2 commits into from Apr 29, 2023
Merged

add support for chinese lang #33

merged 2 commits into from Apr 29, 2023

Conversation

subframe7536
Copy link
Contributor

@subframe7536 subframe7536 commented Apr 20, 2023

when the extension of Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code installed, it use “” to wrap the code in error hint.

add support for it

Copy link
Owner

@yoavbls yoavbls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@subframe7536 Thank you for your contribution!
Please see my comment below 🙂

Repository owner deleted a comment from JUSTIVE Apr 21, 2023
@@ -20,7 +20,7 @@ export const formatDiagnosticMessage = (message: string, format: (type: string)
message
// format declare module snippet
.replaceAll(
/'(declare module )'(.*)';'/g,
/['“](declare module )['”](.*)['“];['”]/g,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be better to replace all the characters by ' at the beginning in one replace instead of adding it to all the others.
WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same way, but I can't guarantee that all “” inside error messages are just used as the replacement of ''

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see inside a type before, but I didn't use the Chinese language pack so we'll go with the safe option for now 🙂
Thank you!

Copy link
Owner

@yoavbls yoavbls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a minor conflict. Can you fix it so I can merge it?
Thank you!

@@ -20,7 +20,7 @@ export const formatDiagnosticMessage = (message: string, format: (type: string)
message
// format declare module snippet
.replaceAll(
/'(declare module )'(.*)';'/g,
/['“](declare module )['”](.*)['“];['”]/g,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see inside a type before, but I didn't use the Chinese language pack so we'll go with the safe option for now 🙂
Thank you!

@yoavbls yoavbls merged commit e9b7d2d into yoavbls:main Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants