@@ -3,8 +3,8 @@ Contributing Translations
3
3
4
4
Some Symfony Components include certain messages that must be translated to
5
5
different languages. For example, if a user submits a form with a wrong value in
6
- a :doc: `TimezoneType </reference/forms/types/timezone >` field, Symfony shows by
7
- default the following error message: "This value is not a valid timezone."
6
+ a :doc: `TimezoneType </reference/forms/types/timezone >` field, Symfony shows the
7
+ following error message by default : "This value is not a valid timezone."
8
8
9
9
These messages are translated into tens of languages thanks to the Symfony
10
10
community. Symfony adds new messages on a regular basis, so this is an ongoing
@@ -21,22 +21,23 @@ Symfony repository. Visit the `Symfony Releases`_ page to find out which is the
21
21
current oldest maintained branch.
22
22
23
23
If you know Git well, clone the Symfony repository and check out that branch.
24
- Otherwise, visit https://github.com/symfony/symfony and switch to that branch.
24
+ Otherwise, visit `https://github.com/symfony/symfony <https://github.com/symfony/symfony >`_
25
+ and switch to that branch.
25
26
26
- **Step 2. ** Check out if there's some missing translation in your language.
27
- You only have to check these directories:
27
+ **Step 2. ** Check out if there's some missing translation in your language by
28
+ checking these directories:
28
29
29
30
* ``src/Symfony/Component/Form/Resources/translations/ ``
30
31
* ``src/Symfony/Component/Security/Core/Resources/translations/ ``
31
32
* ``src/Symfony/Component/Validator/Resources/translations/ ``
32
33
33
34
Symfony uses the :ref: `XLIFF format <best-practice-internationalization >` to
34
35
store translations. In this example, you are looking for missing Swedish
35
- translations, so you should look for files called ``*.se .xlf ``.
36
+ translations, so you should look for files called ``*.sv .xlf ``.
36
37
37
38
.. note ::
38
39
39
- If there's no XLIFF file yet for your language, create it yourself
40
+ If there's no XLIFF file for your language yet , create it yourself
40
41
duplicating the original English file (e.g. ``validators.en.xlf ``).
41
42
42
43
**Step 3. ** Contribute the missing translations. To do that, compare the file
@@ -46,6 +47,8 @@ Imagine that you open the ``validators.sv.xlf`` and see this at the end of the f
46
47
47
48
.. code-block :: xml
48
49
50
+ <!-- src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf -->
51
+
49
52
<!-- ... -->
50
53
<trans-unit id =" 91" >
51
54
<source >This value should be either negative or zero.</source >
@@ -61,6 +64,8 @@ English file has more messages to translate:
61
64
62
65
.. code-block :: xml
63
66
67
+ <!-- src/Symfony/Component/Validator/Resources/translations/validators.en.xlf -->
68
+
64
69
<!-- ... -->
65
70
<trans-unit id =" 91" >
66
71
<source >This value should be either negative or zero.</source >
@@ -79,12 +84,14 @@ English file has more messages to translate:
79
84
<target >This value should be between {{ min }} and {{ max }}.</target >
80
85
</trans-unit >
81
86
82
- The messages with ``id = 93 `` and ``id = 94 `` are missing in the Swedish file.
87
+ The messages with ``id= 93 `` and ``id= 94 `` are missing in the Swedish file.
83
88
Copy and paste the messages from the English file, translate the content
84
89
inside the ``<target> `` tag and save the changes.
85
90
86
- **Step 4. ** Make the pull request against the Symfony GitHub repository. If you
87
- need help, check the other Symfony guides about :doc: `contributing code or docs </contributing/index >`
88
- because the process is the same.
91
+ **Step 4. ** Make the pull request against the
92
+ `https://github.com/symfony/symfony <https://github.com/symfony/symfony >`_ repository.
93
+ If you need help, check the other Symfony guides about
94
+ :doc: `contributing code or docs </contributing/index >` because the process is
95
+ the same.
89
96
90
97
.. _`Symfony Releases` : https://symfony.com/releases
0 commit comments