Script function names have been translated

This commit is contained in:
Arin Alexander 2017-06-29 03:16:30 +03:00
parent 7832dcc055
commit 36d72a5756
2 changed files with 33 additions and 13 deletions

View File

@ -427,7 +427,7 @@ void ScriptEngineManager::setDataManager(DataSourceManager *dataManager){
if (m_dataManager){ if (m_dataManager){
foreach(QString func, m_dataManager->groupFunctionNames()){ foreach(QString func, m_dataManager->groupFunctionNames()){
if (isFunctionExists(func)) deleteFunction(func); if (isFunctionExists(func)) deleteFunction(func);
addFunction(func, groupFunction,"GROUP FUNCTIONS", func+"(\""+tr("Value")+"\",\""+tr("BandName")+"\")"); addFunction(func, groupFunction,tr("GROUP FUNCTIONS"), func+"(\""+tr("Value")+"\",\""+tr("BandName")+"\")");
} }
foreach(ScriptFunctionDesc func, m_functions){ foreach(ScriptFunctionDesc func, m_functions){
if (func.type==ScriptFunctionDesc::Native) if (func.type==ScriptFunctionDesc::Native)
@ -612,22 +612,22 @@ ScriptEngineManager::ScriptEngineManager()
m_scriptEngine = new QScriptEngine; m_scriptEngine = new QScriptEngine;
//addFunction("dateToStr",dateToStr,"DATE", "dateToStr(\"value\",\"format\")"); //addFunction("dateToStr",dateToStr,"DATE", "dateToStr(\"value\",\"format\")");
addFunction("line",line,"SYSTEM", "line(\""+tr("BandName")+"\")"); addFunction("line",line,tr("SYSTEM"), "line(\""+tr("BandName")+"\")");
addFunction("numberFormat",numberFormat,"NUMBER", "numberFormat(\""+tr("Value")+"\",\""+tr("Format")+"\",\""+ addFunction("numberFormat",numberFormat,tr("NUMBER"), "numberFormat(\""+tr("Value")+"\",\""+tr("Format")+"\",\""+
tr("Precision")+"\",\""+ tr("Precision")+"\",\""+
tr("Locale")+"\")"); tr("Locale")+"\")");
addFunction("dateFormat",dateFormat,"DATE&TIME", "dateFormat(\""+tr("Value")+"\",\""+tr("Format")+"\")"); addFunction("dateFormat",dateFormat,tr("DATE&TIME"), "dateFormat(\""+tr("Value")+"\",\""+tr("Format")+"\")");
addFunction("timeFormat",timeFormat,"DATE&TIME", "dateFormat(\""+tr("Value")+"\",\""+tr("Format")+"\")"); addFunction("timeFormat",timeFormat,tr("DATE&TIME"), "dateFormat(\""+tr("Value")+"\",\""+tr("Format")+"\")");
addFunction("dateTimeFormat", dateTimeFormat, "DATE&TIME", "dateTimeFormat(\""+tr("Value")+"\",\""+tr("Format")+"\")"); addFunction("dateTimeFormat", dateTimeFormat, tr("DATE&TIME"), "dateTimeFormat(\""+tr("Value")+"\",\""+tr("Format")+"\")");
addFunction("date",date,"DATE&TIME","date()"); addFunction("date",date,tr("DATE&TIME"),"date()");
addFunction("now",now,"DATE&TIME","now()"); addFunction("now",now,tr("DATE&TIME"),"now()");
#if QT_VERSION>0x040800 #if QT_VERSION>0x040800
addFunction("currencyFormat",currencyFormat,"NUMBER","currencyFormat(\""+tr("Value")+"\",\""+tr("Locale")+"\")"); addFunction("currencyFormat",currencyFormat,tr("NUMBER"),"currencyFormat(\""+tr("Value")+"\",\""+tr("Locale")+"\")");
addFunction("currencyUSBasedFormat",currencyUSBasedFormat,"NUMBER","currencyUSBasedFormat(\""+tr("Value")+",\""+tr("CurrencySymbol")+"\")"); addFunction("currencyUSBasedFormat",currencyUSBasedFormat,tr("NUMBER"),"currencyUSBasedFormat(\""+tr("Value")+",\""+tr("CurrencySymbol")+"\")");
#endif #endif
addFunction("setVariable", setVariable, "GENERAL", "setVariable(\""+tr("Name")+"\",\""+tr("Value")+"\")"); addFunction("setVariable", setVariable, tr("GENERAL"), "setVariable(\""+tr("Name")+"\",\""+tr("Value")+"\")");
addFunction("getVariable", getVariable, "GENERAL", "getVariable(\""+tr("Name")+"\")"); addFunction("getVariable", getVariable, tr("GENERAL"), "getVariable(\""+tr("Name")+"\")");
addFunction("getField", getField, "GENERAL", "getField(\""+tr("Name")+"\")"); addFunction("getField", getField, tr("GENERAL"), "getField(\""+tr("Name")+"\")");
QScriptValue colorCtor = m_scriptEngine->newFunction(constructColor); QScriptValue colorCtor = m_scriptEngine->newFunction(constructColor);
m_scriptEngine->globalObject().setProperty("QColor", colorCtor); m_scriptEngine->globalObject().setProperty("QColor", colorCtor);

View File

@ -1968,6 +1968,26 @@ This preview is no longer valid.</source>
<source>Name</source> <source>Name</source>
<translation>Имя переменной</translation> <translation>Имя переменной</translation>
</message> </message>
<message>
<source>GROUP FUNCTIONS</source>
<translation>АГРЕГАТНЫЕ ФУНКЦИИ</translation>
</message>
<message>
<source>SYSTEM</source>
<translation>СИСТЕМНЫЕ</translation>
</message>
<message>
<source>NUMBER</source>
<translation>ЧИСЛОВЫЕ</translation>
</message>
<message>
<source>DATE&amp;TIME</source>
<translation>ДАТА И ВРЕМЯ</translation>
</message>
<message>
<source>GENERAL</source>
<translation>ОБЩИЕ</translation>
</message>
</context> </context>
<context> <context>
<name>LimeReport::SettingDialog</name> <name>LimeReport::SettingDialog</name>