Refine "Open UDL folder" command & make it translatable

This commit is contained in:
Don HO 2019-11-21 02:24:57 +01:00
parent 302b88e0ea
commit 3220eaaa30
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
7 changed files with 31 additions and 14 deletions

View File

@ -63,6 +63,7 @@
<Item subMenuId="encoding-turkish" name="土耳其文"/> <Item subMenuId="encoding-turkish" name="土耳其文"/>
<Item subMenuId="encoding-westernEuropean" name="西歐語系"/> <Item subMenuId="encoding-westernEuropean" name="西歐語系"/>
<Item subMenuId="encoding-vietnamese" name="越南文"/> <Item subMenuId="encoding-vietnamese" name="越南文"/>
<Item subMenuId="language-userDefinedLanguage" name="自訂程式語言"/>
<Item subMenuId="settings-import" name="匯入"/> <Item subMenuId="settings-import" name="匯入"/>
<Item subMenuId="tools-md5" name="MD5"/> <Item subMenuId="tools-md5" name="MD5"/>
<Item subMenuId="tools-sha256" name="SHA-256"/> <Item subMenuId="tools-sha256" name="SHA-256"/>
@ -283,6 +284,7 @@
<Item id="46001" name="設定程式語言格式..."/> <Item id="46001" name="設定程式語言格式..."/>
<Item id="46250" name="定義程式語言..."/> <Item id="46250" name="定義程式語言..."/>
<Item id="46300" name="開啟自訂程式語言資料夾..."/>
<Item id="46180" name="偏好設定"/> <Item id="46180" name="偏好設定"/>
<Item id="47000" name="關於 Notepad++..."/> <Item id="47000" name="關於 Notepad++..."/>
<Item id="47001" name="Notepad++ 官方網站"/> <Item id="47001" name="Notepad++ 官方網站"/>

View File

@ -63,6 +63,7 @@
<Item subMenuId="encoding-turkish" name="Turkish"/> <Item subMenuId="encoding-turkish" name="Turkish"/>
<Item subMenuId="encoding-westernEuropean" name="Western European"/> <Item subMenuId="encoding-westernEuropean" name="Western European"/>
<Item subMenuId="encoding-vietnamese" name="Vietnamese"/> <Item subMenuId="encoding-vietnamese" name="Vietnamese"/>
<Item subMenuId="language-userDefinedLanguage" name="User Defined Language"/>
<Item subMenuId="settings-import" name="Import"/> <Item subMenuId="settings-import" name="Import"/>
<Item subMenuId="tools-md5" name="MD5"/> <Item subMenuId="tools-md5" name="MD5"/>
<Item subMenuId="tools-sha256" name="SHA-256"/> <Item subMenuId="tools-sha256" name="SHA-256"/>
@ -281,6 +282,7 @@
<Item id="46001" name="Style Configurator..."/> <Item id="46001" name="Style Configurator..."/>
<Item id="46250" name="Define your language..."/> <Item id="46250" name="Define your language..."/>
<Item id="46300" name="Open User Defined Language folder..."/>
<Item id="46180" name="User-Defined"/> <Item id="46180" name="User-Defined"/>
<Item id="47000" name="About Notepad++"/> <Item id="47000" name="About Notepad++"/>
<Item id="47010" name="Command Line Arguments..."/> <Item id="47010" name="Command Line Arguments..."/>

View File

@ -63,6 +63,7 @@
<Item subMenuId="encoding-turkish" name="Turc"/> <Item subMenuId="encoding-turkish" name="Turc"/>
<Item subMenuId="encoding-westernEuropean" name="Langues dEurope occidentale"/> <Item subMenuId="encoding-westernEuropean" name="Langues dEurope occidentale"/>
<Item subMenuId="encoding-vietnamese" name="Vietnamien"/> <Item subMenuId="encoding-vietnamese" name="Vietnamien"/>
<Item subMenuId="language-userDefinedLanguage" name="Langage utilisateur"/>
<Item subMenuId="settings-import" name="Importer"/> <Item subMenuId="settings-import" name="Importer"/>
<Item subMenuId="tools-md5" name="MD5"/> <Item subMenuId="tools-md5" name="MD5"/>
<Item subMenuId="tools-sha256" name="SHA-256"/> <Item subMenuId="tools-sha256" name="SHA-256"/>
@ -282,6 +283,7 @@
<Item id="45013" name="Convertir en UCS-2 LE BOM"/> <Item id="45013" name="Convertir en UCS-2 LE BOM"/>
<Item id="46001" name="Configurateur de coloration syntaxique..."/> <Item id="46001" name="Configurateur de coloration syntaxique..."/>
<Item id="46250" name="Définir votre langage..."/> <Item id="46250" name="Définir votre langage..."/>
<Item id="46300" name="Ovrir le dossier des Langages utilisateur..."/>
<Item id="46180" name="Langage utilisateur"/> <Item id="46180" name="Langage utilisateur"/>
<Item id="47000" name="À propos de Notepad++..."/> <Item id="47000" name="À propos de Notepad++..."/>
<Item id="47001" name="Site officiel Notepad++"/> <Item id="47001" name="Site officiel Notepad++"/>

