@@ -371,9 +371,7 @@ pub async fn get_translation_summary(
371371 } ) ;
372372 } else {
373373 // Session directory doesn't exist
374- return Err ( format ! (
375- "Session not found: {session_id}"
376- ) ) ;
374+ return Err ( format ! ( "Session not found: {session_id}" ) ) ;
377375 }
378376 }
379377
@@ -402,13 +400,16 @@ pub async fn update_translation_summary(
402400) -> Result < ( ) , String > {
403401 println ! ( "[update_translation_summary] Called with: minecraft_dir={}, session_id={}, translation_type={}, name={}, status={}, translated_keys={}, total_keys={}, target_language={}" ,
404402 minecraft_dir, session_id, translation_type, name, status, translated_keys, total_keys, target_language) ;
405-
403+
406404 let session_dir = PathBuf :: from ( & minecraft_dir)
407405 . join ( "logs" )
408406 . join ( "localizer" )
409407 . join ( & session_id) ;
410-
411- println ! ( "[update_translation_summary] Session directory: {}" , session_dir. display( ) ) ;
408+
409+ println ! (
410+ "[update_translation_summary] Session directory: {}" ,
411+ session_dir. display( )
412+ ) ;
412413
413414 // Ensure session directory exists
414415 fs:: create_dir_all ( & session_dir)
@@ -446,7 +447,10 @@ pub async fn update_translation_summary(
446447
447448 fs:: write ( & summary_path, json) . map_err ( |e| format ! ( "Failed to write summary file: {e}" ) ) ?;
448449
449- println ! ( "[update_translation_summary] Successfully wrote summary to: {}" , summary_path. display( ) ) ;
450+ println ! (
451+ "[update_translation_summary] Successfully wrote summary to: {}" ,
452+ summary_path. display( )
453+ ) ;
450454 Ok ( ( ) )
451455}
452456
@@ -460,13 +464,16 @@ pub async fn batch_update_translation_summary(
460464) -> Result < ( ) , String > {
461465 println ! ( "[batch_update_translation_summary] Called with: minecraft_dir={}, session_id={}, target_language={}, entries_count={}" ,
462466 minecraft_dir, session_id, target_language, entries. len( ) ) ;
463-
467+
464468 let session_dir = PathBuf :: from ( & minecraft_dir)
465469 . join ( "logs" )
466470 . join ( "localizer" )
467471 . join ( & session_id) ;
468-
469- println ! ( "[batch_update_translation_summary] Session directory: {}" , session_dir. display( ) ) ;
472+
473+ println ! (
474+ "[batch_update_translation_summary] Session directory: {}" ,
475+ session_dir. display( )
476+ ) ;
470477
471478 // Ensure session directory exists
472479 fs:: create_dir_all ( & session_dir)
@@ -490,27 +497,34 @@ pub async fn batch_update_translation_summary(
490497
491498 // Add all new translation entries
492499 for entry_value in entries {
493- if let Ok ( entry_data) = serde_json:: from_value :: < serde_json:: Map < String , serde_json:: Value > > ( entry_value) {
494- let translation_type = entry_data. get ( "translationType" )
500+ if let Ok ( entry_data) =
501+ serde_json:: from_value :: < serde_json:: Map < String , serde_json:: Value > > ( entry_value)
502+ {
503+ let translation_type = entry_data
504+ . get ( "translationType" )
495505 . and_then ( |v| v. as_str ( ) )
496506 . unwrap_or ( "unknown" )
497507 . to_string ( ) ;
498-
499- let name = entry_data. get ( "name" )
508+
509+ let name = entry_data
510+ . get ( "name" )
500511 . and_then ( |v| v. as_str ( ) )
501512 . unwrap_or ( "unknown" )
502513 . to_string ( ) ;
503-
504- let status = entry_data. get ( "status" )
514+
515+ let status = entry_data
516+ . get ( "status" )
505517 . and_then ( |v| v. as_str ( ) )
506518 . unwrap_or ( "failed" )
507519 . to_string ( ) ;
508-
509- let translated_keys = entry_data. get ( "translatedKeys" )
520+
521+ let translated_keys = entry_data
522+ . get ( "translatedKeys" )
510523 . and_then ( |v| v. as_i64 ( ) )
511524 . unwrap_or ( 0 ) as i32 ;
512-
513- let total_keys = entry_data. get ( "totalKeys" )
525+
526+ let total_keys = entry_data
527+ . get ( "totalKeys" )
514528 . and_then ( |v| v. as_i64 ( ) )
515529 . unwrap_or ( 0 ) as i32 ;
516530
@@ -531,6 +545,10 @@ pub async fn batch_update_translation_summary(
531545
532546 fs:: write ( & summary_path, json) . map_err ( |e| format ! ( "Failed to write summary file: {e}" ) ) ?;
533547
534- println ! ( "[batch_update_translation_summary] Successfully wrote summary with {} entries to: {}" , summary. translations. len( ) , summary_path. display( ) ) ;
548+ println ! (
549+ "[batch_update_translation_summary] Successfully wrote summary with {} entries to: {}" ,
550+ summary. translations. len( ) ,
551+ summary_path. display( )
552+ ) ;
535553 Ok ( ( ) )
536554}
0 commit comments