|
3 | 3 | To make sure GitLocalize knows where to look for translatable files and where to put translations, you should configure Project Paths correctly.
|
4 | 4 |
|
5 | 5 |
|
6 |
| -## Default Paths Configuation |
| 6 | +## Default Configuation for the Project Paths |
7 | 7 |
|
8 | 8 | The default paths offered when creating a project look as follows:
|
9 | 9 |
|
10 |
| -Source Path: |
| 10 | +*Source Path:* |
11 | 11 |
|
12 | 12 | ```
|
13 | 13 | [repo_name]/
|
14 | 14 | ```
|
15 | 15 |
|
16 |
| -Target Path: |
| 16 | +*Target Path:* |
17 | 17 |
|
18 | 18 | ```
|
19 | 19 | [repo_name]/%lang%
|
20 | 20 | ```
|
21 |
| -Where `%lang` is the placeholder for the target language code. |
| 21 | +...where `%lang` is the placeholder for the target language code. |
22 | 22 |
|
23 |
| -With this configuration GitLocalize will scan all folders in the repository starting from the root folder |
24 |
| -(including subfolders) to look for translatable files. Translation files will be created in the respective folders for each target language. For example, Korean translations will be stored in `/ko/...` German translations will be stored in `/de/...` etc. |
25 |
| -Additionally, GitLocalize will look for existing translations in the same folders (scanning `/ko/...` for Korean translations, `/de/...` for German etc.) |
| 23 | +With this configuration GitLocalize will scan all folders starting from the root folder |
| 24 | +(including subfolders) to look for translatable files. Output translation files will be created in the respective folders for each target language. For example, Korean translations will be stored under `/ko/...`, German translations will be stored under `/de/...` etc. |
| 25 | + |
| 26 | +GitLocalize will additionally look for existing translations in the same language locations (will scan `/ko/...` for Korean translations, `/de/...` for German etc.) |
26 | 27 |
|
27 | 28 | ## Custom Project Paths
|
28 | 29 |
|
29 |
| -You can specify one or multiple custom paths to make GitLocalize look for files in specific locations. Below are some examples. |
| 30 | +To make GitLocalize look for translatable files in specific locations, you can specify one or more custom paths. |
| 31 | + |
| 32 | +### Directory-Based Paths |
30 | 33 |
|
31 |
| -## Directory-Based Paths |
32 |
| -_Examples:_ |
| 34 | +_Example:_ |
33 | 35 |
|
34 |
| -Source Path: |
| 36 | +*Source Path:* |
35 | 37 | ```
|
36 | 38 | [repo_name]/src/site/content/en
|
37 | 39 | ```
|
38 | 40 |
|
39 |
| -Target Path: |
| 41 | +*Target Path:* |
40 | 42 |
|
41 | 43 | ```
|
42 | 44 | [repo_name]/src/site/content/translations-%lang%
|
43 | 45 | ```
|
44 | 46 |
|
45 |
| -With this configuration GitLocalize will look for translatable files in `/src/site/content/en`, Korean translations in `/src/site/content/translations-ko`, German translations in `/src/site/content/translations-de` etc. Output translations will be created in the same locations (`/src/site/content/translations-ko`, `/src/site/content/translations-de` etc.) |
| 47 | +With this configuration GitLocalize will look for translatable files under `/src/site/content/en`, Korean translations under `/src/site/content/translations-ko`, German translations under `/src/site/content/translations-de` etc. Output translations will be created in the same locations (`/src/site/content/translations-ko`, `/src/site/content/translations-de` etc.) |
| 48 | + |
| 49 | +### File-Based Paths |
| 50 | + |
| 51 | +_Example:_ |
| 52 | + |
| 53 | +*Source Path:* |
| 54 | + |
| 55 | +``` |
| 56 | +pages/translations/en/LC_MESSAGES/messages.po |
| 57 | +``` |
| 58 | + |
| 59 | +*Target Path:* |
| 60 | + |
| 61 | +``` |
| 62 | +pages/translations/%lang%/LC_MESSAGES/messages.po |
| 63 | +``` |
| 64 | + |
| 65 | +### Mixed-Type Paths |
| 66 | + |
| 67 | +_Example:_ |
| 68 | + |
| 69 | +*Source Path:* |
| 70 | +``` |
| 71 | +pages/content/amp-dev/documentation/guides-and-tutorials |
| 72 | +``` |
| 73 | + |
| 74 | +*Target Path:* |
| 75 | + |
| 76 | +``` |
| 77 | +%file_name%@%lang%.%file_ext% |
| 78 | +``` |
| 79 | + |
| 80 | +This configuration will sync source files from the `guides-and-tutorials` directory, while output translation files will be created in the same directory with a language code in the filename (e.g. German translation for the file `a4a_spec.md` will be created in the same `guides-and-tutorials` directory under the `a4a_spec@de.md` filename). |
46 | 81 |
|
47 |
| -# Configuring Custom Language Codes |
| 82 | +## Configuring Custom Language Codes |
48 | 83 |
|
49 |
| -You can specify custom language codes for each project language when creating a project or later in the Manage Languages section. Language codes will affect the %lang% placeholder in the output paths (location where translation files will be created). |
| 84 | +Custom language codes can be specified for each project language when creating a project or later in the Manage Languages section. Language codes will replace the `%lang%` placeholder in the output paths (locations where translation files will be created). |
50 | 85 | 
|
0 commit comments