Translator with sprinf VS nette forms addRule

Notice: This thread is very old.
matopeto
Member | 395
+
0
-

Hi

i have problem with using simple translator: https://github.com/…e-translator (or any others translator with sprintf function)

it uses vsprintf functions to handle translator parameters.

problem is when I use

<?php
$this->addText('int', 'Integer')
->addRule(self::INTEGER, "%label must be an integer.");
?>

i get:

bel must be an integer.

Excepted is

Integer must be an integer.

It is caused by “greedy” translator, it eats %la.

Solution is use “%%label” but I don't like it, i would like use standard “%label” notation.

Filip Procházka
Moderator | 4668
+
0
-

There are more problems in forms generally, that make translation hard.

Most of them are or will be solved in Kdyby/Translation :)