ソースを参照

Translated Global clips dialog

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@611 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 14 年 前
コミット
fc30d5ada2
4 ファイル変更52 行追加7 行削除
  1. 12 0
      Debug/Language/English.xml
  2. 8 6
      GlobalClips.cpp
  3. 28 1
      MultiLanguage.cpp
  4. 4 0
      MultiLanguage.h

+ 12 - 0
Debug/Language/English.xml

@@ -320,6 +320,8 @@
 		<Item English_Text = "Import" ID = "32854"></Item>
 		<Item English_Text = "New Clip" ID = "32868"></Item>
 		
+		//Added 12/10/11
+		<Item English_Text = "Global Hot Keys" ID = "32872"></Item>
 	</Ditto_Tray_Icon_Menu>
 
 	//Added in 9-11-09
@@ -351,4 +353,14 @@
 		<Item English_Text = "Win" ID = "2102"></Item>
 		<Item English_Text = "Win" ID = "2106"></Item>
 	</Ditto_Options_CopyBuffers>
+	<Ditto_GlobalHotKeys>
+		<Item English_Text = "Global Hot Keys" ID = "-1"></Item>
+		<Item English_Text = "Close" ID = "2"></Item>
+		<Item English_Text = "(Clip) " ID = "(Clip)"></Item>
+		<Item English_Text = "Error" ID = "Error"></Item>
+		<Item English_Text = "Yes" ID = "Yes"></Item>
+		<Item English_Text = "Description" ID = "Description"></Item>
+		<Item English_Text = "HotKey" ID = "HotKey"></Item>
+		<Item English_Text = "Registered" ID = "Registered"></Item>
+	</Ditto_GlobalHotKeys>
 </Ditto_Language_File>

+ 8 - 6
GlobalClips.cpp

@@ -39,6 +39,8 @@ BOOL GlobalClips::OnInitDialog()
 {
 	CDialogEx::OnInitDialog();
 
+	theApp.m_Language.UpdateGlobalHotKeys(this);
+
 	m_Resize.SetParent(m_hWnd);
 	m_Resize.AddControl(IDC_LIST2, DR_SizeHeight | DR_SizeWidth);
 	m_Resize.AddControl(IDCANCEL, DR_MoveTop | DR_MoveLeft);
@@ -77,7 +79,7 @@ void GlobalClips::LoadItems()
 
 		if(pHotKey->m_clipId > 0)
 		{
-			strItem.Insert(0, _T("(Clip) "));
+			strItem.Insert(0, theApp.m_Language.GetGlobalHotKeyString("(Clip)", "(Clip) "));
 		}
 
 		lvi.iSubItem = 0;
@@ -87,10 +89,10 @@ void GlobalClips::LoadItems()
 		strItem = pHotKey->GetHotKeyDisplay();
 		m_List.SetItemText(row, 1, strItem);
 
-		strItem = _T("Error");
+		strItem = theApp.m_Language.GetGlobalHotKeyString("Error", "Error");
 		if(pHotKey->IsRegistered())
 		{
-			strItem = _T("Yes");
+			strItem = theApp.m_Language.GetGlobalHotKeyString("Yes", "Yes");
 		}
 
 		m_List.SetItemText(row, 2, strItem);
@@ -105,9 +107,9 @@ void GlobalClips::InitListCtrlCols()
 {
 	m_List.SetExtendedStyle(LVS_EX_FULLROWSELECT);
 	
-	m_List.InsertColumn(0, theApp.m_Language.GetString("GlobalKeyDesc", "Description"), LVCFMT_LEFT, 200);
-	m_List.InsertColumn(1, theApp.m_Language.GetString("GlobalKeyHotKey", "Hot Key"), LVCFMT_LEFT, 100);
-	m_List.InsertColumn(2, theApp.m_Language.GetString("GlobalKeyRegistered", "Registered"), LVCFMT_LEFT, 100);
+	m_List.InsertColumn(0, theApp.m_Language.GetGlobalHotKeyString("Description", "Description"), LVCFMT_LEFT, 200);
+	m_List.InsertColumn(1, theApp.m_Language.GetGlobalHotKeyString("HotKey", "Hot Key"), LVCFMT_LEFT, 100);
+	m_List.InsertColumn(2, theApp.m_Language.GetGlobalHotKeyString("Registered", "Registered"), LVCFMT_LEFT, 100);
 }
 
 void GlobalClips::SetNotifyWnd(HWND hWnd)

+ 28 - 1
MultiLanguage.cpp

@@ -52,6 +52,7 @@ void CMultiLanguage::ClearArrays()
 	ClearArray(m_TrayIconRightClickMenu);
 	ClearArray(m_OptionsSheet);
 	ClearArray(m_OptionsCopyBuffers);
+	ClearArray(m_GlobalHotKeys);
 
 	ClearMap(m_StringMap);
 }
