File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 1
1
Extracting Translations from Source
2
2
===================================
3
3
4
- TODO example how to extract source. Show different configurations and commands.
4
+ Extracting translations from your project
5
+ -----------------------------------------
6
+
7
+ .. code-block :: yaml
8
+
9
+ translation :
10
+ locales : ["en", "fr", "sv"]
11
+ configs :
12
+ app :
13
+ dirs : ["%kernel.root_dir%/Resources/views", "%kernel.root_dir%/../src"]
14
+ output_dir : " %kernel.root_dir%/Resources/translations"
15
+ excluded_names : ["*TestCase.php", "*Test.php"]
16
+ excluded_dirs : [cache, data, logs]
17
+
18
+ With the configuration above you may extract all translation keys from your
19
+ source code by running
20
+
21
+ .. code-block :: bash
22
+
23
+ php bin/console translation:extract app
24
+
25
+ Extracting translations from a bundle
26
+ -------------------------------------
27
+
28
+ If you're using a bundle shipped with custom translations, you can extract
29
+ them using ``external_translations_dir ``.
30
+
31
+ For example, with `FOSUserBundle<https://github.com/FriendsOfSymfony/FOSUserBundle/> `:
32
+
33
+ .. code-block :: yaml
34
+
35
+ translation :
36
+ configs :
37
+ app :
38
+ external_translations_dir : ["%kernel.root_dir%/vendor/friendsofsymfony/user-bundle/Resources/translations"]
Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ Below is an example of configuration that is great to start with.
62
62
excluded_names : ["*TestCase.php", "*Test.php"]
63
63
excluded_dirs : [cache, data, logs]
64
64
65
- With the configuration above you may extract all translation key from your source
66
- code by running
65
+ With the configuration above you may extract all translation keys from your
66
+ source code by running
67
67
68
68
.. code-block :: bash
69
69
You can’t perform that action at this time.
0 commit comments