Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.96 KB

File metadata and controls

47 lines (36 loc) · 1.96 KB

Internationalization (i18n)

TeamVault follows the standard WordPress.org translation workflow so translators can collaborate in GlotPress instead of editing PHP.

How it works

  • All user-facing strings use the mikesoft-teamvault text domain (__(), esc_html__(), esc_attr__(), esc_html_e() …).

  • MSTV_I18n::init() (runs on init via MSTV_Bootstrap::init_services()) loads community language packs with the standard call:

    load_plugin_textdomain('mikesoft-teamvault', false, dirname(plugin_basename(__FILE__), 2) . '/languages');

    (__FILE__ is includes/class-mstv-i18n.php, hence dirname level 2.)

  • languages/mikesoft-teamvault.pot is the translatable-string template shipped for GlotPress import.

  • The hardcoded it/fr/es/de maps in includes/class-mstv-i18n.php stay as a runtime fallback (via the gettext filter) so the bundled interface languages keep working when no language pack is installed. They are not the translation source of truth — GlotPress is.

Regenerating the POT

Preferred (requires wp-cli):

wp i18n make-pot . languages/mikesoft-teamvault.pot --domain=mikesoft-teamvault

The committed POT was produced with an equivalent extractor (same function set and mikesoft-teamvault domain filter, #: file:line references, Plural-Forms: nplurals=2; plural=(n != 1);) because wp-cli was unavailable; re-running wp i18n make-pot is welcome to normalize it.

GlotPress handoff

  1. Import the updated .pot into the WordPress.org plugin GlotPress project on release.
  2. Approved translations ship automatically as WordPress.org language packs into wp-content/languages/plugins/ — no bundled .po/.mo files needed.
  3. Keep the fallback maps in sync only until GlotPress coverage for a locale is complete; the maps must always cover every mikesoft-teamvault string (guarded by tests/PdmI18nCoverageTest.php).