Skip to content

Disable doc-ro in languages.php and document core.autocrlf usage #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions docs/local-setup.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

<a name="with-docker"></a>
## Building with make and Docker
Expand All @@ -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
Expand Down Expand Up @@ -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/
```

<a name="windows-eol"></a>
## 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
```
13 changes: 8 additions & 5 deletions languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
+------------------------------------------------------------------------------+
*/

// dir manual revcheck cloneUrl label

// Languages repositories on GitHub
// dir manual revcheck cloneUrl label
lang( "de" , true , true , "[email protected]:php/doc-de.git" , "German" );
lang( "en" , true , false , "[email protected]:php/doc-en.git" , "English" );
lang( "es" , true , true , "[email protected]:php/doc-es.git" , "Spanish" );
Expand All @@ -26,7 +26,7 @@
lang( "ja" , true , true , "[email protected]:php/doc-ja.git" , "Japanese" );
lang( "pl" , false , true , "[email protected]:php/doc-pl.git" , "Polish" );
lang( "pt_BR" , true , true , "[email protected]:php/doc-pt_br.git" , "Brazilian Portuguese" );
lang( "ro" , false , true , "[email protected]:php/doc-ro.git" , "Romanian" );
lang( "ro" , false , false , "[email protected]:php/doc-ro.git" , "Romanian" );
lang( "ru" , true , true , "[email protected]:php/doc-ru.git" , "Russian" );
lang( "tr" , true , true , "[email protected]:php/doc-tr.git" , "Turkish" );
lang( "uk" , true , true , "[email protected]:php/doc-uk.git" , "Ukrainian" );
Expand Down Expand Up @@ -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
Expand Down