Languages
Languages
Shared across every PremiumPress product. 1 classes in inc/Languages.
Installer Installer.php
On-demand language installer. Client theme ZIPs ship WITHOUT compiled translations (keeps them small); instead each product's per-language .mo files live on the CDN (same model as the theme's static assets — see PPT_CDN). This service lets an admin install a language with one click, and keeps what is installed in step with the theme. WHERE A PACK LIVES: WP_LANG_DIR/themes/ppt//ppt-.mo — outside the theme folder, so it survives theme updates, and PER PRODUCT, because each product's pack is a different slice of the catalogue. Packs used to go to WP_LANG_DIR/themes/ppt-.mo, which has no product in the name: on a multisite every product shared one file per language (whichever was installed last won), and the file was never refreshed, so a site that installed Spanish before an update kept the old pack forever — new designs showed translated menus over English page copy. filterLangDir() points WordPress at the right file (see activePath()): a translation the site owner made themselves in the old place still wins; one of our old packs there is only a last resort until the refresh lands. STAYING CURRENT: each pack carries a ppt-.ver stamp holding the theme version it was downloaded for. When the theme version changes (update, or a product switch), the packs are re-downloaded in the background by WP-Cron — see maybeScheduleRefresh(). CDN layout (written by tools/cdn-upload-lang.js): <cdn>/lang/<theme-slug>/manifest.json — {"locales":["zh_CN","de_DE",…]} <cdn>/lang/<theme-slug>/<locale>.mo — the product's sliced translation