Quantcast
Channel: Preguntas activas con las etiquetas phpword - Stack Overflow en español
Viewing all articles
Browse latest Browse all 27

Idioma del corrector ortográfico de Microsoft Word

$
0
0

En mi proyecto he incluido la opción de imprimir en Word. Para ello, tengo este código:

public function imprimirWord(Juego $j){    $phpWord=new \PhpOffice\PhpWord\PhpWord();    $section=$phpWord->addSection();    $text=$section->addText('Juego Nº'.$j->numero.': '.$j->nombre,array('name'=>'Arial','size' => 15,'bold' => true));    $text=$section->addText("-Materiales requeridos: ".$j->materiales);    $text=$section->addText("-Agrupación: ".$j->organizacion);    $text=$section->addText("-Cómo se organiza el juego: ".$j->agrupacion->nombre);    $text=$section->addText("-Desarrollo del juego: ".$j->desarrollo);    if($j->observaciones!='*')        $text=$section->addText("-Reglas y observaciones: ".$j->observaciones);    if($j->variantes!='*')        $text=$section->addText("-Variantes del juego: ".$j->variantes);    $contenidos=$j->enlaces;    $valor=count($contenidos);    if($valor){        $texto="";        foreach($contenidos as $contenido){            $texto.="".$contenido->contenido->nombre;            $valor--;            if($valor>1)                $texto.=",";            else if($valor==1)                $texto.=" y";            else                $texto.=".";        }        $text=$section->addText("-Contenidos del juego:".$texto);    }    $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');    $objWriter->save('Prueba.docx');    return response()->download(public_path('Prueba.docx'));}

Y al ejecutarlo obtengo esto:introducir la descripción de la imagen aquí

Y aquí esta mi problema: Una vez el documento se imprime, el idioma del autocorrector se pone en inglés en lugar de en español.

Lo puedo modificar, pero no es deseable tener que estar yendo a cambiar el idioma cada vez que se imprima un nuevo fichero. ¿Cómo lo arreglo?


Viewing all articles
Browse latest Browse all 27

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>