kirki: In fields strings for translation is not translated.
Issue description:

Version used:
3.0.25 as plugin.
Using theme_mods or options?
theme_mods
Code to reproduce the issue (config + field(s))
if ( class_exists( 'Kirki' ) ) {
Kirki::add_config( 'theme2_kirki', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
}
function theme2_customize_register( $wp_customize ) {
if ( class_exists( 'Kirki' ) ) {
Kirki::add_section( 'theme2_footer_info', array(
'title' => esc_attr__( 'Footer Info', 'theme2' ), // IS TRANSLATED
) );
};
}
add_action( 'customize_register', 'theme2_customize_register' );
if ( class_exists( 'Kirki' ) ) {
Kirki::add_field( 'theme2_kirki', array(
'type' => 'checkbox',
'settings' => 'theme2_display_footer_info',
'label' => esc_attr__( 'Display Footer Info', 'theme2' ), // IS NOT TRANSLATED
'section' => 'theme2_footer_info',
'default' => false,
) );
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (10 by maintainers)
Aristeides, thank you very much for your patience and help. We had done as you recommended (opt. 2), and everything is working fine.
We also tried to use “after_setup_theme” and everything was working, but inasmuch as in notice “Kirki fields should not be added on customize_register. Please add them directly, or on init.” this event was not mentioned, we did not use this option. We did not even think about to download textdomain directly for solution. Therefore, perhaps, to prevent such situations, you need to supplement this notice and make it like this, for example: “Kirki fields should not be added on customize_register. Please add them directly (if textdomain was loaded directly), or on init or after_setup_theme (if textdomain was loaded on after_setup_theme).”
Thank you again and success to Kirki plugin!
I have confirmed that this is indeed an issue, I’m just still looking for a fix. Once I have something I’ll post an update here.