Skip to content

Commit cc13cae

Browse files
authored
Merge pull request #67 from javiereguiluz/no_translate
Mark code elements as non-translatable
2 parents 2657a28 + c18597a commit cc13cae

19 files changed

+52
-52
lines changed

src/Templates/default/html/code.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="literal-block loc-{{ numLocDigits }}">
1+
<div translate="no" class="notranslate literal-block loc-{{ numLocDigits }}">
22
<div class="highlight-{{ language }}">
33
<table class="highlighttable">
44
<tr>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<code>{{ text|raw }}</code>
1+
<code translate="no" class="notranslate">{{ text|raw }}</code>

tests/fixtures/expected/blocks/code-blocks/bash.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-bash">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/html-php.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-2">
7+
<div translate="no" class="notranslate literal-block loc-2">
88
<div class="highlight-html+php">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/html-twig.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-html+twig">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/html.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-html">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/ini.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-ini">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/php-annotations.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-2">
7+
<div translate="no" class="notranslate literal-block loc-2">
88
<div class="highlight-php-annotations">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/php.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-php">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/terminal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-terminal">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/text.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-text">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/twig.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-twig">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/xml.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-xml">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/code-blocks/yaml.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="literal-block loc-1">
7+
<div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-yaml">
99
<table class="highlighttable">
1010
<tr>

tests/fixtures/expected/blocks/directives/configuration-block.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div class="configuration-block"><ul class="simple"><li><em>YAML</em><div class="literal-block loc-1">
7+
<div class="configuration-block"><ul class="simple"><li><em>YAML</em><div translate="no" class="notranslate literal-block loc-1">
88
<div class="highlight-yaml">
99
<table class="highlighttable">
1010
<tr>
@@ -21,7 +21,7 @@
2121
</tr>
2222
</table>
2323
</div>
24-
</div></li><li><em>PHP</em><div class="literal-block loc-1">
24+
</div></li><li><em>PHP</em><div translate="no" class="notranslate literal-block loc-1">
2525
<div class="highlight-php">
2626
<table class="highlighttable">
2727
<tr>

tests/fixtures/expected/blocks/directives/note-code-block-nested.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Note
1313
</p>
1414
<p>test</p>
15-
<div class="literal-block loc-1">
15+
<div translate="no" class="notranslate literal-block loc-1">
1616
<div class="highlight-php">
1717
<table class="highlighttable">
1818
<tr>

tests/fixtures/expected/blocks/directives/sidebar-code-block-nested.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="admonition admonition-sidebar">
99
<p class="sidebar-title">The sidebar's title</p>
1010
<p>some text before code block</p>
11-
<div class="literal-block loc-1">
11+
<div translate="no" class="notranslate literal-block loc-1">
1212
<div class="highlight-php">
1313
<table class="highlighttable">
1414
<tr>

tests/fixtures/expected/blocks/nodes/literal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</head>
66
<body>
77
<p>here is some php code from literal:</p>
8-
<div class="literal-block loc-1">
8+
<div translate="no" class="notranslate literal-block loc-1">
99
<div class="highlight-php">
1010
<table class="highlighttable">
1111
<tr>

