From b7cd25430c281006f33aa547e0686a8884aa1c40 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 11 May 2012 23:22:33 +0200 Subject: [PATCH] Moved last remaining strings to resources Signed-off-by: Sven Strickroth --- src/Git/TGitPath.cpp | 27 ++++---- src/Resources/LoglistCommonResource.h | 14 +++++ src/Resources/TortoiseLoglistCommon.rc2 | 17 +++++ src/Resources/TortoiseProcENG.rc | 47 +++++++++++++- src/TortoiseProc/AppUtils.cpp | 18 +++--- src/TortoiseProc/BrowseRefsDlg.cpp | 106 ++++++++++++-------------------- src/TortoiseProc/DeleteConflictDlg.cpp | 6 +- src/TortoiseProc/TortoiseProc.cpp | 7 +-- src/TortoiseProc/resource.h | 29 +++++++++ 9 files changed, 174 insertions(+), 97 deletions(-) diff --git a/src/Git/TGitPath.cpp b/src/Git/TGitPath.cpp index 3a930b52b..452bd67e7 100644 --- a/src/Git/TGitPath.cpp +++ b/src/Git/TGitPath.cpp @@ -26,6 +26,7 @@ #include #include "git.h" #include "Globals.h" +#include "../Resources/LoglistCommonResource.h" #if defined(_MFC_VER) //#include "MessageBox.h" @@ -2075,34 +2076,34 @@ CTGitPath * CTGitPathList::LookForGitPath(CString path) CString CTGitPath::GetActionName(int action) { if(action & CTGitPath::LOGACTIONS_UNMERGED) - return _T("Conflict"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_CONFLICT); if(action & CTGitPath::LOGACTIONS_ADDED) - return _T("Added"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_ADD); if(action & CTGitPath::LOGACTIONS_DELETED) - return _T("Deleted"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_DELETE); if(action & CTGitPath::LOGACTIONS_MERGED ) - return _T("Merged"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_MERGED); if(action & CTGitPath::LOGACTIONS_MODIFIED) - return _T("Modified"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_MODIFIED); if(action & CTGitPath::LOGACTIONS_REPLACED) - return _T("Rename"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_RENAME); if(action & CTGitPath::LOGACTIONS_COPY) - return _T("Copy"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_COPY); if(action & CTGitPath::LOGACTIONS_FORWORD ) - return _T("Forward"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_FORWARD); if(action & CTGitPath::LOGACTIONS_REBASE_EDIT) - return _T("Edit"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_EDIT); if(action & CTGitPath::LOGACTIONS_REBASE_SQUASH) - return _T("Squash"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_SQUASH); if(action & CTGitPath::LOGACTIONS_REBASE_PICK) - return _T("Pick"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_PICK); if(action & CTGitPath::LOGACTIONS_REBASE_SKIP) - return _T("Skip"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_SKIP); - return _T("Unknown"); + return MAKEINTRESOURCE(IDS_PATHACTIONS_UNKNOWN); } CString CTGitPath::GetActionName() { diff --git a/src/Resources/LoglistCommonResource.h b/src/Resources/LoglistCommonResource.h index d252ef22e..9ecdc8ec1 100644 --- a/src/Resources/LoglistCommonResource.h +++ b/src/Resources/LoglistCommonResource.h @@ -112,3 +112,17 @@ #define IDS_DELETE_BRANCHTAG_SHORT 20092 #define IDD_FIND 20100 #define IDS_CHERRY_PICK_VERSIONS 20101 + +#define IDS_PATHACTIONS_ADD 20102 +#define IDS_PATHACTIONS_MODIFIED 20103 +#define IDS_PATHACTIONS_DELETE 20104 +#define IDS_PATHACTIONS_CONFLICT 20105 +#define IDS_PATHACTIONS_MERGED 20106 +#define IDS_PATHACTIONS_RENAME 20107 +#define IDS_PATHACTIONS_COPY 20108 +#define IDS_PATHACTIONS_FORWARD 20109 +#define IDS_PATHACTIONS_EDIT 20110 +#define IDS_PATHACTIONS_SQUASH 20111 +#define IDS_PATHACTIONS_PICK 20112 +#define IDS_PATHACTIONS_SKIP 20113 +#define IDS_PATHACTIONS_UNKNOWN 20114 diff --git a/src/Resources/TortoiseLoglistCommon.rc2 b/src/Resources/TortoiseLoglistCommon.rc2 index 5c9d59134..e54841908 100644 --- a/src/Resources/TortoiseLoglistCommon.rc2 +++ b/src/Resources/TortoiseLoglistCommon.rc2 @@ -104,6 +104,23 @@ END STRINGTABLE BEGIN + IDS_PATHACTIONS_ADD "Added" + IDS_PATHACTIONS_MODIFIED "Modified" + IDS_PATHACTIONS_DELETE "Deleted" + IDS_PATHACTIONS_CONFLICT "Conflict" + IDS_PATHACTIONS_MERGED "Merged" + IDS_PATHACTIONS_RENAME "Rename" + IDS_PATHACTIONS_COPY "Copy" + IDS_PATHACTIONS_FORWARD "Forward" + IDS_PATHACTIONS_EDIT "Edit" + IDS_PATHACTIONS_SQUASH "Squash" + IDS_PATHACTIONS_PICK "Pick" + IDS_PATHACTIONS_SKIP "Skip" + IDS_PATHACTIONS_UNKNOWN "Unknown" +END + +STRINGTABLE +BEGIN IDS_SCIEDIT_UNDO "&Undo" IDS_SCIEDIT_REDO "&Redo" IDS_SCIEDIT_CUT "Cu&t" diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index 1a31bdbd5..58f8d6117 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -2526,11 +2526,13 @@ BEGIN IDS_SETTINGS_SELECTSSH "Select SSH client" IDS_SETTINGS_EXTDIFF_TT "An external diff program used\r\nfor comparing different revisions of files\r\n\r\nYou can specify the following parameters to the path:\r\n%base : the base file\r\n%mine : the modified file" IDS_SETTINGS_EXTDIFFBROWSE_TT "Browse for the external diff program" + IDS_PROC_BROWSEREFS_FETCHFROM "Fetch from ""%s""" END STRINGTABLE BEGIN IDS_MSYSGIT_PATH_TT "MsysGit Install Path" + IDS_PROC_BROWSEREFS_COMPAREREFS "Compare selected refs" IDS_SETTINGS_EXTMERGE_TT "An external merge program used\r\nto resolve conflicted files.\r\n\r\nYou can specify the following parameters to the path:\r\n%merged : the conflicted file, where to save\r\n%theirs : the file as it is in the repository\r\n%mine : your own file, with your changes\r\n%base : the original file without your changes" IDS_SETTINGS_PROXYSERVER_TT "Either the name or IP of the proxy server" @@ -2538,6 +2540,8 @@ BEGIN "A viewer program for GNU diff files (patch files).\r\nIf you don't have one use NotePad." IDS_SETTINGS_AUTOCLOSE_TT "Select the behaviour of the progress dialog at the end of the operation." + IDS_PROC_BROWSEREFS_RENAME "Rename" + IDS_PROC_BROWSEREFS_MANAGEREMOTES "Manage Remotes" IDS_PROC_WARNREVERT "Are you sure you want to revert %d item(s)? You will lose all changes since the last update!" IDS_PROC_CLEANUPFINISHED "Cleanup has successfully processed the following paths:\n%s" @@ -2562,6 +2566,7 @@ BEGIN "Please enter a path where to apply the hook script to." IDS_ERR_NOHOOKCOMMANDPECIFIED "Please enter a hook script to execute." IDS_ERR_HOOKFAILED "The hook script returned an error:\n%s" + IDS_PROC_BROWSEREFS_DELETETAG "Delete tag" IDS_ERR_INVALIDREVRANGE "Invalid revision range!\nValid revisions are numbers and HEAD, separated by commas.\nA range can be specified with a dash.\nExample: 2-5,7,10,44-70,300-HEAD" IDS_ERR_NOPREVREVISION "Could not determine the last committed revision!" IDS_PROC_CLEANUPFINISHED_FAILED @@ -2580,14 +2585,17 @@ BEGIN IDS_PROC_OVERWRITE_CONFIRM "The file\n%s\nalready exists! Do you want to overwrite it?" IDS_PROC_REPOCREATEFINISHED "The repository was successfully created." + IDS_PROC_BROWSEREFS_DELETEREMOTEBRANCH "Delete remote branch" IDS_PROC_MOVING "Moving..." IDS_PROC_RELOCATING "Relocating..." + IDS_PROC_BROWSEREFS_DELETEREMOTEBRANCHES "Delete %d remote branches" IDS_MSGBOX_DONOTSHOW "Don't show this message again" IDS_PROC_COPYING "Copying..." IDS_PROC_COPYINGPROG "Copying %s" IDS_PROC_MOVINGPROG "Moving %s" IDS_PROC_CPYMVPROG2 "to %s" IDS_PROC_ENTERURL "Enter URL" + IDS_PROC_BROWSEREFS_DELETEBRANCH "Delete branch" IDS_SETTINGS_SHORTDATEFORMAT_TT "Check to use a less verbose date and time format in log messages" END @@ -2596,6 +2604,7 @@ STRINGTABLE BEGIN IDS_SETTINGS_RELATIVETIMES_TT "Check to show relative times in log messages" + IDS_PROC_BROWSEREFS_DELETEBRANCHES "Delete %d branches" IDS_ERR_EXTDIFFSTART "Could not start external diff program!\n\n%s" IDS_ERR_NOCOMMAND "No command specified!\n\nTortoiseProc.exe is used by the Shell extension and should not be called directly!" IDS_ERR_NOCOMMANDVALUE "No command value specified!" @@ -3298,7 +3307,7 @@ BEGIN "Could not reset to last commit (second step). Aborting..." IDS_REG_ERROR "Error while reading/writing the registry key %s\n%s" IDS_PROC_COMBINE_ERRORRESETHEAD "Could not reset to original HEAD." - IDS_PROC_DELETENREFS """Do you really want to permanently delete the %d selected refs? It can NOT be recovered!" + IDS_PROC_DELETENREFS "Do you really want to permanently delete the %d selected refs? It can NOT be recovered!" IDS_PROC_DELETEREF "Warning: ""%s"" will be permanently deleted. It can NOT be recovered!\r\n\r\nDo you really want to continue?" IDS_DELETEBUTTON "&Delete" IDS_PROC_DELETEREMOTEBRANCH @@ -3794,6 +3803,42 @@ BEGIN IDS_PROC_SYNC_PUSH "Pus&h" END +STRINGTABLE +BEGIN + IDS_PROC_BROWSEREFS_DELETETAGS "Delete %d tags" + IDS_PROCS_TITLE_GITREMOTESETTINGS "Git Remote Settings" + IDS_PROC_BROWSEREFS_RENAMEONLYBRANCHES + "At the moment, you can only rename branches." + IDS_PROC_BROWSEREFS_NOCHANGEOFTYPE + "You cannot change the type of this ref with a rename." + IDS_PROC_BROWSEREFS_WARNINGUNMERGED + "Warning: This branch is not fully merged into HEAD." + IDS_PROC_BROWSEREFS_WARNINGNOMERGECHECK + "Warning: It has not been checked if these branches have been fully merged into HEAD." + IDS_PROC_BROWSEREFS_WARNINGDELETEREMOTEBRANCHES + "Warning: This action will remove the branches on the remote." + IDS_PROC_NOMSYSGIT "MSysGit (http://code.google.com/p/msysgit/) not found." + IDS_PROC_SETMSYSGITPATH "&Set MSysGit path" + IDS_PROC_GOTOMSYSGITWEBSITE "&Open msysGit WebSite" + IDS_PROC_OLDMSYSGIT "You have an old version of msysGit (http://code.google.com/p/msysgit/) installed.\n\nYou should consider an upgrade to 1.7.10+ which supports UTF-8 and is compatible to the *nix version of git." + IDS_PROC_NOTSHOWAGAINIGNORE + "Do ¬ show me this warning again (if Ignore is selected)" + IDS_PROC_EDITLOCALGITCONFIG "&Edit .git/config" + IDS_PROC_EDITGLOBALGITCONFIG "Edit &global .gitconfig" + IDS_PROC_STASHPOPSUCCESS "Stash POP successful" + IDS_PROC_STASHAPPLYSUCCESS "Stash Apply successful" +END + +STRINGTABLE +BEGIN + IDS_PROC_STASHPOPFAILED "Stash POP failed!!!" + IDS_PROC_STASHPOPFAILEDCONFLICTS + "Stash POP failed, there are conflicts" + IDS_PROC_STASHAPPLYFAILEDCONFLICTS + "Stash Apply failed, there are conflicts" + IDS_PROC_CREATED "Created" +END + #endif // Englisch (USA) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index 978f58a43..d919c6fb6 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -119,12 +119,13 @@ int CAppUtils::StashApply(CString ref, bool showChanges /* true */) } else { - CString withConflicts; + CString message; + message.LoadString(IDS_PROC_STASHAPPLYSUCCESS); if (hasConflicts) - withConflicts = _T(" with conflicts"); + message.LoadString(IDS_PROC_STASHAPPLYFAILEDCONFLICTS); if (showChanges) { - if(CMessageBox::Show(NULL,CString(_T("Stash Apply successful") + withConflicts + _T("") + CString(MAKEINTRESOURCE(IDS_SEECHANGES))) + if(CMessageBox::Show(NULL,message + _T("\n") + CString(MAKEINTRESOURCE(IDS_SEECHANGES)) ,_T("TortoiseGit"),MB_YESNO|MB_ICONINFORMATION) == IDYES) { CChangedDlg dlg; @@ -135,7 +136,7 @@ int CAppUtils::StashApply(CString ref, bool showChanges /* true */) } else { - CMessageBox::Show(NULL, _T("Stash Apply successful") + withConflicts + _T("") ,_T("TortoiseGit"), MB_OK | MB_ICONINFORMATION); + CMessageBox::Show(NULL, message ,_T("TortoiseGit"), MB_OK | MB_ICONINFORMATION); return 0; } } @@ -151,13 +152,14 @@ int CAppUtils::StashPop(bool showChanges /* true */) bool hasConflicts = (out.Find(_T("CONFLICT")) >= 0); if (ret && !(ret == 1 && hasConflicts)) { - CMessageBox::Show(NULL,CString(_T("Stash POP failed!!!\n"))+out,_T("TortoiseGit"),MB_OK|MB_ICONERROR); + CMessageBox::Show(NULL,CString(MAKEINTRESOURCE(IDS_PROC_STASHPOPFAILED)) + _T("\n") + out, _T("TortoiseGit"), MB_OK | MB_ICONERROR); } else { - CString message = _T("Stash POP successful"); + CString message; + message.LoadString(IDS_PROC_STASHPOPSUCCESS); if (hasConflicts) - message = _T("Stash POP Failed, there are conflicts"); + message.LoadString(IDS_PROC_STASHPOPFAILEDCONFLICTS); if (showChanges) { if(CMessageBox::Show(NULL,CString(message + _T("\n") + CString(MAKEINTRESOURCE(IDS_SEECHANGES))) @@ -1166,7 +1168,7 @@ void CAppUtils::DescribeFile(bool mode, bool base,CString &descript) descript = CString(MAKEINTRESOURCE(IDS_SVNACTION_MODIFIED)); return; } - descript = CString(MAKEINTRESOURCE(IDS_SVNACTION_ADD)); + descript = CString(MAKEINTRESOURCE(IDS_PROC_CREATED)); return; } diff --git a/src/TortoiseProc/BrowseRefsDlg.cpp b/src/TortoiseProc/BrowseRefsDlg.cpp index 758b6d924..cff9f4fc8 100644 --- a/src/TortoiseProc/BrowseRefsDlg.cpp +++ b/src/TortoiseProc/BrowseRefsDlg.cpp @@ -437,10 +437,7 @@ bool CBrowseRefsDlg::ConfirmDeleteRef(VectorPShadowTree& leafs) ASSERT(!leafs.empty()); CString csMessage; - CString csTitle; - UINT mbIcon=MB_ICONQUESTION; - csMessage = L"Are you sure you want to delete "; bool bIsRemoteBranch = false; bool bIsBranch = false; @@ -452,16 +449,7 @@ bool CBrowseRefsDlg::ConfirmDeleteRef(VectorPShadowTree& leafs) if(leafs.size() == 1) { CString branchToDelete = leafs[0]->GetRefName().Mid(bIsRemoteBranch ? 13 : 11); - csTitle.Format(L"Confirm deletion of %sbranch %s", - bIsRemoteBranch? L"remote ": L"", - branchToDelete); - - csMessage += "the "; - if(bIsRemoteBranch) - csMessage += L"remote "; - csMessage += L"branch:\r\n\r\n"; - csMessage += branchToDelete; - csMessage += L""; + csMessage.Format(IDS_PROC_DELETEBRANCHTAG, branchToDelete); //Check if branch is fully merged in HEAD CGitHash branchHash = g_Git.GetHash(leafs[0]->GetRefName()); @@ -475,34 +463,30 @@ bool CBrowseRefsDlg::ConfirmDeleteRef(VectorPShadowTree& leafs) if(commonAncestor != branchHash) { - csMessage += L"\r\n\r\nWarning:\r\nThis branch is not fully merged into HEAD."; + csMessage += L"\r\n\r\n"; + csMessage += CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_WARNINGUNMERGED)); mbIcon = MB_ICONWARNING; } + if(bIsRemoteBranch) { - csMessage += L"\r\n\r\nWarning:\r\nThis action will remove the branch on the remote."; + csMessage += L"\r\n\r\n"; + csMessage += CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_WARNINGDELETEREMOTEBRANCHES)); mbIcon = MB_ICONWARNING; } } else { - csTitle.Format(L"Confirm deletion of %d %sbranches", - leafs.size(), - bIsRemoteBranch? L"remote ": L""); - - CString csMoreMsgText; - csMoreMsgText.Format(L"%d ", leafs.size()); - csMessage += csMoreMsgText; - if(bIsRemoteBranch) - csMessage += L"remote "; - csMessage += L"branches"; + csMessage.Format(IDS_PROC_DELETENREFS, leafs.size()); - csMessage += L"\r\n\r\nWarning:\r\nIt has not been checked if these branches have been fully merged into HEAD."; + csMessage += L"\r\n\r\n"; + csMessage += CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_WARNINGNOMERGECHECK)); mbIcon = MB_ICONWARNING; if(bIsRemoteBranch) { - csMessage += L"\r\n\r\nWarning:\r\nThis action will remove the branches on the remote."; + csMessage += L"\r\n\r\n"; + csMessage += CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_WARNINGDELETEREMOTEBRANCHES)); mbIcon = MB_ICONWARNING; } } @@ -513,23 +497,15 @@ bool CBrowseRefsDlg::ConfirmDeleteRef(VectorPShadowTree& leafs) if(leafs.size() == 1) { CString tagToDelete = leafs[0]->GetRefName().Mid(10); - csTitle.Format(L"Confirm deletion of tag %s", tagToDelete); - csMessage += "the tag:\r\n\r\n"; - csMessage += tagToDelete; - csMessage += ""; + csMessage.Format(IDS_PROC_DELETEBRANCHTAG, tagToDelete); } else { - CString tagToDelete = leafs[0]->GetRefName().Mid(10); - csTitle.Format(L"Confirm deletion of %d tags", leafs.size()); - CString csMoreMsgText; - csMoreMsgText.Format(L"%d ", leafs.size()); - csMessage += csMoreMsgText; - csMessage += L"tags"; + csMessage.Format(IDS_PROC_DELETENREFS, leafs.size()); } } - return CMessageBox::Show(m_hWnd,csMessage,csTitle,MB_YESNO|mbIcon)==IDYES; + return CMessageBox::Show(m_hWnd, csMessage, _T("TortoiseGit"), MB_YESNO | mbIcon) == IDYES; } @@ -569,12 +545,10 @@ bool CBrowseRefsDlg::DoDeleteRef(CString completeRefName, bool bForce) } else cmd.Format(L"git.exe branch -%c -- %s",bForce?L'D':L'd',branchToDelete); - CString resultDummy; - if(g_Git.Run(cmd,&resultDummy,CP_UTF8)!=0) + CString errorMsg; + if(g_Git.Run(cmd,&errorMsg,CP_UTF8)!=0) { - CString errorMsg; - errorMsg.Format(L"Could not delete branch %s. Message from git:\r\n\r\n%s",branchToDelete,resultDummy); - CMessageBox::Show(m_hWnd,errorMsg,L"Error deleting branch",MB_OK|MB_ICONERROR); + CMessageBox::Show(m_hWnd, errorMsg, _T("TortoiseGit"), MB_OK | MB_ICONERROR); return false; } } @@ -583,12 +557,10 @@ bool CBrowseRefsDlg::DoDeleteRef(CString completeRefName, bool bForce) CString tagToDelete = completeRefName.Mid(10); CString cmd; cmd.Format(L"git.exe tag -d -- %s",tagToDelete); - CString resultDummy; - if(g_Git.Run(cmd,&resultDummy,CP_UTF8)!=0) + CString errorMsg; + if(g_Git.Run(cmd,&errorMsg,CP_UTF8)!=0) { - CString errorMsg; - errorMsg.Format(L"Could not delete tag %s. Message from git:\r\n\r\n%s",tagToDelete,resultDummy); - CMessageBox::Show(m_hWnd,errorMsg,L"Error deleting tag",MB_OK|MB_ICONERROR); + CMessageBox::Show(m_hWnd, errorMsg, _T("TortoiseGit"), MB_OK | MB_ICONERROR); return false; } } @@ -675,7 +647,7 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh remoteName = selectedLeafs[0]->GetRefName(); remoteName = remoteName.Mid(13); remoteName = remoteName.Tokenize(L"/", dummy); - fetchFromCmd.Format(L"Fetch from \"%s\"", remoteName); + fetchFromCmd.Format(IDS_PROC_BROWSEREFS_FETCHFROM, remoteName); } else if(selectedLeafs[0]->IsFrom(L"refs/tags")) { @@ -705,7 +677,7 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh bAddSeparator = false; if (m_bHasWC) { - popupMenu.AppendMenuIcon(eCmd_Switch, L"Switch to this Ref", IDI_SWITCH); + popupMenu.AppendMenuIcon(eCmd_Switch, CString(MAKEINTRESOURCE(IDS_SWITCH_TO_THIS)), IDI_SWITCH); popupMenu.AppendMenu(MF_SEPARATOR); } @@ -719,13 +691,13 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh if(bShowRenameOption) { bAddSeparator = true; - popupMenu.AppendMenuIcon(eCmd_Rename, L"Rename", IDI_RENAME); + popupMenu.AppendMenuIcon(eCmd_Rename, CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_RENAME)), IDI_RENAME); } } else if(selectedLeafs.size() == 2) { bAddSeparator = true; - popupMenu.AppendMenuIcon(eCmd_Diff, L"Compare these Refs", IDI_DIFF); + popupMenu.AppendMenuIcon(eCmd_Diff, CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_COMPAREREFS)), IDI_DIFF); } if(!selectedLeafs.empty()) @@ -736,9 +708,9 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh popupMenu.AppendMenu(MF_SEPARATOR); CString menuItemName; if(selectedLeafs.size() == 1) - menuItemName = L"Delete remote branch"; + menuItemName.LoadString(IDS_PROC_BROWSEREFS_DELETEREMOTEBRANCH); else - menuItemName.Format(L"Delete %d remote branches", selectedLeafs.size()); + menuItemName.Format(IDS_PROC_BROWSEREFS_DELETEREMOTEBRANCHES, selectedLeafs.size()); popupMenu.AppendMenuIcon(eCmd_DeleteRemoteBranch, menuItemName, IDI_DELETE); bAddSeparator = true; @@ -749,9 +721,9 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh popupMenu.AppendMenu(MF_SEPARATOR); CString menuItemName; if(selectedLeafs.size() == 1) - menuItemName = L"Delete branch"; + menuItemName.LoadString(IDS_PROC_BROWSEREFS_DELETEBRANCH); else - menuItemName.Format(L"Delete %d branches", selectedLeafs.size()); + menuItemName.Format(IDS_PROC_BROWSEREFS_DELETEBRANCHES, selectedLeafs.size()); popupMenu.AppendMenuIcon(eCmd_DeleteBranch, menuItemName, IDI_DELETE); bAddSeparator = true; @@ -762,9 +734,9 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh popupMenu.AppendMenu(MF_SEPARATOR); CString menuItemName; if(selectedLeafs.size() == 1) - menuItemName = L"Delete tag"; + menuItemName.LoadString(IDS_PROC_BROWSEREFS_DELETETAG); else - menuItemName.Format(L"Delete %d tags", selectedLeafs.size()); + menuItemName.Format(IDS_PROC_BROWSEREFS_DELETETAGS, selectedLeafs.size()); popupMenu.AppendMenuIcon(eCmd_DeleteTag, menuItemName, IDI_DELETE); bAddSeparator = true; @@ -779,7 +751,7 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh { if(bAddSeparator) popupMenu.AppendMenu(MF_SEPARATOR); - popupMenu.AppendMenuIcon(eCmd_ManageRemotes, L"Manage Remotes", IDI_SETTINGS); + popupMenu.AppendMenuIcon(eCmd_ManageRemotes, CString(MAKEINTRESOURCE(IDS_PROC_BROWSEREFS_MANAGEREMOTES)), IDI_SETTINGS); bAddSeparator = true; if(selectedLeafs.empty()) { @@ -790,7 +762,7 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh if(!remoteName.IsEmpty()) { CString fetchFromCmd; - fetchFromCmd.Format(L"Fetch from %s", remoteName); + fetchFromCmd.Format(IDS_PROC_BROWSEREFS_FETCHFROM, remoteName); popupMenu.AppendMenuIcon(eCmd_Fetch, fetchFromCmd, IDI_PULL); } } @@ -872,7 +844,7 @@ void CBrowseRefsDlg::ShowContextMenu(CPoint point, HTREEITEM hTreePos, VectorPSh break; case eCmd_ManageRemotes: { - CSinglePropSheetDlg(L"Git Remote Settings",new CSettingGitRemote(g_Git.m_CurrentDir),this).DoModal(); + CSinglePropSheetDlg(CString(MAKEINTRESOURCE(IDS_PROCS_TITLE_GITREMOTESETTINGS)), new CSettingGitRemote(g_Git.m_CurrentDir), this).DoModal(); // CSettingGitRemote W_Remotes(m_cmdPath); // W_Remotes.DoModal(); Refresh(); @@ -1096,7 +1068,7 @@ void CBrowseRefsDlg::OnLvnEndlabeleditListRefLeafs(NMHDR *pNMHDR, LRESULT *pResu if(!pTree->IsFrom(L"refs/heads")) { - CMessageBox::Show(m_hWnd, L"At the moment, you can only rename branches.", L"Cannot Rename This Ref",MB_OK|MB_ICONERROR); + CMessageBox::Show(m_hWnd, IDS_PROC_BROWSEREFS_RENAMEONLYBRANCHES, IDS_APPNAME, MB_OK | MB_ICONERROR); return; } @@ -1109,18 +1081,16 @@ void CBrowseRefsDlg::OnLvnEndlabeleditListRefLeafs(NMHDR *pNMHDR, LRESULT *pResu if(wcsncmp(newName,L"refs/heads/",11)!=0) { - CMessageBox::Show(m_hWnd, L"You cannot change the type of this ref with a rename.", L"Cannot Change Ref Type",MB_OK|MB_ICONERROR); + CMessageBox::Show(m_hWnd, IDS_PROC_BROWSEREFS_NOCHANGEOFTYPE, IDS_APPNAME, MB_OK | MB_ICONERROR); return; } CString newNameTrunced = newName.Mid(11); - CString result; - if(g_Git.Run(L"git branch -m \"" + origName + L"\" \"" + newNameTrunced + L"\"", &result, CP_UTF8) != 0) + CString errorMsg; + if(g_Git.Run(L"git branch -m \"" + origName + L"\" \"" + newNameTrunced + L"\"", &errorMsg, CP_UTF8) != 0) { - CString errorMsg; - errorMsg.Format(L"Could not rename branch %s. Message from git:\r\n\r\n%s",origName,result); - CMessageBox::Show(m_hWnd,errorMsg,L"Error Renaming Branch",MB_OK|MB_ICONERROR); + CMessageBox::Show(m_hWnd, errorMsg, _T("TortoiseGit"), MB_OK | MB_ICONERROR); return; } //Do as if it failed to rename. Let Refresh() do the job. diff --git a/src/TortoiseProc/DeleteConflictDlg.cpp b/src/TortoiseProc/DeleteConflictDlg.cpp index e7210cd01..935b68a07 100644 --- a/src/TortoiseProc/DeleteConflictDlg.cpp +++ b/src/TortoiseProc/DeleteConflictDlg.cpp @@ -1,6 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2009-2011 - TortoiseGit +// Copyright (C) 2009-2012 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -61,9 +61,9 @@ BOOL CDeleteConflictDlg::OnInitDialog() CStandAloneDialog::OnInitDialog(); if(this->m_bShowModifiedButton ) - this->GetDlgItem(IDC_MODIFY)->SetWindowText(_T("Modified")); + this->GetDlgItem(IDC_MODIFY)->SetWindowText(CString(MAKEINTRESOURCE(IDS_SVNACTION_MODIFIED))); else - this->GetDlgItem(IDC_MODIFY)->SetWindowText(_T("Created")); + this->GetDlgItem(IDC_MODIFY)->SetWindowText(CString(MAKEINTRESOURCE(IDS_PROC_CREATED))); CString sWindowTitle; GetWindowText(sWindowTitle); diff --git a/src/TortoiseProc/TortoiseProc.cpp b/src/TortoiseProc/TortoiseProc.cpp index 4bf17ffb1..57409d721 100644 --- a/src/TortoiseProc/TortoiseProc.cpp +++ b/src/TortoiseProc/TortoiseProc.cpp @@ -221,8 +221,7 @@ BOOL CTortoiseProcApp::InitInstance() if(!CheckMsysGitDir()) { - UINT ret = CMessageBox::Show(NULL, _T("MSysGit (http://code.google.com/p/msysgit/) not found."), - _T("TortoiseGit"), 3, IDI_HAND, _T("&Set MSysGit path"), _T("&Goto WebSite"), _T("&Abort")); + UINT ret = CMessageBox::Show(NULL, IDS_PROC_NOMSYSGIT, IDS_APPNAME, 3, IDI_HAND, IDS_PROC_SETMSYSGITPATH, IDS_PROC_GOTOMSYSGITWEBSITE, IDS_ABORTBUTTON); if(ret == 2) { ShellExecute(NULL, NULL, _T("http://code.google.com/p/msysgit/"), NULL, NULL, SW_SHOW); @@ -241,7 +240,7 @@ BOOL CTortoiseProcApp::InitInstance() } if (CAppUtils::GetMsysgitVersion() < 0x01070a00) { - int ret = CMessageBox::ShowCheck(NULL, _T("You have an old version of msysGit (http://code.google.com/p/msysgit/) installed.\n\nYou should consider an upgrade to 1.7.10+ which supports UTF-8 and is compatible to the *nix version of git."), _T("TortoiseGit"), 1, IDI_EXCLAMATION, _T("&Open msysGit WebSite"), _T("&Abort"), _T("&Ignore"), _T("OldMsysgitVersionWarning"), _T("Do ¬ show me this warning again (if Ignore is selected)")); + int ret = CMessageBox::ShowCheck(NULL, IDS_PROC_OLDMSYSGIT, IDS_APPNAME, 1, IDI_EXCLAMATION, IDS_PROC_GOTOMSYSGITWEBSITE, IDS_ABORTBUTTON, IDS_IGNOREBUTTON, _T("OldMsysgitVersionWarning"), IDS_PROC_NOTSHOWAGAINIGNORE); if (ret == 1) { CRegStdDWORD(_T("Software\\TortoiseGit\\TortoiseProc\\OldMsysgitVersionWarning")).removeValue(); // only store answer if it is "Ignore" @@ -438,7 +437,7 @@ BOOL CTortoiseProcApp::InitInstance() if (!err.IsEmpty()) { - UINT choice = CMessageBox::Show(hWndExplorer, err, _T("TortoiseGit Error"), 1, IDI_ERROR, _T("&Edit .git/config"), _T("Edit &global .gitconfig"), _T("&Abort")); + UINT choice = CMessageBox::Show(hWndExplorer, err, _T("TortoiseGit"), 1, IDI_ERROR, CString(MAKEINTRESOURCE(IDS_PROC_EDITLOCALGITCONFIG)), CString(MAKEINTRESOURCE(IDS_PROC_EDITGLOBALGITCONFIG)), CString(MAKEINTRESOURCE(IDS_ABORTBUTTON))); if (choice == 1) { // open the config file with alternative editor diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index c5e1bda18..bd8c3ac7d 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -611,9 +611,11 @@ #define IDS_SETTINGS_EXTDIFFBROWSE_TT 1246 #define IDC_HISTORY 1246 #define IDS_SETTINGS_CHANGEDDIRS_TT 1247 +#define IDS_PROC_BROWSEREFS_FETCHFROM 1247 #define IDS_MSYSGIT_PATH_TT 1248 #define IDS_SETTINGS_FOLDERSTATUS_TT 1249 #define IDC_CONFLICTCOLOR 1249 +#define IDS_PROC_BROWSEREFS_COMPAREREFS 1249 #define IDS_SETTINGS_EXTMERGE_TT 1250 #define IDC_ADDEDCOLOR 1250 #define IDS_SETTINGS_PROXYSERVER_TT 1251 @@ -623,7 +625,9 @@ #define IDS_SETTINGS_AUTOCLOSE_TT 1253 #define IDC_MODIFIEDCOLOR 1253 #define IDC_RESTORE 1254 +#define IDS_PROC_BROWSEREFS_RENAME 1254 #define IDC_DELETEDNODECOLOR 1255 +#define IDS_PROC_BROWSEREFS_MANAGEREMOTES 1255 #define IDS_PROC_WARNREVERT 1256 #define IDC_ADDEDNODECOLOR 1256 #define IDS_PROC_CLEANUPFINISHED 1257 @@ -648,11 +652,13 @@ #define IDS_PROC_OVERWRITE_CONFIRM 1266 #define IDS_PROC_REPOCREATEFINISHED 1267 #define IDC_MAXHISTORY 1268 +#define IDS_PROC_BROWSEREFS_DELETEREMOTEBRANCH 1268 #define IDS_PROC_MOVING 1269 #define IDC_CACHEDEFAULT 1269 #define IDS_PROC_RELOCATING 1270 #define IDC_CACHESHELL 1270 #define IDC_CACHESHELL2 1271 +#define IDS_PROC_BROWSEREFS_DELETEREMOTEBRANCHES 1271 #define IDC_CACHENONE 1272 #define IDS_MSGBOX_DONOTSHOW 1272 #define IDC_URLHISTORY 1272 @@ -667,6 +673,7 @@ #define IDS_PROC_ENTERURL 1277 #define IDC_RESIZABLEHISTORY 1277 #define IDC_AUTHHISTORY 1278 +#define IDS_PROC_BROWSEREFS_DELETEBRANCH 1278 #define IDS_SETTINGS_SHORTDATEFORMAT_TT 1279 #define IDC_BUTTON4 1279 #define IDC_AUTHHISTCLEAR 1279 @@ -676,6 +683,7 @@ #define IDS_SETTINGS_RELATIVETIMES_TT 1280 #define IDC_REPOLOG 1280 #define IDC_REPOLOGCLEAR 1281 +#define IDS_PROC_BROWSEREFS_DELETEBRANCHES 1281 #define IDS_ERR_EXTDIFFSTART 1282 #define IDS_ERR_NOCOMMAND 1283 #define IDS_ERR_NOCOMMANDVALUE 1284 @@ -733,6 +741,7 @@ #define IDS_ERR_NOHOOKPATHSPECIFIED 1318 #define IDS_ERR_NOHOOKCOMMANDPECIFIED 1319 #define IDS_ERR_HOOKFAILED 1320 +#define IDS_PROC_BROWSEREFS_DELETETAG 1321 #define IDS_ERR_INVALIDREVRANGE 1322 #define IDC_HOOKPATH 1323 #define IDS_ERR_NOPREVREVISION 1323 @@ -744,17 +753,37 @@ #define IDS_ERR_TEXTVIEWSTART 1326 #define IDC_WAITCHECK 1327 #define IDS_ERR_FAILEDISSUETRACKERCOM 1327 +#define IDS_PROC_BROWSEREFS_DELETETAGS 1328 #define IDC_HOOKTYPECOMBO 1329 +#define IDS_PROCS_TITLE_GITREMOTESETTINGS 1329 #define IDC_HOOKLIST 1330 +#define IDS_PROC_BROWSEREFS_RENAMEONLYBRANCHES 1330 #define IDC_HOOKEDITBUTTON 1331 +#define IDS_PROC_BROWSEREFS_NOCHANGEOFTYPE 1331 #define IDC_HOOKREMOVEBUTTON 1332 +#define IDS_PROC_BROWSEREFS_WARNINGUNMERGED 1332 #define IDC_HOOKCOMMANDBROWSE 1333 +#define IDS_PROC_BROWSEREFS_WARNINGNOMERGECHECK 1333 #define IDC_HOOKTYPELABEL 1334 +#define IDS_PROC_BROWSEREFS_WARNINGDELETEREMOTEBRANCHES 1334 #define IDC_HOOKWCPATHLABEL 1335 +#define IDS_PROC_NOMSYSGIT 1335 #define IDC_HOOKCMLABEL 1336 +#define IDS_PROC_SETMSYSGITPATH 1336 #define IDC_LOGINFO 1337 +#define IDS_PROC_GOTOMSYSGITWEBSITE 1337 +#define IDS_PROC_OLDMSYSGIT 1338 +#define IDS_PROC_NOTSHOWAGAINIGNORE 1339 +#define IDS_PROC_EDITLOCALGITCONFIG 1340 #define IDC_EOLCOMBO 1341 +#define IDS_PROC_EDITGLOBALGITCONFIG 1341 #define IDC_EOLLABEL 1342 +#define IDS_PROC_STASHPOPSUCCESS 1342 +#define IDS_PROC_STASHAPPLYSUCCESS 1343 +#define IDS_PROC_STASHPOPFAILED 1344 +#define IDS_PROC_STASHPOPFAILEDCONFLICTS 1345 +#define IDS_PROC_STASHAPPLYFAILEDCONFLICTS 1346 +#define IDS_PROC_CREATED 1347 #define IDC_REV1BTN 1353 #define IDC_REV2BTN 1354 #define IDC_ACTIONLABEL 1356 -- 2.11.4.GIT