View File

@ -3049,10 +3049,10 @@ void Notepad_plus::command(int id)
} }
break; break;
case IDM_LANG_OPENUDLDIR: { case IDM_LANG_OPENUDLDIR:
generic_string _userPath = NppParameters::getInstance().getUserPath(); {
PathAppend(_userPath, TEXT("userDefineLangs")); generic_string userDefineLangFolderPath = NppParameters::getInstance().getUserDefineLangFolderPath();
::ShellExecute(_pPublicInterface->getHSelf(), TEXT("open"), _userPath.c_str(), NULL, NULL, SW_SHOW); ::ShellExecute(_pPublicInterface->getHSelf(), TEXT("open"), userDefineLangFolderPath.c_str(), NULL, NULL, SW_SHOW);
break; break;
} }

View File

@ -1230,12 +1230,12 @@ bool NppParameters::load()
//-----------------------------------// //-----------------------------------//
// userDefineLang.xml : for per user // // userDefineLang.xml : for per user //
//-----------------------------------// //-----------------------------------//
generic_string userDefineLangsFolderPath = _userDefineLangPath = _userPath; _userDefineLangsFolderPath = _userDefineLangPath = _userPath;
PathAppend(_userDefineLangPath, TEXT("userDefineLang.xml")); PathAppend(_userDefineLangPath, TEXT("userDefineLang.xml"));
PathAppend(userDefineLangsFolderPath, TEXT("userDefineLangs")); PathAppend(_userDefineLangsFolderPath, TEXT("userDefineLangs"));
std::vector<generic_string> udlFiles; std::vector<generic_string> udlFiles;
getFilesInFolder(udlFiles, TEXT("*.xml"), userDefineLangsFolderPath); getFilesInFolder(udlFiles, TEXT("*.xml"), _userDefineLangsFolderPath);
_pXmlUserLangDoc = new TiXmlDocument(_userDefineLangPath); _pXmlUserLangDoc = new TiXmlDocument(_userDefineLangPath);
loadOkay = _pXmlUserLangDoc->LoadFile(); loadOkay = _pXmlUserLangDoc->LoadFile();

View File

@ -1615,6 +1615,14 @@ public:
return _userPath; return _userPath;
} }
generic_string getUserDefineLangFolderPath() const {
return _userDefineLangsFolderPath;
}
generic_string getUserDefineLangPath() const {
return _userDefineLangPath;
}
bool writeSettingsFilesOnCloudForThe1stTime(const generic_string & cloudSettingsPath); bool writeSettingsFilesOnCloudForThe1stTime(const generic_string & cloudSettingsPath);
void setCloudChoice(const TCHAR *pathChoice); void setCloudChoice(const TCHAR *pathChoice);
void removeCloudChoice(); void removeCloudChoice();
@ -1698,6 +1706,7 @@ private:
UserLangContainer *_userLangArray[NB_MAX_USER_LANG]; UserLangContainer *_userLangArray[NB_MAX_USER_LANG];
unsigned char _nbUserLang = 0; // won't be exceeded to 255; unsigned char _nbUserLang = 0; // won't be exceeded to 255;
generic_string _userDefineLangsFolderPath;
generic_string _userDefineLangPath; generic_string _userDefineLangPath;
ExternalLangContainer *_externalLangArray[NB_MAX_EXTERNAL_LANG]; ExternalLangContainer *_externalLangArray[NB_MAX_EXTERNAL_LANG];
int _nbExternalLang = 0; int _nbExternalLang = 0;

View File

@ -98,6 +98,8 @@ MenuPosition menuPos[] = {
{ 4, 5, 14, "encoding-westernEuropean" }, { 4, 5, 14, "encoding-westernEuropean" },
{ 4, 5, 15, "encoding-vietnamese" }, { 4, 5, 15, "encoding-vietnamese" },
{ 5, 23, -1, "language-userDefinedLanguage" },
{ 6, 4, -1, "settings-import" }, { 6, 4, -1, "settings-import" },
{ 7, 0, -1, "tools-md5" }, { 7, 0, -1, "tools-md5" },