[TD]translate line names at time of use
This commit is contained in:
@@ -22,11 +22,36 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "Preferences.h"
|
||||
|
||||
#include "LineNameEnum.h"
|
||||
|
||||
|
||||
namespace TechDraw {
|
||||
|
||||
// these strings have to be kept in order according to Preferences::lineStandard()
|
||||
std::vector<std::string> LineName::ContextStrings{
|
||||
"ANSILineTypeEnum",
|
||||
"ASMELineTypeEnum",
|
||||
"ISOLineTypeEnum" };
|
||||
|
||||
std::string LineName::translationContext(size_t iStandard)
|
||||
{
|
||||
if (iStandard < ContextStrings.size() &&
|
||||
iStandard > 0) {
|
||||
return ContextStrings[iStandard];
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
std::string LineName::currentTranslationContext()
|
||||
{
|
||||
return translationContext(Preferences::lineStandard());
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! line numbers begin at 1, not 0
|
||||
|
||||
const int ISOLineName::ISOLineNameCount = 15;
|
||||
|
||||
@@ -33,8 +33,18 @@
|
||||
namespace TechDraw
|
||||
{
|
||||
|
||||
|
||||
|
||||
//! common definitions for line numbers, names and lineicon names
|
||||
|
||||
class TechDrawExport LineName {
|
||||
public:
|
||||
static std::string translationContext(size_t iStandard);
|
||||
static std::string currentTranslationContext();
|
||||
|
||||
static std::vector<std::string> ContextStrings;
|
||||
};
|
||||
|
||||
class TechDrawExport ISOLineName {
|
||||
Q_DECLARE_TR_FUNCTIONS(TechDraw::ISOLineName)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user