11# Setting up a local development environment
22
3- This guide assumes that you are comfortable working with on the
3+ This guide assumes that you are comfortable working on the
44command line with tools like Git.
55
66There are instructions for building [ with Docker] ( #with-docker ) or
@@ -10,10 +10,10 @@ will be building with a version of PHP that is known to work.
1010
1111When working with multiple translations, or working on changes that may
1212also require changing files in the ` doc-base ` or ` phd ` repositories, the
13- suggested way to organize the local enviroment is to clone repositories
13+ suggested way to organize the local environment is to clone repositories
1414into a single ` phpdoc ` directory, and for individual languages to be cloned
1515into directories named ` {LANG} ` instead of ` doc-{LANG} ` as they are named
16- on GitHub.
16+ on GitHub. See ` doc-base/languages.php ` script to automate this process.
1717
1818<a name =" with-docker " ></a >
1919## Building with make and Docker
@@ -38,7 +38,7 @@ building, otherwise the latest revision of those repositories from GitHub
3838will be built into the Docker image used.
3939
4040To force the Docker image used for building to itself be rebuilt, run
41- ` make -B build ` , otherwise the ` Makefile ` will only build it if does not
41+ ` make -B build ` , otherwise the ` Makefile ` will only build it if it does not
4242already exist.
4343
4444The web version of the documentation with ` make php ` and the output will
@@ -103,3 +103,34 @@ To build the version for the website (with a [local web setup](local-web-setup.m
103103$ php phd/render.php --docbook doc-base/.manual.xml --package PHP --format php
104104$ open https://localhost:8080/manual/en/
105105```
106+
107+ <a name =" windows-eol " ></a >
108+ ## Translating on Windows
109+
110+ When working on Windows, try to use text editors that preserve the end
111+ of line mark as ` U+000A LINE FEED (LF) ` only. If it's not possible,
112+ you may issue the commands below to instruct ` git ` in transforming
113+ the files in your local clone to use the Windows native end of line
114+ mark:
115+
116+ ```
117+ cd LANG
118+ git config core.autocrlf true
119+ git add --renormalize .
120+ git status
121+ ```
122+
123+ If the last comment above outputs no files, then the process works,
124+ and you can start translating.
125+
126+ If the last command above shows a list of files, something went wrong,
127+ because these listed files will be changed at * repository level*
128+ in the next commit. There should be * none* . If any files are listed,
129+ revert the changes with commands below and open an issue on
130+ ` doc-base ` repository.
131+
132+ ```
133+ git config --unset core.autocrlf
134+ git reset
135+ git status
136+ ```
0 commit comments