Skip to content

Commit

Permalink
Added L10n support
Browse files Browse the repository at this point in the history
  • Loading branch information
jpSimkins committed Mar 2, 2015
1 parent bfa2360 commit ca4d7e3
Show file tree
Hide file tree
Showing 4 changed files with 686 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ This is the workflow I used to develop this plugin.
- [x] Allow for custom taxonomy association
- [x] Import media sources
- [x] Add hooks to allow for easy customization for unique setups
- [x] L10n
- [ ] Add multi-lingual import option (site I'm working on uses two languages so I have duplicate content as each post has two versions)
- [ ] L10n

## Known Issues
- [ ] Long titles do not return a valid slug. This is WordPress behavior.
Expand Down
8 changes: 8 additions & 0 deletions drupal2wp/drupal2wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Version: 1.1
* Author: Jeremy Simkins <jpSimkins@gmail.com>
* Author URI: http://jeremysimkins.com
* Text Domain: drupal2wp
* Domain Path: /languages/
* License: GPL2
*/

Expand Down Expand Up @@ -33,6 +35,8 @@
define('DRUPAL2WP_DIRECTORY_URL', plugin_dir_url(DRUPAL2WP_FILE));
// Register Autoloader
spl_autoload_register('drupal2wp_autoloader');
// L10n
add_action( 'plugins_loaded', 'drupal2wp_l10n' );
// initialize the plugin
add_action('init', 'drupal2wp_init', 50); // set to 50 to make sure all other plugins initialize first

Expand All @@ -56,6 +60,10 @@ function drupal2wp_init() {
$drupal2wp = new Drupal2WordPress();
}

function drupal2wp_l10n() {
load_plugin_textdomain( 'drupal2wp', false, dirname( plugin_basename(DRUPAL2WP_FILE) ) . '/languages' );
}

function debug($data, $return=false, $echo=false, $showCalledFrom=true) {
if (!$return) {
wp_die( _debugCalledFrom(1, __FUNCTION__, $showCalledFrom).'<pre>'.
Expand Down
Binary file added drupal2wp/languages/en_US.mo
Binary file not shown.
Loading

0 comments on commit ca4d7e3

Please sign in to comment.