tests/fixtures/expected/main/datetime.html

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ <h1 id="datetimetype-field">
99
<a class="headerlink" href="#datetimetype-field" title="Permalink to this headline">DateTimeType Field</a>
1010
</h1>
1111
<p>This field type allows the user to modify data that represents a specific
12-
date and time (e.g. <code>1984-06-05 12:15:30</code>).</p>
12+
date and time (e.g. <code translate="no" class="notranslate">1984-06-05 12:15:30</code>).</p>
1313
<table>
1414
<tbody>
1515
<tr>
1616
<td>Underlying Data Type</td>
17-
<td>can be <code>DateTime</code>, string, timestamp, or array (see the <code>input</code> option)</td>
17+
<td>can be <code translate="no" class="notranslate">DateTime</code>, string, timestamp, or array (see the <code translate="no" class="notranslate">input</code> option)</td>
1818
</tr>
1919
<tr>
2020
<td>Rendered as</td>
@@ -63,8 +63,8 @@ <h2 id="field-options">
6363
<h3 id="the-date-format-option">
6464
<a class="headerlink" href="#the-date-format-option" title="Permalink to this headline">The date_format Option</a>
6565
</h3>
66-
<p><strong>type</strong>: <code>integer</code> or <code>string</code><strong>default</strong>: <code>IntlDateFormatter::MEDIUM</code></p>
67-
<p>Defines the <code>format</code> option that will be passed down to the date field.
66+
<p><strong>type</strong>: <code translate="no" class="notranslate">integer</code> or <code translate="no" class="notranslate">string</code><strong>default</strong>: <code translate="no" class="notranslate">IntlDateFormatter::MEDIUM</code></p>
67+
<p>Defines the <code translate="no" class="notranslate">format</code> option that will be passed down to the date field.
6868
for more details.</p>
6969
<div class="admonition admonition-tip ">
7070
<p class="admonition-title">
@@ -95,7 +95,7 @@ <h3 id="date-widget">
9595
<p>Sometimes we add notes. But not too often because they interrupt the flow.
9696
<a href="form/form_type.html#internal-reference" class="reference internal">FormType Documentation</a></p>
9797
</div>
98-
<p>This is included documentation about the <code>date_widget</code> option.</p>
98+
<p>This is included documentation about the <code translate="no" class="notranslate">date_widget</code> option.</p>
9999
</div>
100100
<div class="section">
101101
<h3 id="placeholder">
@@ -104,16 +104,16 @@ <h3 id="placeholder">
104104
<div class="versionadded">
105105
<div>
106106
<span class="versionmodified">New in version 2.6: </span>
107-
<p>The <code>placeholder</code> option was introduced in Symfony 2.6 and replaces
108-
<code>empty_value</code>, which is available prior to 2.6.
107+
<p>The <code translate="no" class="notranslate">placeholder</code> option was introduced in Symfony 2.6 and replaces
108+
<code translate="no" class="notranslate">empty_value</code>, which is available prior to 2.6.
109109
<a href="form/form_type.html#internal-reference" class="reference internal">FormType Documentation</a></p>
110110
</div>
111111
</div>
112-
<p><strong>type</strong>: <code>string</code> | <code>array</code></p>
113-
<p>If your widget option is set to <code>choice</code>, then this field will be represented
114-
as a series of <code>select</code> boxes. When the placeholder value is a string,
112+
<p><strong>type</strong>: <code translate="no" class="notranslate">string</code> | <code translate="no" class="notranslate">array</code></p>
113+
<p>If your widget option is set to <code translate="no" class="notranslate">choice</code>, then this field will be represented
114+
as a series of <code translate="no" class="notranslate">select</code> boxes. When the placeholder value is a string,
115115
it will be used as the <strong>blank value</strong> of all select boxes:</p>
116-
<div class="literal-block loc-1">
116+
<div translate="no" class="notranslate literal-block loc-1">
117117
<div class="highlight-php">
118118
<table class="highlighttable">
119119
<tr>
@@ -168,20 +168,20 @@ <h3 id="placeholder">
168168
</div>
169169
<p>Custom classes for links are also cool:</p>
170170
<ul class="list-config-options">
171-
<li><code>excluded_ajax_paths</code></li>
172-
<li><code>intercept_redirects</code></li>
173-
<li><code>position</code></li>
174-
<li><code>toolbar</code></li>
175-
<li><code>verbose</code></li>
171+
<li><code translate="no" class="notranslate">excluded_ajax_paths</code></li>
172+
<li><code translate="no" class="notranslate">intercept_redirects</code></li>
173+
<li><code translate="no" class="notranslate">position</code></li>
174+
<li><code translate="no" class="notranslate">toolbar</code></li>
175+
<li><code translate="no" class="notranslate">verbose</code></li>
176176
<li><a href="form/form_type.html#internal-reference" class="reference internal">FormType Documentation</a></li>
177177
</ul>
178178
</div>
179179
<div class="section">
180180
<h3 id="format">
181181
<a class="headerlink" href="#format" title="Permalink to this headline">format</a>
182182
</h3>
183-
<p><strong>type</strong>: <code>string</code><strong>default</strong>: <code>Symfony\Component\Form\Extension\Core\Type\DateTimeType::HTML5_FORMAT</code></p>
184-
<p>If the <code>widget</code> option is set to <code>single_text</code>, this option specifies
183+
<p><strong>type</strong>: <code translate="no" class="notranslate">string</code><strong>default</strong>: <code translate="no" class="notranslate">Symfony\Component\Form\Extension\Core\Type\DateTimeType::HTML5_FORMAT</code></p>
184+
<p>If the <code translate="no" class="notranslate">widget</code> option is set to <code translate="no" class="notranslate">single_text</code>, this option specifies
185185
the format of the input, i.e. how Symfony will interpret the given input
186186
as a datetime string. See <a href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax" class="reference external">Date/Time Format Syntax</a>.</p>
187187
<div class="admonition-wrapper">
@@ -208,16 +208,16 @@ <h3 id="format">
208208
<h3 id="time-widget">
209209
<a class="headerlink" href="#time-widget" title="Permalink to this headline">time_widget</a>
210210
</h3>
211-
<p><strong>type</strong>: <code>string</code><strong>default</strong>: <code>choice</code></p>
212-
<p>Defines the <code>widget</code> option for the <code>TimeType</code>.</p>
211+
<p><strong>type</strong>: <code translate="no" class="notranslate">string</code><strong>default</strong>: <code translate="no" class="notranslate">choice</code></p>
212+
<p>Defines the <code translate="no" class="notranslate">widget</code> option for the <code translate="no" class="notranslate">TimeType</code>.</p>
213213
</div>
214214
<div class="section">
215215
<h3 id="widget">
216216
<a class="headerlink" href="#widget" title="Permalink to this headline">widget</a>
217217
</h3>
218-
<p><strong>type</strong>: <code>string</code><strong>default</strong>: <code>null</code></p>
219-
<p>Defines the <code>widget</code> option for both the <code>DateType</code>.
220-
and <code>TimeType</code>. This can be overridden
218+
<p><strong>type</strong>: <code translate="no" class="notranslate">string</code><strong>default</strong>: <code translate="no" class="notranslate">null</code></p>
219+
<p>Defines the <code translate="no" class="notranslate">widget</code> option for both the <code translate="no" class="notranslate">DateType</code>.
220+
and <code translate="no" class="notranslate">TimeType</code>. This can be overridden
221221
with the <a href="datetime.html#date-widget" class="reference internal">date_widget</a> and <a href="datetime.html#time-widget" class="reference internal">time_widget</a> options.</p>
222222
</div>
223223
</div>
@@ -230,16 +230,16 @@ <h2 id="overridden-options">
230230
<h3 id="by-reference">
231231
<a class="headerlink" href="#by-reference" title="Permalink to this headline">by_reference</a>
232232
</h3>
233-
<p><strong>default</strong>: <code>false</code></p>
234-
<p>The <code>DateTime</code> classes are treated as immutable objects.</p>
233+
<p><strong>default</strong>: <code translate="no" class="notranslate">false</code></p>
234+
<p>The <code translate="no" class="notranslate">DateTime</code> classes are treated as immutable objects.</p>
235235
</div>
236236
<div class="section">
237237
<h3 id="error-bubbling">
238238
<a class="headerlink" href="#error-bubbling" title="Permalink to this headline">error_bubbling</a>
239239
</h3>
240-
<p><strong>default</strong>: <code>false</code></p>
240+
<p><strong>default</strong>: <code translate="no" class="notranslate">false</code></p>
241241
<p>We also support code blocks!</p>
242-
<div class="literal-block loc-1">
242+
<div translate="no" class="notranslate literal-block loc-1">
243243
<div class="highlight-yaml">
244244
<table class="highlighttable">
245245
<tr>
@@ -267,7 +267,7 @@ <h3 id="error-bubbling">
267267
<ul class="simple">
268268
<li>
269269
<em>YAML</em>
270-
<div class="literal-block loc-1">
270+
<div translate="no" class="notranslate literal-block loc-1">
271271
<div class="highlight-yaml">
272272
<table class="highlighttable">
273273
<tr>
@@ -300,7 +300,7 @@ <h3 id="error-bubbling">
300300
</li>
301301
<li>
302302
<em>XML</em>
303-
<div class="literal-block loc-2">
303+
<div translate="no" class="notranslate literal-block loc-2">
304304
<div class="highlight-xml">
305305
<table class="highlighttable">
306306
<tr>
@@ -383,7 +383,7 @@ <h3 id="error-bubbling">
383383
</li>
384384
<li>
385385
<em>PHP</em>
386-
<div class="literal-block loc-2">
386+
<div translate="no" class="notranslate literal-block loc-2">
387387
<div class="highlight-php">
388388
<table class="highlighttable">
389389
<tr>
@@ -446,12 +446,12 @@ <h2 id="field-variables">
446446
<tbody>
447447
<tr>
448448
<td>widget</td>
449-
<td><code>mixed</code></td>
450-
<td>The value of the <code>widget</code> option</td>
449+
<td><code translate="no" class="notranslate">mixed</code></td>
450+
<td>The value of the <code translate="no" class="notranslate">widget</code> option</td>
451451
</tr>
452452
<tr>
453453
<td>type</td>
454-
<td><code>string</code></td>
454+
<td><code translate="no" class="notranslate">string</code></td>
455455
<td>Multiple lines of text here, to show
456456
that off</td>
457457
</tr>

0 commit comments

Comments
 (0)