# Translating Sticky Ad Lightweight

Version 3.5.1 bundles translations for all 111 current plugin strings in 20 languages: Arabic (`ar`), Czech (`cs_CZ`), German (`de_DE`), Greek (`el`), Spanish (`es_ES`), French (`fr_FR`), Hindi (`hi_IN`), Indonesian (`id_ID`), Italian (`it_IT`), Japanese (`ja`), Korean (`ko_KR`), Dutch (`nl_NL`), Polish (`pl_PL`), Brazilian Portuguese (`pt_BR`), Romanian (`ro_RO`), Russian (`ru_RU`), Swedish (`sv_SE`), Turkish (`tr_TR`), Ukrainian (`uk`), and Simplified Chinese (`zh_CN`). English is the source language. These cover the listed locales specifically; other regional variants are not included.

These translations are AI-generated and have not been reviewed by native speakers. Corrections are welcome in the PO files. Product names, author names, event identifiers, and code examples are intentionally preserved. Coverage means every source string has a catalog entry; it does not imply linguistic review or WordPress.org approval.

Each language includes editable PO, compiled MO for PHP, and two hashed Jed JSON files for the media picker and editor block. Its text domain is `sticky-ad-lightweight`. Choose the corresponding WordPress site/user language to use these files. PHP labels, help, accessibility text, the default close label, the media picker, and editor block use WordPress translation APIs.

For WordPress.org installations, contribute at https://translate.wordpress.org/projects/wp-plugins/sticky-ad-lightweight/. Bundling translations does not mark them approved on that platform or increase its completion percentages automatically. Locale translation editors must review submissions there; follow each locale team's rules, including any rules about machine-generated translations. Approved language packs are provided by WordPress.org. Both JavaScript handles are registered for script translations.

For a custom translation, open `sticky-ad-lightweight.pot` in Poedit or another gettext editor, translate it, and save `sticky-ad-lightweight-LOCALE.po` and the compiled `.mo` in this directory (for example `sticky-ad-lightweight-fr_FR.mo`). Choose the matching WordPress site/user language. Global language packs take priority over bundled translations. Custom files inside the plugin may be replaced during updates; keep your source files backed up.

JavaScript translations require Jed JSON files as well as PO/MO. With WP-CLI's i18n package installed, run `wp i18n make-json languages --no-purge` from the plugin root after saving the PO. Keep the template's `js/...` source references intact: WordPress uses their hashes to locate the per-script JSON files. Generated JSON files belong in this directory, alongside the MO. WordPress.org produces these files for its own language packs.

The template can be refreshed with `php tools/make-pot.php` from the development workspace. It covers the current plugin's singular gettext calls in PHP and JavaScript. If adding plural/contextual translations, extend the generator or use `wp i18n make-pot . languages/sticky-ad-lightweight.pot --exclude=tests,tools,dist,.wordpress-org`.

After editing the bundled PO files, run `python tools/build-translations.py`. It requires Python 3 with only its standard library, validates coverage and formatting placeholders, compiles MO files, verifies them through a gettext round trip, and regenerates per-script JSON. The compiler supports this plugin's current singular catalogs and rejects unsupported plural/contextual PO syntax rather than silently dropping it. `tools/build-release.ps1` runs that compiler and includes all language assets in both the installable ZIP and SVN bundle. The PO files are the translation source of truth; do not edit compiled MO/JSON files directly.

Ad code, analytics event names and destinations, IDs, custom close labels, and other user-entered values are not translated. The built-in `Close` default is translated at display time; changing the site's language never rewrites saved options. RTL languages also get directional spacing and matching arrow-key tab navigation.
