Skip to content

Commit 30a52ff

Browse files
authored
[TASK] Raise deprecation error on using deprecated labels (#406)
Resolves: TYPO3-Documentation/Changelog-To-Doc#1511
1 parent f0aa863 commit 30a52ff

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

Documentation/Appendix/HowToDeprecateThings.rst

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:navigation-title: How to deprecate
2+
13
.. include:: /Includes.rst.txt
24

35
.. index::
@@ -6,7 +8,7 @@
68
.. _deprecations:
79

810
========================================================================
9-
How to deprecate classes, methods, arguments and hooks in the TYPO3 core
11+
How to deprecate classes, methods, arguments and hooks in the TYPO3 Core
1012
========================================================================
1113

1214
TYPO3 Core development policy states that public API will not be changed
@@ -257,17 +259,36 @@ Deprecate a language label reference
257259

258260
If you move or remove a language label from the Core, third-party extensions and
259261
projects may still depend on it. Therefore, it is good practice to keep the original label
260-
and mark it as deprecated with an ``x-unused-since`` attribute:
262+
and mark it as deprecated with an `x-unused-since` attribute for XLIFF 1.2 or the
263+
`subState="deprecated"` property for XLIFF 2.0 files:
264+
265+
.. tabs::
266+
267+
.. group-tab:: XLIFF 1.2
261268

262-
.. code-block:: xml
269+
.. code-block:: xml
270+
271+
<trans-unit id="CType_formlabel" x-unused-since="14.0">
272+
<source>Type</source>
273+
</trans-unit>
263274
264-
<trans-unit id="CType_formlabel" x-unused-since="14.0">
265-
<source>Type</source>
266-
</trans-unit>
275+
.. group-tab:: XLIFF 2.0
276+
277+
.. code-block:: xml
278+
279+
<unit id="label5">
280+
<segment subState="deprecated">
281+
<source>This is label #5 (deprecated in English)</source>
282+
</segment>
283+
</unit>
267284
268285
The label can then be completely removed in the next major TYPO3 version (the
269286
label must not be referenced any longer in the Core.)
270287

288+
A deprecation warning is triggered the first time a deprecated label is written
289+
to the cache. Subsequent resolutions of the same label use the cached entry and do
290+
not trigger additional warnings until the cache is cleared.
291+
271292
Note that some label references use computed label strings, so check
272293
these carefully before removal.
273294

0 commit comments

Comments
 (0)