Advertisement
Guest User

WordPress Set Locale Simple Plugin

a guest
Apr 18th, 2012
1,166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. Plugin Name: Set Locale
  4. Plugin URI: http://yoursite.tld
  5. Description: Sets the locale
  6. Author: Johannes Pilkahn
  7. Version: 1.0
  8. Author URI: http://tramprennen.org
  9. */
  10.  
  11. function sl_current_lang() {
  12.     $sl_uri = $_SERVER["REQUEST_URI"];
  13.     $sl_lang = array_pop( explode( '/',  $sl_uri ) );
  14.  
  15.     return $sl_lang;
  16. }
  17.  
  18. function sl_set_locale() {
  19.  
  20.     if( sl_current_lang() == 'en' ) {
  21.         define( 'WPLANG', 'en_US' );
  22.     } else {
  23.         define( 'WPLANG', 'el_GR' );
  24.     }
  25. }
  26.  
  27. sl_set_locale();
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement