[ENHANCEMENT] Enhance the localization system - main menu entries.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@951 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
caaaef7c26
commit
755774861e
@ -6,15 +6,25 @@
|
||||
<Main>
|
||||
<!-- Main Menu Entries -->
|
||||
<Entries>
|
||||
<Item id="0" name="&Fichier"/>
|
||||
<Item id="1" name="&Édition"/>
|
||||
<Item id="2" name="&Recherche"/>
|
||||
<Item id="3" name="&Affichage"/>
|
||||
<Item id="4" name="E&ncodage"/>
|
||||
<Item id="5" name="&Langage"/>
|
||||
<Item id="6" name="&Paramétrage"/>
|
||||
<Item id="7" name="&Macro"/>
|
||||
<Item id="8" name="E&xécution"/>
|
||||
<!--Item id="0" name="&Fichier"/-->
|
||||
<Item menuId="file" name="&Fichier"/>
|
||||
<!--Item id="1" name="&Édition"/-->
|
||||
<Item menuId="edit" name="&Édition"/>
|
||||
<!--Item id="2" name="&Recherche"/-->
|
||||
<Item menuId="search" name="&Recherche"/>
|
||||
<!--Item id="3" name="&Affichage"/-->
|
||||
<Item menuId="view" name="&Affichage"/>
|
||||
<!--Item id="4" name="E&ncodage"/-->
|
||||
<Item menuId="encoding" name="E&ncodage"/>
|
||||
<!--Item id="5" name="&Langage"/-->
|
||||
<Item menuId="language" name="&Langage"/>
|
||||
<!--Item id="6" name="&Paramétrage"/-->
|
||||
<Item menuId="settings" name="&Paramétrage"/>
|
||||
<!--Item id="7" name="&Macro"/-->
|
||||
<Item menuId="macro" name="&Macro"/>
|
||||
<!--Item id="8" name="E&xécution"/-->
|
||||
<Item menuId="run" name="E&xécution"/>
|
||||
|
||||
<Item idName="Plugins" name="&Compléments"/>
|
||||
<Item idName="Window" name="&Documents"/>
|
||||
</Entries>
|
||||
|
@ -161,8 +161,18 @@ struct MenuPosition {
|
||||
|
||||
MenuPosition menuPos[] = {
|
||||
//==============================================
|
||||
// { x, y, z, id},
|
||||
// {L0, L1, L2, id},
|
||||
//==============================================
|
||||
{ 0, -1, -1, "file"},
|
||||
{ 1, -1, -1, "edit"},
|
||||
{ 2, -1, -1, "search"},
|
||||
{ 3, -1, -1, "view"},
|
||||
{ 4, -1, -1, "encoding"},
|
||||
{ 5, -1, -1, "language"},
|
||||
{ 6, -1, -1, "settings"},
|
||||
{ 7, -1, -1, "macro"},
|
||||
{ 8, -1, -1, "run"},
|
||||
|
||||
{ 0, 19, -1, "file-recentFiles"},
|
||||
|
||||
{ 1, 9, -1, "edit-copyToClipboard"},
|
||||
@ -240,18 +250,24 @@ void NativeLangSpeaker::changeMenuLang(HMENU menuHandle, generic_string & plugin
|
||||
childNode = childNode->NextSibling("Item") )
|
||||
{
|
||||
TiXmlElementA *element = childNode->ToElement();
|
||||
int id;
|
||||
if (element->Attribute("id", &id))
|
||||
//int id;
|
||||
const char *menuIdStr = element->Attribute("menuId");
|
||||
//if (element->Attribute("id", &id))
|
||||
if (menuIdStr)
|
||||
{
|
||||
MenuPosition & menuPos = getMenuPosition(menuIdStr);
|
||||
if (menuPos._x != -1)
|
||||
{
|
||||
const char *name = element->Attribute("name");
|
||||
|
||||
#ifdef UNICODE
|
||||
const wchar_t *nameW = wmc->char2wchar(name, _nativeLangEncoding);
|
||||
::ModifyMenu(menuHandle, id, MF_BYPOSITION, 0, nameW);
|
||||
::ModifyMenu(menuHandle, menuPos._x, MF_BYPOSITION, 0, nameW);
|
||||
#else
|
||||
::ModifyMenu(menuHandle, id, MF_BYPOSITION, 0, name);
|
||||
::ModifyMenu(menuHandle, menuPos._x, MF_BYPOSITION, 0, name);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
idName = element->Attribute("idName");
|
||||
|
Loading…
Reference in New Issue
Block a user