-
Notifications
You must be signed in to change notification settings - Fork 59
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
Incorrect operation for non-English settings #14
Comments
Yeap, that means that we need to copy all the translations from the TypeScript compiler itself (Not optimal, but doable) |
It's also possible to force the |
@pronebird If someone specifically asked for a locale, changing it back to English would be misleading. |
@gilamran You can compile regular expressions from strings. const pattern = "[a-z]+";
const flags = "i";
const exp = new RegExp(pattern, flags);
exp.test('Hello'); // true |
@trs I know that you can do many things with regex... how would this help with Japanese for example? |
@gilamran I see, I thought the issue was converting a string into a RegExp 😄 Perhaps the expressions can also be associated to a locale object and referenced as such: // english.json
{
"compilationCompleteWithErrorRegex": " Found [^0][0-9]* error[s]?\\. Watching for file changes\\."
...
} // japanese.json
{
"compilationCompleteWithErrorRegex": " 見つかった [^0][0-9]* エラー\\. ファイルの変更を監視する
} (ignore my ignorance to the language, just Google translated for an example)Then you would just import the correct expressions file based on the locale. const expressions = require(`${locale}.json`) 🤷♂ |
@trs Yeap that's what I wrote in the comment above, we should extract the current locale json from |
Not for me, sorry! Hopefully someone else can tackle this PR. |
tsc-watch is based on compiler messages regular expressions wich fail when you use --locale typescript option.
The text was updated successfully, but these errors were encountered: