Language: English | 简体中文
csle, short for "Chinese String Literal Expression", diagnoses whether the string literal expression contains Chinese characters, and can quickly fix them between simplified or traditional glyphs.
- Diagnose string literals: finds string literals that contain Chinese characters and quick-fixes them between Simplified and Traditional (Taiwan / Hong Kong / general) glyphs. Documentation comments can optionally be checked too (
checkDocComment). - Choose the glyphs: in the settings, pick the glyph to diagnose (
checkGlyph) and the glyph to convert to (convertGlyph). - Exclude names: skip strings at certain locations, such as keys, tags, or function calls like
print.excludeNamesapplies to all languages;excludeNamesByLanguageadds names for one language only (pick the language as the item, enter comma-separated names as the value). - Diagnose all files: scan the whole workspace from the Command Palette (
Chinese Expression Diagnostic: Diagnostic All Files) or right-click a folder in the Explorer and chooseDiagnostic This Folder. Results are listed by file in the Chinese Expression Diagnostic view, where you can jump to an item, accept or dismiss it, accept a file, orAccept All. Files are not saved and changes can be undone. EnableautoDiagnosticOnOpen(off by default) to scan when a project opens; nothing is modified automatically. Related settings:workspaceExclude,maxFileSize,previewBeforeApply,saveAfterApply,autoDiagnosticMaxFiles. - Custom dictionary: override the built-in conversion with your own word mappings. Dictionaries use the OpenCC format (
source<Tab>target, one entry per line,#starts a comment) and are kept one file per Convert Glyph (cn.txt,twp.txt,hk.txt,t.txt). SetcustomDictionaryDirectoryto a folder in your repository (${workspaceFolder}or a relative path) to share one dictionary with your team. Add entries from the right-click menu (Add Custom Dictionary Entry…) or the Add to custom dictionary… quick fix, and use Manage Custom Dictionary… to search, edit, delete, import, export, or clear entries for any glyph. Custom entries win over the built-in conversion, and mapping a word to itself keeps it unchanged.
- Dart
- JavaScript and TypeScript
- HTML / CSS
- JSON
- PHP
- Python
If you want more supported languages, new an issue.