Comments (8)
use the Twig whitespace control:
{% trans -%}
Some piece of<br>
Text
{%- endtrans %}
from twig-extensions.
Tried with spaceless, had forgotten about the dashes, thanks!
from twig-extensions.
Hm actually that doesn't seem to work, I still get whitespace in the compiled template which gets in the gettext call. Tried clearing Twig's cache and all, same thing.
{% trans -%}
Some piece of<br>
Text
{%- endtrans %}
// line 26
echo gettext("Some piece of<br>
\t\t\t\tText");
from twig-extensions.
Use the spaceless
tag.
from twig-extensions.
Doesn't work either, because it compiles as a replace and thus the Twig extractor doesn't get it when parsing the compiled templates. Although I forked the extractor so I guess I could try to make that work.
from twig-extensions.
We also have this issue. We are using the spaceless tag in our parent template, but of course that is not applied when loading individual templates for parsing in Poedit.
from twig-extensions.
I've been having this issue - and we've done a workaround by monkey patching the compilation and adding:
$msg = preg_replace("%(\n)?\t+%", ' ', $msg);
I'd submit as a patch but I've not got the time to add the tests that'd be required.
from twig-extensions.
I'm closing all issues/PRs on the i18n extension as I don't use it and I don't have time to maintain it anymore. This repository will be soon deprecated in favor of the twig/*-extra
packages, but i18n wont be transferred. If anyone wants to work on the i18n extension, I would recommend to take the code from here and host it on a new repository.
from twig-extensions.
Related Issues (20)
- Variables in translation not escaped? HOT 10
- Deprecation Warning for Text.php & Fix HOT 1
- Translator decorator error in prod HOT 2
- Feature: Iterable test functions HOT 1
- Trans tag content with variables in them are broken for new versions of Twig.
- Attempted to load class "Twig_Extensions_Extension_Intl" HOT 1
- localized yes/no function for boolean value HOT 1
- Unexpected result of the localizeddate function HOT 1
- How to add IntlExtension with release 1.5.4 HOT 4
- Cannot combine form vars and filter HOT 5
- Please allow Twig 3 HOT 1
- Conflits with doctrine-bundle HOT 4
- Alternative for Date time_diff ? HOT 2
- Support Twig 3.0 HOT 1
- Support Symfony 5 HOT 3
- Php 7.4 preloading on v1.5.4 fails HOT 2
- [intl-extra] Japanese date format issue
- Mark as abandoned on packagist.org HOT 2
- What's the alternative solution for i18n translation which is supported by twig/twig-extension before and is not supported after upgrading to twig/twig:3 HOT 3
- Use GithubActions instead of Travis
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twig-extensions.