Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2.  
  3.     $language = "en";
  4.  
  5.     $translations = array();
  6.     $translations['nl'] = array(
  7.         "course" => "Cursus"
  8.     );
  9.     $translations['en'] = array(
  10.         "course" => "Course"
  11.     );
  12.  
  13.     function translate($tag){
  14.         global $translations;
  15.         global $language;
  16.  
  17.         $setTranslations = $translations[$language];
  18.         return $setTranslations[$tag];
  19.     }
  20. ?>
  21.  
  22.  
  23. <!doctype html>
  24. <html lang="en">
  25.     <head>
  26.         <meta charset="UTF-8">
  27.         <meta name="viewport"
  28.               content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  29.         <meta http-equiv="X-UA-Compatible" content="ie=edge">
  30.         <title>Document</title>
  31.     </head>
  32.     <body>
  33.  
  34.         <h1><?= translate('course') ?></h1>
  35.  
  36.     </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement