$path ) { $check_file = ( 'author' === $key ) ? trailingslashit( $path ) . "{$selected_lang}.po" : trailingslashit( $path ) . "{$slug}-{$selected_lang}.po"; if ( file_exists( $check_file ) ) { $po_file = $check_file; break; } } } if ( ! empty( $po_file ) && ! AF_Translate_Path_Validator::validate_containment( $po_file, false ) ) { wp_die( esc_html__( 'Security Exception: Target data stream layout points outside authorized system space.', 'af-translate' ) ); } // Parse PO map structures safely using our isolated extraction engine $strings = AF_Translate_PO_Processor::parse_file( $po_file ); $total_count = count( $strings ); $mod_time = ! empty( $po_file ) && file_exists( $po_file ) ? date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), filemtime( $po_file ) ) : esc_html__( 'Unknown Runtime State', 'af-translate' ); $target_page = ( 'plugin' === $type ) ? 'af-translate-plugins' : 'af-translate-themes'; // Load the detached HTML template $template_path = plugin_dir_path( __FILE__ ) . 'views/html-editor-workbench.php'; if ( file_exists( $template_path ) ) { include $template_path; } else { echo '

' . esc_html__( 'Critical Exception: Editor workspace layout template not found.', 'af-translate' ) . '

'; } } }