Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms: convert value to string after it is translated #1098

Closed
wants to merge 2 commits into from

Conversation

achtan
Copy link
Contributor

@achtan achtan commented May 14, 2013

No description provided.

@@ -201,7 +201,7 @@ public function getControl()
if ($this->prompt !== FALSE) {
$control->add($this->prompt instanceof Nette\Utils\Html
? $this->prompt->value('')
: (string) $option->value('')->setText($this->translate((string) $this->prompt))
: (string) $option->value('')->setText((string) $this->translate($this->prompt))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the inner type cast should be still there.

@Majkl578
Copy link
Contributor

👎 ITranslator::translate() should return string.
(And next time, please, don't send pull requests from master branch, create a separate one for the feature/fix.)

@fprochazka
Copy link
Contributor

The point here was to remove the typecast before passing the value to translator.

This should be also modified in Rules, so errors or messages could be wrapped in objects (that way they can carry placeholder parameters with them).

@dg
Copy link
Member

dg commented May 14, 2013

„Forms: convert value to string after it is translated“? I am missing the point…

@fprochazka
Copy link
Contributor

I was talking with @achtan on skype... The point here is only to remove the (string) conversion before translation.

@Majkl578
Copy link
Contributor

Well, ITranslator::translate() expects as its parameter string, so this might be a BC break if a translator doesn't expect TRUE/FALSE/NULL or something.

@dg
Copy link
Member

dg commented May 14, 2013

@hosiplan and why?

@fprochazka
Copy link
Contributor

This should be also modified in Rules, so errors or messages could be wrapped in objects (that way they can carry placeholder parameters with them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants