Skip to content

Mark code elements as non-translatable #67

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

Merged
merged 3 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Templates/default/html/code.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="literal-block loc-{{ numLocDigits }}">
<div translate="no" class="notranslate literal-block loc-{{ numLocDigits }}">
<div class="highlight-{{ language }}">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion src/Templates/default/html/literal.html.twig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<code>{{ text|raw }}</code>
<code translate="no" class="notranslate">{{ text|raw }}</code>
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/bash.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-bash">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/html-php.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-2">
<div translate="no" class="notranslate literal-block loc-2">
<div class="highlight-html+php">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/html-twig.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-html+twig">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/html.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-html">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/ini.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-ini">
<table class="highlighttable">
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-2">
<div translate="no" class="notranslate literal-block loc-2">
<div class="highlight-php-annotations">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/php.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-php">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/terminal.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-terminal">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-text">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/twig.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-twig">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/xml.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-xml">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/code-blocks/yaml.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-yaml">
<table class="highlighttable">
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
</head>
<body>
<div class="configuration-block"><ul class="simple"><li><em>YAML</em><div class="literal-block loc-1">
<div class="configuration-block"><ul class="simple"><li><em>YAML</em><div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-yaml">
<table class="highlighttable">
<tr>
Expand All @@ -21,7 +21,7 @@
</tr>
</table>
</div>
</div></li><li><em>PHP</em><div class="literal-block loc-1">
</div></li><li><em>PHP</em><div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-php">
<table class="highlighttable">
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Note
</p>
<p>test</p>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-php">
<table class="highlighttable">
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="admonition admonition-sidebar">
<p class="sidebar-title">The sidebar's title</p>
<p>some text before code block</p>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-php">
<table class="highlighttable">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expected/blocks/nodes/literal.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<p>here is some php code from literal:</p>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-php">
<table class="highlighttable">
<tr>
Expand Down
66 changes: 33 additions & 33 deletions tests/fixtures/expected/main/datetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ <h1 id="datetimetype-field">
<a class="headerlink" href="#datetimetype-field" title="Permalink to this headline">DateTimeType Field</a>
</h1>
<p>This field type allows the user to modify data that represents a specific
date and time (e.g. <code>1984-06-05 12:15:30</code>).</p>
date and time (e.g. <code translate="no" class="notranslate">1984-06-05 12:15:30</code>).</p>
<table>
<tbody>
<tr>
<td>Underlying Data Type</td>
<td>can be <code>DateTime</code>, string, timestamp, or array (see the <code>input</code> option)</td>
<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>
</tr>
<tr>
<td>Rendered as</td>
Expand Down Expand Up @@ -63,8 +63,8 @@ <h2 id="field-options">
<h3 id="the-date-format-option">
<a class="headerlink" href="#the-date-format-option" title="Permalink to this headline">The date_format Option</a>
</h3>
<p><strong>type</strong>: <code>integer</code> or <code>string</code><strong>default</strong>: <code>IntlDateFormatter::MEDIUM</code></p>
<p>Defines the <code>format</code> option that will be passed down to the date field.
<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>
<p>Defines the <code translate="no" class="notranslate">format</code> option that will be passed down to the date field.
for more details.</p>
<div class="admonition admonition-tip ">
<p class="admonition-title">
Expand Down Expand Up @@ -95,7 +95,7 @@ <h3 id="date-widget">
<p>Sometimes we add notes. But not too often because they interrupt the flow.
<a href="form/form_type.html#internal-reference" class="reference internal">FormType Documentation</a></p>
</div>
<p>This is included documentation about the <code>date_widget</code> option.</p>
<p>This is included documentation about the <code translate="no" class="notranslate">date_widget</code> option.</p>
</div>
<div class="section">
<h3 id="placeholder">
Expand All @@ -104,16 +104,16 @@ <h3 id="placeholder">
<div class="versionadded">
<div>
<span class="versionmodified">New in version 2.6: </span>
<p>The <code>placeholder</code> option was introduced in Symfony 2.6 and replaces
<code>empty_value</code>, which is available prior to 2.6.
<p>The <code translate="no" class="notranslate">placeholder</code> option was introduced in Symfony 2.6 and replaces
<code translate="no" class="notranslate">empty_value</code>, which is available prior to 2.6.
<a href="form/form_type.html#internal-reference" class="reference internal">FormType Documentation</a></p>
</div>
</div>
<p><strong>type</strong>: <code>string</code> | <code>array</code></p>
<p>If your widget option is set to <code>choice</code>, then this field will be represented
as a series of <code>select</code> boxes. When the placeholder value is a string,
<p><strong>type</strong>: <code translate="no" class="notranslate">string</code> | <code translate="no" class="notranslate">array</code></p>
<p>If your widget option is set to <code translate="no" class="notranslate">choice</code>, then this field will be represented
as a series of <code translate="no" class="notranslate">select</code> boxes. When the placeholder value is a string,
it will be used as the <strong>blank value</strong> of all select boxes:</p>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-php">
<table class="highlighttable">
<tr>
Expand Down Expand Up @@ -168,20 +168,20 @@ <h3 id="placeholder">
</div>
<p>Custom classes for links are also cool:</p>
<ul class="list-config-options">
<li><code>excluded_ajax_paths</code></li>
<li><code>intercept_redirects</code></li>
<li><code>position</code></li>
<li><code>toolbar</code></li>
<li><code>verbose</code></li>
<li><code translate="no" class="notranslate">excluded_ajax_paths</code></li>
<li><code translate="no" class="notranslate">intercept_redirects</code></li>
<li><code translate="no" class="notranslate">position</code></li>
<li><code translate="no" class="notranslate">toolbar</code></li>
<li><code translate="no" class="notranslate">verbose</code></li>
<li><a href="form/form_type.html#internal-reference" class="reference internal">FormType Documentation</a></li>
</ul>
</div>
<div class="section">
<h3 id="format">
<a class="headerlink" href="#format" title="Permalink to this headline">format</a>
</h3>
<p><strong>type</strong>: <code>string</code><strong>default</strong>: <code>Symfony\Component\Form\Extension\Core\Type\DateTimeType::HTML5_FORMAT</code></p>
<p>If the <code>widget</code> option is set to <code>single_text</code>, this option specifies
<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>
<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
the format of the input, i.e. how Symfony will interpret the given input
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>
<div class="admonition-wrapper">
Expand All @@ -208,16 +208,16 @@ <h3 id="format">
<h3 id="time-widget">
<a class="headerlink" href="#time-widget" title="Permalink to this headline">time_widget</a>
</h3>
<p><strong>type</strong>: <code>string</code><strong>default</strong>: <code>choice</code></p>
<p>Defines the <code>widget</code> option for the <code>TimeType</code>.</p>
<p><strong>type</strong>: <code translate="no" class="notranslate">string</code><strong>default</strong>: <code translate="no" class="notranslate">choice</code></p>
<p>Defines the <code translate="no" class="notranslate">widget</code> option for the <code translate="no" class="notranslate">TimeType</code>.</p>
</div>
<div class="section">
<h3 id="widget">
<a class="headerlink" href="#widget" title="Permalink to this headline">widget</a>
</h3>
<p><strong>type</strong>: <code>string</code><strong>default</strong>: <code>null</code></p>
<p>Defines the <code>widget</code> option for both the <code>DateType</code>.
and <code>TimeType</code>. This can be overridden
<p><strong>type</strong>: <code translate="no" class="notranslate">string</code><strong>default</strong>: <code translate="no" class="notranslate">null</code></p>
<p>Defines the <code translate="no" class="notranslate">widget</code> option for both the <code translate="no" class="notranslate">DateType</code>.
and <code translate="no" class="notranslate">TimeType</code>. This can be overridden
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>
</div>
</div>
Expand All @@ -230,16 +230,16 @@ <h2 id="overridden-options">
<h3 id="by-reference">
<a class="headerlink" href="#by-reference" title="Permalink to this headline">by_reference</a>
</h3>
<p><strong>default</strong>: <code>false</code></p>
<p>The <code>DateTime</code> classes are treated as immutable objects.</p>
<p><strong>default</strong>: <code translate="no" class="notranslate">false</code></p>
<p>The <code translate="no" class="notranslate">DateTime</code> classes are treated as immutable objects.</p>
</div>
<div class="section">
<h3 id="error-bubbling">
<a class="headerlink" href="#error-bubbling" title="Permalink to this headline">error_bubbling</a>
</h3>
<p><strong>default</strong>: <code>false</code></p>
<p><strong>default</strong>: <code translate="no" class="notranslate">false</code></p>
<p>We also support code blocks!</p>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-yaml">
<table class="highlighttable">
<tr>
Expand Down Expand Up @@ -267,7 +267,7 @@ <h3 id="error-bubbling">
<ul class="simple">
<li>
<em>YAML</em>
<div class="literal-block loc-1">
<div translate="no" class="notranslate literal-block loc-1">
<div class="highlight-yaml">
<table class="highlighttable">
<tr>
Expand Down Expand Up @@ -300,7 +300,7 @@ <h3 id="error-bubbling">
</li>
<li>
<em>XML</em>
<div class="literal-block loc-2">
<div translate="no" class="notranslate literal-block loc-2">
<div class="highlight-xml">
<table class="highlighttable">
<tr>
Expand Down Expand Up @@ -383,7 +383,7 @@ <h3 id="error-bubbling">
</li>
<li>
<em>PHP</em>
<div class="literal-block loc-2">
<div translate="no" class="notranslate literal-block loc-2">
<div class="highlight-php">
<table class="highlighttable">
<tr>
Expand Down Expand Up @@ -446,12 +446,12 @@ <h2 id="field-variables">
<tbody>
<tr>
<td>widget</td>
<td><code>mixed</code></td>
<td>The value of the <code>widget</code> option</td>
<td><code translate="no" class="notranslate">mixed</code></td>
<td>The value of the <code translate="no" class="notranslate">widget</code> option</td>
</tr>
<tr>
<td>type</td>
<td><code>string</code></td>
<td><code translate="no" class="notranslate">string</code></td>
<td>Multiple lines of text here, to show
that off</td>
</tr>
Expand Down