=== Contributing to Mroya ===

= Minifying CSS and JS =

Mroya has a stylesheet and js files which is enqueued in addition to the global styles and scripts coming from core. On a normal production site, when `SCRIPT_DEBUG` is disabled, then the minified versions of files will be enqueued instead. If you make a change to `src/scss/*.scss` or `src/js/*.js`, you'll need to re-minify files using the built-in npm build tool. As always, it is preferable to use the Site Editor to supply Additional CSS instead of directly editing the theme stylesheet.

= Translation =

Mroya is translation-ready and uses the WordPress internationalization (i18n) system. The theme includes a languages directory containing translation files. The POT template can be regenerated whenever translatable strings are added or modified. Mroya uses WP-CLI to extract translatable strings and generate translation files.

= Installation instructions =

1. Ensure you have the following tools installed:
- Node.js (https://nodejs.org/),
- npm (https://www.npmjs.com/ - comes with Node.js).
- PHP (https://www.php.net/).
- WP-CLI (https://wp-cli.org/).

2. Download or clone this repository: https://github.com/uladzimirkulesh/mroya. You'll want to add it to your local WordPress `wp-content/themes/` directory.

3. Type `npm install` into the command line, and press the [return] key, to install all Node.js dependencies.

4. Make sure WP-CLI is available by running wp --info in your terminal.

= Usage instructions =

1. After making a changes, run `npm run build` from within the theme directory to regenerate files with your new changes.

2. You can also "watch" the theme directory for changes and re-minify the CSS and JS anytime a change occurs by running: `npm run watch`.

= Generating translation files =

1. After adding or modifying translatable strings, run `npm run i18n:pot`. This generates or updates the languages/mroya.pot translation template.

2. To update existing PO translation files using the latest POT template, run `npm run i18n:update`.

3. To compile PO translation files into MO files, run `npm run i18n:mo`.

4. To generate JSON translation files for JavaScript, run `npm run i18n:json`.

= Working with translations =

- Use the "mroya" text domain for all translatable strings.
- In PHP, use WordPress internationalization functions such as __(), _e(), _x(), and _n().
- In JavaScript, use the @wordpress/i18n package and its translation functions.
- Keep translation files in the "languages" directory.
- Do not edit the generated POT file manually.
- When adding new translatable strings, regenerate the POT file and update existing translations before committing your changes.
