Skip to content

Commit ef59c9a

Browse files
Update project paths article
1 parent 8700c0b commit ef59c9a

File tree

1 file changed

+50
-15
lines changed

1 file changed

+50
-15
lines changed

project_paths.md

+50-15
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,83 @@
33
To make sure GitLocalize knows where to look for translatable files and where to put translations, you should configure Project Paths correctly.
44

55

6-
## Default Paths Configuation
6+
## Default Configuation for the Project Paths
77

88
The default paths offered when creating a project look as follows:
99

10-
Source Path:
10+
*Source Path:*
1111

1212
```
1313
[repo_name]/
1414
```
1515

16-
Target Path:
16+
*Target Path:*
1717

1818
```
1919
[repo_name]/%lang%
2020
```
21-
Where `%lang` is the placeholder for the target language code.
21+
...where `%lang` is the placeholder for the target language code.
2222

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.)
2627

2728
## Custom Project Paths
2829

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
3033

31-
## Directory-Based Paths
32-
_Examples:_
34+
_Example:_
3335

34-
Source Path:
36+
*Source Path:*
3537
```
3638
[repo_name]/src/site/content/en
3739
```
3840

39-
Target Path:
41+
*Target Path:*
4042

4143
```
4244
[repo_name]/src/site/content/translations-%lang%
4345
```
4446

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).
4681

47-
# Configuring Custom Language Codes
82+
## Configuring Custom Language Codes
4883

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).
5085
![Project Paths](/assets/img/project_paths/project_paths.gif)

0 commit comments

Comments
 (0)