Kerwin1202 / VsTranslator

Visual Studio's Translate Plugin
MIT License
51 stars 17 forks source link

Automatically detect target language by the name of the folder or file #9

Open icnocop opened 5 years ago

icnocop commented 5 years ago

I would like VsTranslator to automatically detect the target language by the name of the folder or file.

For example, if my file is called "Localization.zh-CN.resx", then the target language should automatically be Chinese (Simplified) by default.

Also, if my file is in a folder containing "CHS", then the target language should automatically be Chinese (Simplified) by default.

In this way, I don't have to change the target language when translating strings in multiple files where each file targets a different language.

I could imagine this feature as a set of rules based on Regular Expressions that the user would have to enter.

For example, Target Language Identifier: zh-CN Regular Expression Matches: zh-CN CHS

The Regular Expression would match on the full path of the file.

Thank you.

icnocop commented 4 years ago

Or maybe just cache the target language based on the file path, so I only have to set the target language once per file.

Kerwin1202 commented 4 years ago

OK,I will consider this.