Lines:
1 to 48 of 48
<?php if ( !defined( 'OIK_L10N_INCLUDED' ) ) { define( 'OIK_L10N_INCLUDED', '3.2.2' ); /** * @copyright (C) Copyright Bobbing Wide 2017-2023 * Shared library for localization. * * Library: oik-l10n * Provides: oik-l10n * Type: * * The theory is something like this: * * - makepot's job is to find strings that can be translated * - WordPress.org expects each plugin and theme to use a unique domain * - though it doesn't enforce it * - So makepot outputs any translatable string regardless of the value of $domain * - Prove this. * * - which means translators end up translating the same string over and over * - especially if we use shared libraries ( a la oik ) or Composer dependency * * - Users don't really care who did the translation * - They just want it in their language * * - If we use oik_require_lib() * - AND the library file knows that translation will be required * - then we can hook into `gettext` to provide Just In Time - Just Translate It logic * * @TODO - Determine if we really need to decide which domains we need to cater for. * If there are a lot of existing shared libraries then we might need to handle a set of * domains against which to match. */ /* function oik_l10n_enable_jti() – Enables/disables "Just Translate It" */ /* function oik_l10n_gettext() – Implements gettext for Just In Time – Just Translate It logic */ /* function oik_l10n_domain_loaded() – Tests if the domain is loaded */ /* function oik_l10n_load_domain() – Loads the merged domain */ /* function oik_l10n_trace() – Traces $l10n */ } /* end if !defined */View on GitHub View on Trac