const char* ccPPGame_LocaleString(const char* jp,const char* en)
{
	if (getCurrentLanguage() == cocos2d::kLanguageEnglish) {
		return en;
	}
	return jp;
}
Exemplo n.º 2
0
void Brewtarget::loadTranslations()
{
   if( qApp == 0 )
      return;

   // Load translators.
   defaultTrans->load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
   if( getCurrentLanguage().isEmpty() )
      setLanguage(getSystemLanguage());
   //btTrans->load("bt_" + getSystemLanguage());

   // Install translators.
   qApp->installTranslator(defaultTrans);
   //qApp->installTranslator(btTrans);
}
void NotifyPluginConfiguration::saveState(QSettings* settings) const
{
        settings->setValue("SoundCollectionPath", Utils::PathUtils().RemoveDataPath(getSoundCollectionPath()));
	settings->setValue(QLatin1String("CurrentLanguage"), getCurrentLanguage());
	settings->setValue(QLatin1String("ObjectField"), getObjectField());
	settings->setValue(QLatin1String("DataObject"), getDataObject());
	settings->setValue(QLatin1String("Value"), getValue());
	settings->setValue(QLatin1String("ValueSpinBox"), getSpinBoxValue());
	settings->setValue(QLatin1String("Sound1"), getSound1());
	settings->setValue(QLatin1String("Sound2"), getSound2());
	settings->setValue(QLatin1String("Sound3"), getSound3());
	settings->setValue(QLatin1String("SayOrder"), getSayOrder());
	settings->setValue(QLatin1String("Repeat"), getRepeatFlag());
	settings->setValue(QLatin1String("ExpireTimeout"), getExpireTimeout());
}
Exemplo n.º 4
0
void NotificationItem::saveState(QSettings* settings) const
{
    settings->setValue("SoundCollectionPath", Utils::PathUtils().RemoveDataPath(getSoundCollectionPath()));
    settings->setValue(QLatin1String("CurrentLanguage"), getCurrentLanguage());
    settings->setValue(QLatin1String("ObjectField"), getObjectField());
    settings->setValue(QLatin1String("DataObject"), getDataObject());
    settings->setValue(QLatin1String("RangeLimit"), getCondition());
    settings->setValue(QLatin1String("Value1"), singleValue());
    settings->setValue(QLatin1String("Value2"), valueRange2());
    settings->setValue(QLatin1String("Sound1"), getSound1());
    settings->setValue(QLatin1String("Sound2"), getSound2());
    settings->setValue(QLatin1String("Sound3"), getSound3());
    settings->setValue(QLatin1String("SayOrder"), getSayOrder());
    settings->setValue(QLatin1String("Repeat"), retryValue());
    settings->setValue(QLatin1String("ExpireTimeout"), lifetime());
    settings->setValue(QLatin1String("Mute"), mute());
}
Exemplo n.º 5
0
void ExportDbDlg::onExport(wxCommandEvent &)
{
    if(m_title->GetValue().IsEmpty())
    {
        wxMessageDialog message(this, _("Please enter a title for your document"));
        message.ShowModal();
    }
    else if(m_languages->GetSelection() == wxNOT_FOUND)
    {
        wxMessageDialog message(this, _("Please select a language for your document"));
        message.ShowModal();
    }
    else
    {
        LoginDlg loginDlg(this);
        if(loginDlg.ShowModal() == wxID_OK)
        {
            if(m_medocDb.checkUser(loginDlg.getLogin(),
                                   loginDlg.getPassword()))
            {
                wxString tesseractLanguage;
                wxString postgresLanguage;
                getCurrentLanguage(tesseractLanguage, postgresLanguage);
                m_medocDb.createDocument(m_title->GetValue(),
                                         m_calendar->GetDate(),
                                         postgresLanguage,
                                         processImages(tesseractLanguage),
                                         loginDlg.getPassword());
            }
            else
            {
                wxMessageDialog message(this, _("Bad key"));
                message.ShowModal();
            }
        }
        EndModal(wxID_OK);
    }
}
Exemplo n.º 6
0
void w_main::on_bt_launch_clicked()
// GUI : Launch game button
{
    // Check if the game path is known

    if(readCheckerParam("Main/ExecutablePath") == "error") {
        QMessageBox::information(0, "Information", tr("To be able to launch the game from the launcher, you need to set the game path in the options window. (Options > Select game path)"));
        return;
    }
    else {
        QString lang = getCurrentLanguage();
        QString executable;
        if(lang == "ko" || lang == "ja" || lang == "zh")
        { // Asian language have a different executable, supporting 2-bytes encoding
            executable = readCheckerParam("Main/ExecutablePath");
            QString asian_executable = executable;
            asian_executable.replace("Civ4BeyondSword.exe","Civ4BeyondSword_Asian.exe");
            QFile exe(executable);
            if(!exe.exists())
            {
                QMessageBox::information(0, "Information", tr("The executable hasn't been found. Please set the game path in the options window. (Options > Select game path)"));
                return;
            }
            QFile asian_exe(asian_executable);
            if(!asian_exe.exists())
            { // Make a question box
                QMessageBox question;
                question.setWindowTitle(tr("Asian language patch not applied"));
                question.setText(tr("You need to apply a patch on the base game for the extension to be compatible with Asian languages. The original version won't be modified. Would you like to apply it now ?"));
                question.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
                int ret = question.exec();
                switch(ret){
                    case QMessageBox::Ok:
                        system("checker\\asian_patcher.exe");
                        return;
                        break;

                    case QMessageBox::Cancel:
                        return;
                        break;

                    default:
                        return;
                        break;
                }
            }
            launchGame(asian_executable);
        }
        else
        {
            executable = readCheckerParam("Main/ExecutablePath");
            QFile exe(executable);
            if(!exe.exists())
            {
                QMessageBox::information(0, "Information", tr("The executable hasn't been found. Please set the game path in the options window. (Options > Select game path)"));
                return;
            }
            //qDebug() << "Executable checksum is " << checkMd5(executable);
            // Warn when the latest Steam version is used
            if(checkMd5(executable) == "93a64f40d3d4093faeac3e9e626f79de" && readCheckerParam("Main/DisableWarning") != "1")
            {
                QMessageBox::information(0, "Information", tr("The game version you are using is known for causing some display problems, like invisible religion icons. Please read the 'note for Steam users' on our website to fix the problem. The website help page will now open.")+ "\n\n" + tr("You can disable this warning in the options."));
                openURL("http://anewdawn.sourceforge.net/pages/install/");
                return;
            }
            launchGame(executable);
        }

    }

    // Check if the launcher should quit

    if(readCheckerParam("Main/QuitLauncher") == "1") {
        qApp->exit();
    }
    else {
        this->setWindowState(Qt::WindowMinimized);
    }
}
QString NotifyPluginConfiguration::parseNotifyMessage()
{
	// tips:
	// check of *.wav files exist needed for playing phonon queues;
	// if phonon player don't find next file in queue, it buzz

	QString str,str1;
	str1= getSayOrder();
	str = QString("%L1 ").arg(getSpinBoxValue());
	int position = 0xFF;
	// generate queue of sound files to play
	notifyMessageList.clear();

        if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound1()+".wav")))
                notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/" + getCurrentLanguage()+"/"+getSound1()+".wav"));
	else
                if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound1()+".wav")))
                        notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound1()+".wav"));

	if(getSound2()!="")
	{
                if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/" +  getCurrentLanguage()+"/"+getSound2()+".wav")))
                        notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/" +  getCurrentLanguage()+"/"+getSound2()+".wav"));
		else
                        if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound2()+".wav")))
                                notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath() + "/default/"+getSound2()+".wav"));
	}

	if(getSound3()!="")
	{
                if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+ "/" + getCurrentLanguage()+"/"+getSound3()+".wav")))
                        notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath()+ "/" + getCurrentLanguage()+"/"+getSound3()+".wav"));
		else
                        if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+getSound3()+".wav")))
                                notifyMessageList.append(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+getSound3()+".wav"));
	}

	switch(str1.at(0).toAscii())
	{
		case 'N'://NEVER:
		   str = getSound1()+" "+getSound2()+" "+getSound3();
		   position = 0xFF;
		   break;

		case 'B'://BEFORE:
		   str = QString("%L1 ").arg(getSpinBoxValue())+getSound1()+" "+getSound2()+" "+getSound3();
		   position = 0;
		   break;

		case 'A'://AFTER:
			switch(str1.at(6).toAscii())
			{
			case 'f':
				str = getSound1()+QString(" %L1 ").arg(getSpinBoxValue())+getSound2()+" "+getSound3();
				position = 1;
				break;
			case 's':
				str = getSound1()+" "+getSound2()+QString(" %L1").arg(getSpinBoxValue())+" "+getSound3();
				position = 2;
				break;
			case 't':
				str = getSound1()+" "+getSound2()+" "+getSound3()+QString(" %L1").arg(getSpinBoxValue());
				position = 3;
				break;
			}
			break;
	}

	if(position!=0xFF)
	{
		QStringList numberParts = QString("%1").arg(getSpinBoxValue()).trimmed().split(".");
		QStringList numberFiles;

		if((numberParts.at(0).size()==1) || (numberParts.at(0).toInt()<20))
		{
			//if(numberParts.at(0)!="0")
				numberFiles.append(numberParts.at(0));
		} else {
			int i=0;
			if(numberParts.at(0).right(2).toInt()<20 && numberParts.at(0).right(2).toInt()!=0) {
				if(numberParts.at(0).right(2).toInt()<10)
					numberFiles.append(numberParts.at(0).right(1));
				else
					numberFiles.append(numberParts.at(0).right(2));
				i=2;
			}
			for(;i<numberParts.at(0).size();i++)
			{
				numberFiles.prepend(numberParts.at(0).at(numberParts.at(0).size()-i-1));
				if(numberFiles.first()==QString("0")) {
					numberFiles.removeFirst();
					continue;
				}
				if(i==1)
					numberFiles.replace(0,numberFiles.first()+'0');
				if(i==2)
					numberFiles.insert(1,"100");
				if(i==3)
					numberFiles.insert(1,"1000");
			}
		}

		if(numberParts.size()>1) {
			numberFiles.append("point");
			if((numberParts.at(1).size()==1)  /*|| (numberParts.at(1).toInt()<20)*/)
				numberFiles.append(numberParts.at(1));
			else {
				if(numberParts.at(1).left(1)=="0")
					numberFiles.append(numberParts.at(1).left(1));
				else
					numberFiles.append(numberParts.at(1).left(1)+'0');
				numberFiles.append(numberParts.at(1).right(1));
			}
		}
		foreach(QString fileName,numberFiles) {
			fileName+=".wav";
                        QString filePath = QDir::toNativeSeparators(getSoundCollectionPath()+"/"+ getCurrentLanguage()+"/"+fileName);
			if(QFile::exists(filePath))
                                notifyMessageList.insert(position++,QDir::toNativeSeparators(getSoundCollectionPath()+ "/"+getCurrentLanguage()+"/"+fileName));
			else {
                                if(QFile::exists(QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+fileName)))
                                        notifyMessageList.insert(position++,QDir::toNativeSeparators(getSoundCollectionPath()+"/default/"+fileName));
				else {
					notifyMessageList.clear();
					break; // if no some of *.wav files, then don't play number!
				}
			}
		}
Exemplo n.º 8
0
string LanguageModel::getCurrentLanguageId(){
    return getCurrentLanguage().ident;
}
Exemplo n.º 9
0
string LanguageModel::getCurrentLanguageName(){
    return getCurrentLanguage().name;
}