Skip to content

Commit

Permalink
Zero cost disable translate
Browse files Browse the repository at this point in the history
  • Loading branch information
mhtvsSFrpHdE committed Oct 12, 2022
1 parent 04f75f4 commit 01dd33c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions qpp/prefetch/Source/Define/define.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
#endif

// Misc

#ifndef SKIP_STARTUP_ITEM
#define SKIP_STARTUP_ITEM false
#endif

#ifndef TRANSLATE_ENABLED
#define TRANSLATE_ENABLED true
#endif
2 changes: 2 additions & 0 deletions qpp/prefetch/Source/Global/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ void Global::init(int argc, char *argv[])
Setting::init(argc, commandLineArguments);
LAST_KNOWN_POSITION(2)

#if TRANSLATE_ENABLED
TranslatorLoader::initFile();
LAST_KNOWN_POSITION(2)
TranslatorLoader::initMessage();
LAST_KNOWN_POSITION(2)
#endif

Startup::init(argc, commandLineArguments);
LAST_KNOWN_POSITION(2)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#include "..\..\input_loop_thread.h"
#include "..\..\..\..\Input\const_input.h"
#include "..\..\..\..\Output\stdout.h"
#include "..\..\..\..\Define\define.h"

#define Parent InputLoopThread::ConsoleCommandFunction_Level2

void Parent::lang(QString command)
{
// TODO:
using namespace Const_Input::Message;

#if TRANSLATE_ENABLED
StdOut::printLine(TryingToLoadTranslate + command);

// TODO:
#else
StdOut::printLine(TranslateNotAvailable);
#endif
}
1 change: 1 addition & 0 deletions qpp/prefetch/Source/Input/const_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Const_Input
extern QString TryingToExpireScanCache;
extern QString ScanCacheNotFound;
extern QString TryingToLoadTranslate;
const QString TranslateNotAvailable = "Translate is not enabled in this build.";

extern void init();

Expand Down

0 comments on commit 01dd33c

Please sign in to comment.