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

[RTM] Added insert tag for translator #1400

Merged
merged 5 commits into from Apr 5, 2018

Conversation

aschempp
Copy link
Member

Contao 4.5 supports the Symfony translator, but there is no insert tag to use the Symfony translator. Here's a fix for that.

  • {{trans::foo_bar}} => Replace foo_bar with the default message domain (messages), mostly not useful
  • {{trans::foo_bar::app}} => Replace foo_bar from app message domain
  • {{trans::foo_bar::app::param1:param2}} => Replace foo_bar from app message domain with parameters param1 and param2. The parameters are separated by single colons, like they are for the label insert tag.

@Toflar
Copy link
Member

Toflar commented Feb 28, 2018

Unit tests are missing but otherwise I'm +1 on that!

*
* Copyright (c) 2005-2018 Leo Feyer
*
* @license LGPL-3.0+
Copy link
Contributor

Choose a reason for hiding this comment

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

LGPL-3.0-or-later

@leofeyer leofeyer changed the title Added insert tag for translator [WIP] Added insert tag for translator Mar 1, 2018
@aschempp
Copy link
Member Author

aschempp commented Mar 6, 2018

Unit tests added. I couldn't run the php-cs-fixer for some reason so the license etc. hasn't been changed.

@aschempp aschempp changed the title [WIP] Added insert tag for translator [RTM] Added insert tag for translator Mar 6, 2018
@leofeyer leofeyer added this to the 4.6.0 milestone Mar 7, 2018
@leofeyer leofeyer merged commit 6cb8991 into contao:master Apr 5, 2018
@leofeyer
Copy link
Member

leofeyer commented Apr 5, 2018

Thank you @aschempp.

@aschempp aschempp deleted the feature/trans-inserttag branch March 7, 2019 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants