| @@ -32,8 +32,46 @@ | ||
| 32 | 32 | return 'history'; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | + * Localize settings. | |
| 37 | + * | |
| 38 | + * Add new localized settings for the history module. | |
| 39 | + * | |
| 40 | + * Fired by `elementor/editor/localize_settings` filter. | |
| 41 | + * | |
| 42 | + * @since 1.7.0 | |
| 43 | + * @access public | |
| 44 | + * | |
| 45 | + * @param array $settings Localized settings. | |
| 46 | + * | |
| 47 | + * @return array Localized settings. | |
| 48 | + */ | |
| 49 | + public function localize_settings( $settings ) { | |
| 50 | + $settings = array_replace_recursive( $settings, [ | |
| 51 | + 'i18n' => [ | |
| 52 | + 'history' => __( 'History', 'elementor' ), | |
| 53 | + 'template' => __( 'Template', 'elementor' ), | |
| 54 | + 'added' => __( 'Added', 'elementor' ), | |
| 55 | + 'removed' => __( 'Removed', 'elementor' ), | |
| 56 | + 'edited' => __( 'Edited', 'elementor' ), | |
| 57 | + 'moved' => __( 'Moved', 'elementor' ), | |
| 58 | + 'pasted' => __( 'Pasted', 'elementor' ), | |
| 59 | + 'editing_started' => __( 'Editing Started', 'elementor' ), | |
| 60 | + 'style_pasted' => __( 'Style Pasted', 'elementor' ), | |
| 61 | + 'style_reset' => __( 'Style Reset', 'elementor' ), | |
| 62 | + 'settings_reset' => __( 'Settings Reset', 'elementor' ), | |
| 63 | + 'enabled' => __( 'Enabled', 'elementor' ), | |
| 64 | + 'disabled' => __( 'Disabled', 'elementor' ), | |
| 65 | + 'all_content' => __( 'All Content', 'elementor' ), | |
| 66 | + 'elements' => __( 'Elements', 'elementor' ), | |
| 67 | + ], | |
| 68 | + ] ); | |
| 69 | + | |
| 70 | + return $settings; | |
| 71 | + } | |
| 72 | + | |
| 73 | + /** | |
| 36 | 74 | * @since 2.3.0 |
| 37 | 75 | * @access public |
| 38 | 76 | */ |
| 39 | 77 | public function add_templates() { |
| @@ -49,7 +87,9 @@ | ||
| 49 | 87 | * @since 1.7.0 |
| 50 | 88 | * @access public |
| 51 | 89 | */ |
| 52 | 90 | public function __construct() { |
| 91 | + add_filter( 'elementor/editor/localize_settings', [ $this, 'localize_settings' ] ); | |
| 92 | + | |
| 53 | 93 | add_action( 'elementor/editor/init', [ $this, 'add_templates' ] ); |
| 54 | 94 | } |
| 55 | 95 | } |