How does the choice between server-side (PHP) and client-side (JavaScript) translation impact server load and performance?

When choosing between server-side (PHP) and client-side (JavaScript) translation, it's important to consider the impact on server load and performance. Server-side translation can increase server load as each translation request requires server processing, while client-side translation offloads the work to the user's browser. To optimize performance, consider using client-side translation for static content and server-side translation for dynamic content.

// Example of server-side translation in PHP
function translate_text($text, $language) {
    // Code to translate $text to $language using a translation service
    return $translated_text;
}

// Usage
$translated_text = translate_text("Hello", "es");
echo $translated_text;