Skip to content

Commit

Permalink
Add a missing translation
Browse files Browse the repository at this point in the history
  • Loading branch information
rlbxku1r authored and eranif committed Jan 23, 2022
1 parent b16d5b4 commit aa29fee
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 33 deletions.
29 changes: 14 additions & 15 deletions SpellChecker/scGlobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,23 @@
// License:
/////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------
static const wxString s_plugName( wxT( "SpellCheck" ) );
static const wxString s_spOptions( wxT( "SpellCheckOptions" ) );
static const wxString s_noEditor( wxT( "There is no active editor\n" ) );
static const wxString s_codeLite( wxT( "CodeLite" ) );
static const wxString s_userDict( wxT("userwords.dict") );
static const wxString s_cppDelimiters( wxT( " \t\r\n.,?!@#$%^&*()-=+[]{}\\|_;:\"\'<>/~0123456789`" ) );
static const wxString s_commentDelimiters( wxT( " \t\r\n.,?!@#$%^&*()-=+[]{}\\|;:\"\'<>/" ) );
static const wxString s_defDelimiters( wxT( " \t\r\n.,?!@#$%^&*()-=+[]{}\\|;:\"\'<>/~0123456789`" ) );
static const wxString s_dectHex( wxT("^0[xX]([0-9a-f]+|[0-9A-F]+)$"));
static const wxString s_plugName("SpellCheck");
static const wxString s_spOptions("SpellCheckOptions");
static const wxString s_noEditor(wxTRANSLATE("There is no active editor\n"));
static const wxString s_codeLite("CodeLite");
static const wxString s_userDict("userwords.dict");
static const wxString s_cppDelimiters(" \t\r\n.,?!@#$%^&*()-=+[]{}\\|_;:\"\'<>/~0123456789`");
static const wxString s_commentDelimiters(" \t\r\n.,?!@#$%^&*()-=+[]{}\\|;:\"\'<>/");
static const wxString s_defDelimiters(" \t\r\n.,?!@#$%^&*()-=+[]{}\\|;:\"\'<>/~0123456789`");
static const wxString s_dectHex("^0[xX]([0-9a-f]+|[0-9A-F]+)$");

static const wxString s_include( wxT( "#include" ) );
static const wxString s_wsRegEx( wxT( "(\\\\[^\\\\])" ) );
static const wxString s_include("#include");
static const wxString s_wsRegEx("(\\\\[^\\\\])");

static const wxString s_doCheckID(wxT("do_spell_check"));
static const wxString s_contCheckID(wxT("do_continuous_check"));
static const wxString s_doCheckID("do_spell_check");
static const wxString s_contCheckID("do_continuous_check");

static const wxString s_PLACE_HOLDER = "@#)(";
static const wxString s_PLACE_HOLDER = "@#)(";
static const wxString s_DOUBLE_BACKSLASH = "\\\\";

//------------------------------------------------------------

43 changes: 25 additions & 18 deletions SpellChecker/spellcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,33 @@
// Copyright: 2014 Frank Lichtner
// License:
/////////////////////////////////////////////////////////////////////////////
#include "clToolBarButtonBase.h"
#include "event_notifier.h"
#include "globals.h"
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "spellcheck.h"

#include "IHunSpell.h"
#include "SpellCheckerSettings.h"
#include "clToolBarButtonBase.h"
#include "ctags_manager.h"
#include "event_notifier.h"
#include "globals.h"
#include "macros.h"
#include "scGlobals.h"
#include "spellcheck.h"
#include "workspace.h"

#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/mstream.h>
#include <wx/stc/stc.h>
#include <wx/tokenzr.h>
#include <wx/xrc/xmlres.h>

// clang-format off
#include "res/spellcheck16.b2c"
#include "res/spellcheck22.b2c"
//#include "res/contCheck16.b2c"
//#include "res/contCheck22.b2c"
// clang-format on

namespace
{
Expand Down Expand Up @@ -88,10 +90,10 @@ CL_PLUGIN_API IPlugin* CreatePlugin(IManager* manager)
CL_PLUGIN_API PluginInfo* GetPluginInfo()
{
static PluginInfo info;
info.SetAuthor(wxT("Frank Lichtner"));
info.SetName(wxT("SpellCheck"));
info.SetAuthor("Frank Lichtner");
info.SetName("SpellCheck");
info.SetDescription(_("CodeLite spell checker"));
info.SetVersion(wxT("v1.6"));
info.SetVersion("v1.6");
return &info;
}
// ------------------------------------------------------------
Expand Down Expand Up @@ -141,16 +143,18 @@ void SpellCheck::Init()
if(m_pEngine) {
LoadSettings();
wxString userDictPath = clStandardPaths::Get().GetUserDataDir();
userDictPath << wxFILE_SEP_PATH << wxT("spellcheck") << wxFILE_SEP_PATH;
userDictPath << wxFILE_SEP_PATH << "spellcheck" << wxFILE_SEP_PATH;

if(!wxFileName::DirExists(userDictPath))
if(!wxFileName::DirExists(userDictPath)) {
wxFileName::Mkdir(userDictPath);
}

m_pEngine->SetUserDictPath(userDictPath);
m_pEngine->SetPlugIn(this);

if(!m_options.GetDictionaryFileName().IsEmpty())
if(!m_options.GetDictionaryFileName().IsEmpty()) {
m_pEngine->InitEngine();
}
}

m_timer.Bind(wxEVT_TIMER, &SpellCheck::OnTimer, this);
Expand Down Expand Up @@ -246,8 +250,9 @@ void SpellCheck::AppendSubMenuItems(wxMenu& subMenu)
// ------------------------------------------------------------
void SpellCheck::UnPlug()
{
if(m_timer.IsRunning())
if(m_timer.IsRunning()) {
m_timer.Stop();
}
}

// ------------------------------------------------------------
Expand All @@ -257,7 +262,7 @@ IEditor* SpellCheck::GetEditor()
IEditor* editor = m_mgr->GetActiveEditor();

if(!editor) {
::wxMessageBox(s_noEditor, s_codeLite, wxICON_WARNING | wxOK);
::wxMessageBox(::wxGetTranslation(s_noEditor), s_codeLite, wxICON_WARNING | wxOK);
return NULL;
}
return editor;
Expand Down Expand Up @@ -384,8 +389,9 @@ void SpellCheck::OnTimer(wxTimerEvent& e)
{
wxTopLevelWindow* pWnd = dynamic_cast<wxTopLevelWindow*>(GetTopWnd());

if(!pWnd->IsActive())
if(!pWnd->IsActive()) {
return;
}

IEditor* editor = m_mgr->GetActiveEditor();
CHECK_PTR_RET(editor);
Expand Down Expand Up @@ -418,8 +424,9 @@ void SpellCheck::SetCheckContinuous(bool value)
clGetManager()->GetToolBar()->Refresh();
}
} else {
if(m_timer.IsRunning())
if(m_timer.IsRunning()) {
m_timer.Stop();
}
if(btn) {
btn->Check(false);
clGetManager()->GetToolBar()->Refresh();
Expand Down

0 comments on commit aa29fee

Please sign in to comment.