| [ Index ] |
PHP Cross Reference of GlotPress |
[Summary view] [Print] [Text view]
1 <?php 2 require_once dirname( dirname( __FILE__ ) ) . '/gp-load.php'; 3 4 class GP_Script_WPorg2Slug extends GP_CLI { 5 6 var $usage = "<wporg-locale>"; 7 8 function run() { 9 if ( !isset( $this->args[0] ) ) { 10 $this->usage(); 11 } 12 $wporg_slug = $this->args[0]; 13 $slug = null; 14 foreach( GP_Locales::locales() as $locale ) { 15 if ( $locale->wp_locale == $wporg_slug ) { 16 $slug = $locale->slug; 17 break; 18 } 19 } 20 if ( !$slug ) 21 $this->to_stderr("No slug match for $wporg_slug."); 22 else 23 echo $slug; 24 } 25 } 26 27 $gp_script_wporg2slug = new GP_Script_WPorg2Slug; 28 $gp_script_wporg2slug->run();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu May 24 03:59:35 2012 | Hosted by follow the white rabbit. |