112 | | if ( $translate && ! empty($plugin_data['TextDomain']) ) { |
113 | | if ( ! empty( $plugin_data['DomainPath'] ) ) |
114 | | load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']); |
115 | | else |
116 | | load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file)); |
117 | | |
118 | | foreach ( array('Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version') as $field ) |
119 | | $plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']); |
| 112 | if ( $translate ) { |
| 113 | if ( $textdomain = $plugin_data['TextDomain'] ) { |
| 114 | if ( ! empty( $plugin_data['DomainPath'] ) ) |
| 115 | load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] ); |
| 116 | else |
| 117 | load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) ); |
| 118 | } elseif ( 'Hello Dolly' == $plugin_data['Name'] ) { |
| 119 | $textdomain = 'default'; |
| 120 | } |
| 121 | if ( $textdomain ) { |
| 122 | foreach ( array( 'Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version' ) as $field ) |
| 123 | $plugin_data[ $field ] = translate( $plugin_data[ $field ], $textdomain ); |
| 124 | } |