2016-08-03 2 views
1

제 양식에 문제가 있습니다. 메신저 내 모든 필드를 사용하여 message.yml 번역 및 작동합니다. 하지만 VichUploaderBundle의 업로드 버튼도 있습니다. 라벨을 번역 할 수는 있지만, 테스트 할 때 라벨은 영어이지만 버튼은 독일어로되어 있습니다.내 양식에 UploadButton을 번역 할 수 없습니다.

public function buildForm(FormBuilderInterface $builder, array $options) 
{ 
    $builder 
     ->add('id', TextType::class, array('disabled' => true)) 
     ->add('title',TextType::class, array('label' => 'edit.title')) 
     ->add('body', TextareaType::class, array('label' => 'edit.body')) 
     ->add('date', DateType::class, array('disabled' => true, 'label' => 'edit.date')) 
     ->add('tags', EntityType::class, array(
      'class' => 'AppBundle:Tag', 
      'choice_label' => 'getTitle', 
      'multiple'=> true, 
      'expanded'=> true)) 
     ->add(
      'technology', 
      EntityType::class, 
      array(
       'class' => 'AppBundle\Entity\Technology', 
       'choice_label' => 'getTitle', 
       'group_by' => 'parent.getTitle', 
       'query_builder' => function (EntityRepository $er) { 
        return $er->createQueryBuilder('t') 
         ->where('t.parent IS NOT NULL') 
         ->andWhere('SIZE(t.children) <= 0'); 
       } 
      )) 
     ->add('imageFile', VichImageType::class, array(
      'required'  => false, 
      'allow_delete' => true, 
      'download_link' => true, 
      'label'  => 'edit.image_file', 
      )) 
    ; 
} 

버튼을 번역하는 방법을 모른다.

답변

0

html 파일 입력 만 작성 중입니다.

이 입력에는 일부 레이블 속성이 없습니다.

<input type="file" name="imageFile"/> 

-> 버튼 레이블은 브라우저 (독일어로 보이는 것)에 의해 설정됩니다.

You can try to change it with CSS/JS

0

이 텍스트는 브라우저가 아닌 PHP 또는 심포니에 의해 정의된다. 이 위젯은 다른 브라우저 및 다른 운영 체제에서 다르게 표시됩니다. 위젯의 디자인을 변경할 가능성도 없습니다. 대부분의 CSS 속성은 영향을주지 않습니다.

당신이 할 수있는 유일한 방법은 맞춤 자바 스크립트 업 로더를 구현하는 것입니다.하지만 그것은 아마도 최신 브라우저에서만 작동 할 것입니다.

Google 검색을 수행 한 적이 한 번도 없었지만 빠른 Google 검색을 수행 할 수있는 JavaScript 플러그인이 거의없는 http://www.queness.com/post/11434/7-javascript-ajax-file-upload-plugins이있었습니다.

관련 문제