• Hi,
    I’ve a problem with the timing of string translations in a custom theme.
    I’ve defined the domain in this way:

    add_action('after_setup_theme', 'tuo_tema_load_textdomain', 0);
    function tuo_tema_load_textdomain() {
    load_theme_textdomain('my-textdomain', get_template_directory() . '/languages');
    }

    However now I have this warning:

    Notice: The _load_textdomain_just_in_time function was called incorrectly. The translation loading for the text domain my-textdomain was triggered too early…

    because in some modules I’ve defined constants like this:

    define(
    'DLI_SPINOFF_STATUS',
    array(
    'In attività' => __( 'Cerca area tematica', 'my-textdomain' ),
    'Cessata' => __( 'Cessata', 'my-textdomain' ),
    )
    );

    I need to translate these values. What’s the best way to have constants translated without triggering the warning?

    Thank you very much.

    Claudio

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.