Détail du message 81256.1

Message numéro 1 dans le sujet Ajout traduction à l'aide de provider.

  • 81256.1

    08/10/2013 12:14


    mamous
    Rang : Expert
    Bonjour,
    Je viens de créer une tâche qui permet d'ajouter les traductions automatiquement après un traitement, j'ai utiliser le code suivant dans la méthode execute de la tache
     protected function execute()
        {
            Framework::warn('---------------- Début -----------------');
            $lcid = LocaleService::getInstance()->getLCID(f_util_StringUtils::strtolower('fr'));
            Framework::warn('Data : '.$lcid);
        	$id = f_util_StringUtils::strtolower('xxx-label');
        	$keyPath = 'm.module_spe.frontoffice';
        	$content = 'XXX';
        	$format = 'TEXT';
        	Framework::warn('Id : '.$id);
        	$this->getPersistentProvider()->addTranslate($lcid, $id, $keyPath, $content, 1, $format, true);
    
        	Framework::warn('Translation added');
    	    f_util_System::execChangeCommand('ci18n', array('module_spe'));
    	    Framework::warn('---------------- Fin -----------------');
        }


    Donc là dans les logs, j'ai le résultat suivant :

    2013-10-08 10:09:57	[WARN]	---------------- Début -----------------
    2013-10-08 10:09:57	[WARN]	Data : fr_FR
    2013-10-08 10:09:57	[WARN]	Id : xxx-label
    

    Et après j'ai un blocage de la tâche donc elle n'a pas pu passé l'appel de la méthode addTranslate!!!

    Merci

    Développeur & Intégrateur Web

    RBS Change
    V 3.5.2
    Ecommerce Core
 
1471 membres
Aucun membre connecté