|
| 1 | +--- |
| 2 | +slug: /contributing/code |
| 3 | +--- |
| 4 | + |
| 5 | +<!-- |
| 6 | +# Code contributions |
| 7 | +--> |
| 8 | + |
| 9 | +# Contribuciones de código |
| 10 | + |
| 11 | +<!-- |
| 12 | +Like all WordPress projects, Playground uses GitHub to manage code and track issues. The main repository is at [https://github.com/WordPress/wordpress-playground](https://github.com/WordPress/wordpress-playground) and the Playground Tools repository is at [https://github.com/WordPress/playground-tools/](https://github.com/WordPress/playground-tools/). |
| 13 | +--> |
| 14 | + |
| 15 | +Como todos los proyectos de WordPress, Playground utiliza GitHub para gestionar el código y hacer seguimiento de los problemas. El repositorio principal está en [https://github.com/WordPress/wordpress-playground](https://github.com/WordPress/wordpress-playground) y el repositorio de Playground Tools está en [https://github.com/WordPress/playground-tools/](https://github.com/WordPress/playground-tools/). |
| 16 | + |
| 17 | +<!-- |
| 18 | +:::info Contribute to Playground Tools |
| 19 | +
|
| 20 | +This guide includes links to the main repository, but all the steps and options apply for both. If you're interested in the plugins or local development tools—start there. |
| 21 | +
|
| 22 | +::: |
| 23 | +--> |
| 24 | + |
| 25 | +:::info Contribuye a las herramientas de Playground |
| 26 | + |
| 27 | +Esta guía incluye enlaces al repositorio principal, pero todos los pasos y opciones se aplican a ambos. Si estás interesado en los plugins o en las herramientas de desarrollo local, empieza por ahí. |
| 28 | + |
| 29 | +::: |
| 30 | + |
| 31 | +<!-- |
| 32 | +Browse [the list of open issues](https://github.com/wordpress/wordpress-playground/issues) to find what to work on. The [`Good First Issue`](https://github.com/wordpress/wordpress-playground/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22) label is a recommended starting point for first-time contributors. |
| 33 | +--> |
| 34 | + |
| 35 | +Explora [la lista de problemas abiertos](https://github.com/wordpress/wordpress-playground/issues) para encontrar en qué trabajar. La etiqueta [`Good First Issue`](https://github.com/wordpress/wordpress-playground/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22) es un punto de partida recomendado para los que contribuyen por primera vez. |
| 36 | + |
| 37 | +<!-- |
| 38 | +Be sure to review the following resources before you begin: |
| 39 | +--> |
| 40 | + |
| 41 | +Asegúrate de revisar los siguientes recursos antes de empezar: |
| 42 | + |
| 43 | +<!-- |
| 44 | +- [Coding principles](/contributing/coding-standards) |
| 45 | +- [Architecture](/developers/architecture) |
| 46 | +- [Vision and Philosophy](https://github.com/WordPress/wordpress-playground/issues/472) |
| 47 | +- [WordPress Playground Roadmap](https://github.com/WordPress/wordpress-playground/issues/525) |
| 48 | +--> |
| 49 | + |
| 50 | +- [Principios de codificación](/contributing/coding-standards) |
| 51 | +- [Arquitectura](/developers/architecture) |
| 52 | +- [Visión y Filosofía](https://github.com/WordPress/wordpress-playground/issues/472) |
| 53 | +- [Hoja de ruta de WordPress Playground](https://github.com/WordPress/wordpress-playground/issues/525) |
| 54 | + |
| 55 | +<!-- |
| 56 | +## Contribute Pull Requests |
| 57 | +--> |
| 58 | + |
| 59 | +## Contribuir con Pull Requests |
| 60 | + |
| 61 | +<!-- |
| 62 | +[Fork the Playground repository](https://github.com/WordPress/wordpress-playground/fork) and clone it to your local machine. To do that, copy and paste these commands into your terminal: |
| 63 | +--> |
| 64 | + |
| 65 | +[Haz un fork del repositorio de Playground](https://github.com/WordPress/wordpress-playground/fork) y clónalo en tu máquina local. Para ello, copia y pega estos comandos en tu terminal: |
| 66 | + |
| 67 | +```bash |
| 68 | +git clone -b trunk --single-branch --depth 1 --recurse-submodules |
| 69 | + |
| 70 | +# replace `YOUR-GITHUB-USERNAME` with your GitHub username: |
| 71 | +[email protected]:YOUR-GITHUB-USERNAME/wordpress-playground.git |
| 72 | +cd wordpress-playground |
| 73 | +npm install |
| 74 | +``` |
| 75 | + |
| 76 | +<!-- |
| 77 | +Create a branch, make changes, and test it locally by running the following command: |
| 78 | +--> |
| 79 | + |
| 80 | +Crea una rama, haz los cambios y pruébalo localmente ejecutando el siguiente comando: |
| 81 | + |
| 82 | +```bash |
| 83 | +npm run dev |
| 84 | +``` |
| 85 | + |
| 86 | +<!-- |
| 87 | +Playground will open in a new browser tab and refresh automatically with each change. |
| 88 | +--> |
| 89 | + |
| 90 | +Playground se abrirá en una nueva pestaña del navegador y se actualizará automáticamente con cada cambio. |
| 91 | + |
| 92 | +<!-- |
| 93 | +When your'e ready, commit the changes and submit a Pull Request. |
| 94 | +--> |
| 95 | + |
| 96 | +Cuando estés listo, haz commit de los cambios y envía un Pull Request. |
| 97 | + |
| 98 | +<!-- |
| 99 | +:::info Formatting |
| 100 | +
|
| 101 | +We handle code formatting and linting automatically. Relax, type away, and let the machines do the work. |
| 102 | +
|
| 103 | +::: |
| 104 | +--> |
| 105 | + |
| 106 | +:::info Formato |
| 107 | + |
| 108 | +Nos encargamos del formato del código y del linting automáticamente. Relájate, escribe y deja que las máquinas hagan el trabajo. |
| 109 | + |
| 110 | +::: |
| 111 | + |
| 112 | +<!-- |
| 113 | +### Running a local Multisite |
| 114 | +--> |
| 115 | + |
| 116 | +### Ejecutar un Multisite local |
| 117 | + |
| 118 | +<!-- |
| 119 | +WordPress Multisite has a few [restrictions when run locally](https://developer.wordpress.org/advanced-administration/multisite/prepare-network/#restrictions). If you plan to test a Multisite network using Playground's `enableMultisite` step, make sure you either change `wp-now`'s default port or set a local test domain running via HTTPS. |
| 120 | +--> |
| 121 | + |
| 122 | +WordPress Multisite tiene algunas [restricciones cuando se ejecuta localmente](https://developer.wordpress.org/advanced-administration/multisite/prepare-network/#restrictions). Si planeas probar una red Multisite usando el paso `enableMultisite` de Playground, asegúrate de cambiar el puerto por defecto de `wp-now` o de establecer un dominio de prueba local que se ejecute a través de HTTPS. |
| 123 | + |
| 124 | +<!-- |
| 125 | +To change `wp-now`'s default port to the one supported by WordPress Multisite, run it using the `--port=80` flag: |
| 126 | +--> |
| 127 | + |
| 128 | +Para cambiar el puerto por defecto de `wp-now` al soportado por WordPress Multisite, ejecútalo usando la bandera `--port=80`: |
| 129 | + |
| 130 | +```bash |
| 131 | +npx @wp-now/wp-now start --port=80 |
| 132 | +``` |
| 133 | + |
| 134 | +<!-- |
| 135 | +There are a few ways to set up a local test domain, including editing your `hosts` file. If you're unsure how to do that, we suggest installing [Laravel Valet](https://laravel.com/docs/11.x/valet) and then running the following command: |
| 136 | +--> |
| 137 | + |
| 138 | +Hay varias maneras de configurar un dominio de prueba local, incluyendo la edición de tu archivo `hosts`. Si no estás seguro de cómo hacerlo, te sugerimos que instales [Laravel Valet](https://laravel.com/docs/11.x/valet) y luego ejecutes el siguiente comando: |
| 139 | + |
| 140 | +```bash |
| 141 | +valet proxy playground.test http://127.0.0.1:5400 --secure |
| 142 | +``` |
| 143 | + |
| 144 | +<!-- |
| 145 | +Your dev server is now available on https://playground.test. |
| 146 | +--> |
| 147 | + |
| 148 | +Tu servidor de desarrollo está ahora disponible en https://playground.test. |
| 149 | + |
| 150 | +<!-- |
| 151 | +## Debugging |
| 152 | +--> |
| 153 | + |
| 154 | +## Depuración |
| 155 | + |
| 156 | +<!-- |
| 157 | +### Use VS Code and Chrome |
| 158 | +--> |
| 159 | + |
| 160 | +### Usar VS Code y Chrome |
| 161 | + |
| 162 | +<!-- |
| 163 | +If you're using VS Code and have Chrome installed, you can debug Playground in the code editor: |
| 164 | +--> |
| 165 | + |
| 166 | +Si usas VS Code y tienes Chrome instalado, puedes depurar Playground en el editor de código: |
| 167 | + |
| 168 | +<!-- |
| 169 | +- Open the project folder in VS Code. |
| 170 | +- Select Run > Start Debugging from the main menu or press `F5`/`fn`+`F5`. |
| 171 | +--> |
| 172 | + |
| 173 | +- Abre la carpeta del proyecto en VS Code. |
| 174 | +- Selecciona Ejecutar > Iniciar depuración en el menú principal o pulsa `F5`/`fn`+`F5`. |
| 175 | + |
| 176 | +<!-- |
| 177 | +### Debugging PHP |
| 178 | +--> |
| 179 | + |
| 180 | +### Depuración de PHP |
| 181 | + |
| 182 | +<!-- |
| 183 | +Playground logs PHP errors in the browser console after every PHP request. |
| 184 | +--> |
| 185 | + |
| 186 | +Playground registra los errores de PHP en la consola del navegador después de cada solicitud PHP. |
0 commit comments