• Hi! Thank you for great and simple plugin! I need to translate some strings in String translation tab, and some of them are multi-line e-mail templates … I suggest to change those input fields from INPUT to “small” TEXTAREA.

    There won’t be any major visual change, but (modern) browser will allow field resizing …

    (also it seems that lines are trimmed from translatable content)

    https://www.ads-software.com/plugins/polylang/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mklusak

    (@mklusak)

    Ah, now I see textareas in plugin source code … but my strings has only INPUT fields. They are loaded from wpml-config.xml admin-texts list … could this be the issue?

    Plugin Author Chouby

    (@chouby)

    Hi!

    Yes, the textarea is used only when the string is registered with the php function pll_register_string with the 4th parameter set to 1.

    Thread Starter mklusak

    (@mklusak)

    Hi! Maybe the problem is that those strings are loaded from wpml-config.xml … then it is automatic process I suppose, and I can’t affect those parameter. Or can I?

    Plugin Author Chouby

    (@chouby)

    Sure you can. With php only (as wpml-config.xml does not include such option).
    The code snippet below transforms all inputs to textarea.

    add_filter('pll_get_strings', 'pll_get_strings', 20);
    function pll_get_strings($strings) {
    	foreach($strings as $key => $string)
    		$strings[$key]['multiline'] = 1;
    	return $strings;
    }

    Thread Starter mklusak

    (@mklusak)

    It looks promising! Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘String translation – small textareas, maybe?’ is closed to new replies.