@@ -103,7 +104,23 @@ CString CMultiLanguage::GetString(CString csID, CString csDefault)
 		return csDefault;
 
 	return pItem->m_csForeignLang;
-	return "";
+}
+
+CString CMultiLanguage::GetGlobalHotKeyString(CString csID, CString csDefault)
+{
+	CLangItem *pItem;
+
+	INT_PTR size = m_GlobalHotKeys.GetSize();
+	for(int i = 0; i < size; i++)
+	{
+		CLangItem *plItem = m_GlobalHotKeys[i];
+		if(plItem->m_csID == csID)
+		{
+			return plItem->m_csForeignLang;
+		}
+	}
+
+	return csDefault;
 }
 
 bool CMultiLanguage::UpdateRightClickMenu(CMenu *pMenu)
@@ -176,6 +193,11 @@ bool CMultiLanguage::UpdateOptionCopyBuffers(CWnd *pParent)
 	return UpdateWindowToLanguage(pParent, m_OptionsCopyBuffers);
 }
 
+bool CMultiLanguage::UpdateGlobalHotKeys(CWnd *pParent)
+{
+	return UpdateWindowToLanguage(pParent, m_GlobalHotKeys);
+}
+
 bool CMultiLanguage::UpdateMenuToLanguage(CMenu *pMenu, LANGUAGE_ARRAY &Array)
 {
 	INT_PTR size = Array.GetSize();
@@ -321,6 +343,7 @@ bool CMultiLanguage::LoadLanguageFile(CString csFile)
 	bRet = LoadSection(*ItemHeader, m_OptionsSheet, "Ditto_Options_Sheet");
 	bRet = LoadSection(*ItemHeader, m_TrayIconRightClickMenu, "Ditto_Tray_Icon_Menu");
 	bRet = LoadSection(*ItemHeader, m_OptionsCopyBuffers, "Ditto_Options_CopyBuffers");
+	bRet = LoadSection(*ItemHeader, m_GlobalHotKeys, "Ditto_GlobalHotKeys");
 	
 	bRet = LoadStringTableSection(*ItemHeader, m_StringMap, "Ditto_String_Table");
 
@@ -359,6 +382,10 @@ bool CMultiLanguage::LoadSection(TiXmlNode &doc, LANGUAGE_ARRAY &Array, CString
 				plItem->m_csEnglishLang = ItemElement->Attribute("English_Text");
 				csID = ItemElement->Attribute("ID");
 				plItem->m_nID = ATOI(csID);
+				if(plItem->m_nID == 0)
+				{
+					plItem->m_csID = csID;
+				}
  				
 				LPCSTR Value = ForeignNode->Value();
 				CTextConvert::ConvertFromUTF8(Value, plItem->m_csForeignLang);

+ 4 - 0
MultiLanguage.h

@@ -55,6 +55,9 @@ public:
 	bool UpdateMoveToGroups(CWnd *pParent);
 	bool UpdateOptionsSheet(CWnd *pParent);
 	bool UpdateOptionCopyBuffers(CWnd *pParent);
+	bool UpdateGlobalHotKeys(CWnd *pParent);
+
+	CString GetGlobalHotKeyString(CString csID, CString csDefault);
 
 	CString GetString(CString csID, CString csDefault);
 
@@ -83,6 +86,7 @@ protected:
 	LANGUAGE_ARRAY m_MoveToGroups;
 	LANGUAGE_ARRAY m_OptionsSheet;
 	LANGUAGE_ARRAY m_OptionsCopyBuffers;
+	LANGUAGE_ARRAY m_GlobalHotKeys;
 
 	LANGUAGE_MAP	m_StringMap;