@@ -189,8 +189,6 @@ public static function get_default_settings() {
189189 'qdrant_api_key ' => '' ,
190190 'qdrant_endpoint ' => '' ,
191191 'chat_enabled ' => true ,
192- 'welcome_message ' => __ ( 'Hello! How can I help you today? ' , 'hyve-lite ' ),
193- 'default_message ' => __ ( 'Sorry, I \'m not able to help with that. ' , 'hyve-lite ' ),
194192 'chat_model ' => 'gpt-4o-mini ' ,
195193 'temperature ' => 1 ,
196194 'top_p ' => 1 ,
@@ -207,6 +205,8 @@ public static function get_default_settings() {
207205 'harassment/threatening ' => 60 ,
208206 'violence ' => 70 ,
209207 ],
208+ 'welcome_message ' => '' ,
209+ 'default_message ' => '' ,
210210 ]
211211 );
212212 }
@@ -223,6 +223,31 @@ public static function get_settings() {
223223 return wp_parse_args ( $ settings , self ::get_default_settings () );
224224 }
225225
226+ /**
227+ * Add the translatable label to the default value.
228+ *
229+ * Use this in a context where translations are correctly loaded.
230+ *
231+ * @since 1.2
232+ *
233+ * @return void
234+ */
235+ public static function add_labels_to_default_settings () {
236+ add_filter (
237+ 'hyve_default_settings ' ,
238+ function ( $ settings ) {
239+ if ( ! is_array ( $ settings ) ) {
240+ return $ settings ;
241+ }
242+
243+ $ settings ['welcome_message ' ] = __ ( 'Hello! How can I help you today? ' , 'hyve-lite ' );
244+ $ settings ['default_message ' ] = __ ( 'Sorry, I \'m not able to help with that. ' , 'hyve-lite ' );
245+
246+ return $ settings ;
247+ }
248+ );
249+ }
250+
226251 /**
227252 * Enqueue assets.
228253 *
@@ -254,6 +279,7 @@ public function enqueue_assets() {
254279
255280 wp_set_script_translations ( 'hyve-lite-scripts ' , 'hyve-lite ' );
256281
282+ self ::add_labels_to_default_settings ();
257283 $ settings = self ::get_settings ();
258284
259285 wp_localize_script (
0 commit comments