Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
Wordpress i18n JavaScript text not translating

I'm preparing a wordpress site for localisation. I've generated the pot, po and mo files and have gotten the translation working for the php files. However the text from the javascript files doesn't get translated.

When generating the .po file from the .pot, it does find the strings in the javascript files.

The javascript fragment:

let message = __("Some text",'fiboo-plugins');

$('<div id="participant-changed-message">' +
message
+ '</div>').insertBefore('table');

The php fragment where the script is enqueued:

wp_enqueue_script( 'fca-participants', plugins_url('/fiboo-plugins/fiboo-custom-account/public/participants/list/participants.js'), array( 'jquery', 'wp-i18n' ), NULL, true );
wp_set_script_translations('fca-participants', 'fiboo-plugins', plugin_dir_path(dirname(__FILE__) ). '/fiboo-plugins/languages/');

The php fragment where to text domain is loaded:

function load_fiboo_textdomain() {
   load_plugin_textdomain('fiboo-plugins', false, basename( __DIR__ ) . '/languages/'  );
}
add_action( 'plugins_loaded', 'load_fiboo_textdomain', 0 );
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda