-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add flash messages #158
Add flash messages #158
Conversation
voronkovich
commented
Aug 29, 2015
@@ -195,6 +195,18 @@ | |||
<source>post.no_comments</source> | |||
<target>Будьте первыми кто прокомментирует эту запись.</target> | |||
</trans-unit> | |||
<trans-unit id="post.created_successfully"> | |||
<source>post.created_successfully</source> | |||
<target>Запись успешно сохранена!</target> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better is создана
instead of сохранена
in this case to be consistent with English translation and translation key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, @bocharsky-bw. I've fixed the translation.
In addition to symfony#158
2515746
to
4f95a5b
Compare
👍 |
4f95a5b
to
48900fa
Compare
@voronkovich thanks for working on this. Even if I don't like to display flash messages for when things go right ... I like this PR because it shows a complete example of how to display flash messages, and that's definitely something we want to do. My only concern was that the original code was a bit overcomplicated for the demo application. That's why I took your work and made some simplifications in #163. I'm closing this PR then, but I reused your commits, so you'll get full credit for your work. Thanks! |
@@ -7,6 +7,9 @@ | |||
#} | |||
{% extends 'base.html.twig' %} | |||
|
|||
{# Import macros needed for displaying flash messages. See http://twig.sensiolabs.org/doc/tags/import.html #} | |||
{% import 'macro/messages.html.twig' as messages %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macros should be imported in the template where they are used. Importing them in a parent template and expecting them to work in child templates is just a side effect of the Twig 1.x implementation, and does not work anymore in Twig 2
In addition to symfony#158
This PR was merged into the master branch. Discussion ---------- Add flash messages This finishes #158 by simplifying its contents. Commits ------- 3eefa76 Reworded the help note about flash messages 9a8d43d Check if the session exists before reading flash messages d01311b Transformed the macro() of the Flash messages into a regular include() template f481eef Refactored the template code related to macros da04216 Fixed an issue with the translation file after the rebase 51f7262 Restored the content database 7507a50 Simplified the template code used to render flash messages a46c948 Use 'success' as the name of the messages related to success messages 12bd670 Update Russian and English translations 0680841 Show flash messages after creating, updating and deleting posts
In addition to symfony/demo#158
This PR was merged into the master branch. Discussion ---------- Update uk translations for flash messages In addition to symfony/demo#158 Commits ------- 87fc8e0 Update uk translations for flash messages
In addition to symfony/demo#158
This PR was merged into the master branch. Discussion ---------- Update uk translations for flash messages In addition to symfony/demo#158 Commits ------- 87fc8e0 Update uk translations for flash messages
In addition to symfony/demo#158