diff --git a/docs/local-setup.md b/docs/local-setup.md index a96cba607..103d9add2 100644 --- a/docs/local-setup.md +++ b/docs/local-setup.md @@ -1,6 +1,6 @@ # Setting up a local development environment -This guide assumes that you are comfortable working with on the +This guide assumes that you are comfortable working on the command line with tools like Git. There 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. When working with multiple translations, or working on changes that may also require changing files in the `doc-base` or `phd` repositories, the -suggested way to organize the local enviroment is to clone repositories +suggested way to organize the local environment is to clone repositories into a single `phpdoc` directory, and for individual languages to be cloned into directories named `{LANG}` instead of `doc-{LANG}` as they are named -on GitHub. +on GitHub. See `doc-base/languages.php` script to automate this process. ## Building with make and Docker @@ -38,7 +38,7 @@ building, otherwise the latest revision of those repositories from GitHub will be built into the Docker image used. To force the Docker image used for building to itself be rebuilt, run -`make -B build`, otherwise the `Makefile` will only build it if does not +`make -B build`, otherwise the `Makefile` will only build it if it does not already exist. The 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 $ php phd/render.php --docbook doc-base/.manual.xml --package PHP --format php $ open https://localhost:8080/manual/en/ ``` + + +## Translating on Windows + +When working on Windows, try to use text editors that preserve the end +of line mark as `U+000A LINE FEED (LF)` only. If it's not possible, +you may issue the commands below to instruct `git` in transforming +the files in your local clone to use the Windows native end of line +mark: + +``` +cd LANG +git config core.autocrlf true +git add --renormalize . +git status +``` + +If the last comment above outputs no files, then the process works, +and you can start translating. + +If the last command above shows a list of files, something went wrong, +because these listed files will be changed at *repository level* +in the next commit. There should be *none*. If any files are listed, +revert the changes with commands below and open an issue on +`doc-base` repository. + +``` +git config --unset core.autocrlf +git reset +git status +``` \ No newline at end of file diff --git a/languages.php b/languages.php index 680261482..5926b777e 100644 --- a/languages.php +++ b/languages.php @@ -16,8 +16,8 @@ +------------------------------------------------------------------------------+ */ -// dir manual revcheck cloneUrl label - +// Languages repositories on GitHub +// dir manual revcheck cloneUrl label lang( "de" , true , true , "git@github.com:php/doc-de.git" , "German" ); lang( "en" , true , false , "git@github.com:php/doc-en.git" , "English" ); lang( "es" , true , true , "git@github.com:php/doc-es.git" , "Spanish" ); @@ -26,7 +26,7 @@ lang( "ja" , true , true , "git@github.com:php/doc-ja.git" , "Japanese" ); lang( "pl" , false , true , "git@github.com:php/doc-pl.git" , "Polish" ); lang( "pt_BR" , true , true , "git@github.com:php/doc-pt_br.git" , "Brazilian Portuguese" ); -lang( "ro" , false , true , "git@github.com:php/doc-ro.git" , "Romanian" ); +lang( "ro" , false , false , "git@github.com:php/doc-ro.git" , "Romanian" ); lang( "ru" , true , true , "git@github.com:php/doc-ru.git" , "Russian" ); lang( "tr" , true , true , "git@github.com:php/doc-tr.git" , "Turkish" ); lang( "uk" , true , true , "git@github.com:php/doc-uk.git" , "Ukrainian" ); @@ -70,8 +70,11 @@ function print_usage() function lang( string $code , bool $manual , bool $revcheck , string $cloneUrl , string $label ) { - $lang = new Lang( $code , $manual , $revcheck , $cloneUrl , $label ); - Conf::$knowLangs[ $code ] = $lang; + if ( $manual || $revcheck ) + { + $lang = new Lang( $code , $manual , $revcheck , $cloneUrl , $label ); + Conf::$knowLangs[ $code ] = $lang; + } } class Conf