Tagged: ,

Viewing 4 reply threads
  • Author
    Posts
    • #4323
      vagelis
      Member

      Hi. Can I use polylang pll__ for translation string in a piklist field like this?

      piklist('field', array(
       'type' => 'select'
       ,'field' => 'yachts_cabins'
       ,'label' => pll__('Cabins')
       ,'value' => '0'
       ,'attributes' => array(
         'class' => 'text'
       )
       ,'choices' => array(
        '0'
         ,'1'
         ,'2'
         ,'3'
         ,'4'
         ,'5'
         ,'6'
       )
       ));
    • #4329
      Steve
      Keymaster

      @vagelis– Have you tested? Do you see an issue?

    • #4331
      vagelis
      Member

      I’ve used this here:

      piklist('field', array(
       'type' => 'select'
       ,'field' => 'yachts_engine_type'
       ,'label' => 'Τύπος μηχανής'
       ,'value'  => ''
       ,'attributes' => array(
         'class' => 'text'
       )
       ,'choices' => array(
         '' => pll__('Choose Type')
         ,'option1' => 'Εξωλέμβια'
         ,'option2' => 'Έσω - Εσωεξωλέμβια'
       )
       ));

      and it displayed in english. I’ll register the string and get back to you. For it to work must I change the admin language to Greek?

    • #4332
      vagelis
      Member

      It’s working for label, so it should work for choices too. Thanx.

    • #4334
      Steve
      Keymaster

      @vagelis— I thought it would. Piklist does everything the WordPress way, so if it works in WordPress, it should work in Piklist.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.