Advertisement
favmatteo

Untitled

Mar 16th, 2023
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5.  
  6.    
  7. ini_set('display_errors', 1);
  8. ini_set('display_startup_errors', 1);
  9. error_reporting(E_ALL);
  10.  
  11. if(!isset($_SESSION['language'])){
  12.     $language = 'en_US.utf8';
  13. }else{
  14.     $language = $_SESSION['language'];
  15. }
  16.  
  17. $_SESSION['language'] = $language;
  18. # echo $_SESSION['language'];
  19.  
  20. putenv("LANG=" . $language);
  21. setlocale(LC_ALL, $language);
  22.  
  23. $domain = "messages";
  24. bindtextdomain($domain, "locale");
  25. bind_textdomain_codeset($domain, 'UTF-8');
  26. textdomain($domain);
  27.  
  28. # echo _('HELLO_WORLD');
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement