I am french too, but I must answer in English.
You need to use wp_localize_script(), that allow to handle localization in js scripts.
add_action('wp_enqueue_scripts', 'load_script');
function load_script(){
wp_register_script( 'popup', plugins_url('yourscript/js/yourjs.js'), array( 'jquery' ), false, true );
wp_localize_script(
'popup',
'popUp',
array(
'popupTitle'=> __('', 'your-text-domain)
)
);
wp_enqueue_script('popup');
}
In the js file, you will able to retrieve value:
function save_image($id){
var mediaUploader;
event.preventDefault();
// If the uploader object has already been created, reopen the dialog
if (mediaUploader) {
mediaUploader.open();
return;
}
// Extend the wp.media object
var popupTitle = popUp.popupTitle;
mediaUploader = wp.media.frames.file_frame = wp.media({
title: popupTitle,
button: {
text: popupTitle
},
multiple: false,
type: 'image'
});
// When a file is selected, grab the URL and set it as the text field's value
mediaUploader.on('select', function() {
attachment = mediaUploader.state().get('selection').first().toJSON();
});
// Open the uploader dialog
mediaUploader.open();
}
https://codex.wordpress.org/Function_Reference/wp_localize_script
You can install the plugin WordPress Media Javascript Guide. It explains with screenshots and examples the must use method of the wp.media object.
Just a snippet to change the button text and the title:
wp_register_script( 'media-bbss-uploader-js', BBSSLIDERS_DIR_URL .'/js/bbss-multiple-media-upload.js', array('jquery') );
wp_localize_script(
'media-bbss-uploader-js',
'screenHelp',
array(
'title' => __('Select or upload new slides', $this->plugin_text_domain),
'buttomText' => __('Add slides', $this->plugin_text_domain),
)
);
wp_enqueue_script( 'media-bbss-uploader-js' );