diff --git a/features.admin.inc b/features.admin.inc index b86ddda..ab9a379 100644 --- a/features.admin.inc +++ b/features.admin.inc @@ -178,6 +178,10 @@ function features_export_form_validate_field($element, &$form_state) { * Submit handler for features_export_form_build(). */ function features_export_build_form_submit($form, &$form_state) { + + // Set language temporarily to English + _features_set_original_language(); + module_load_include('inc', 'features', 'features.export'); features_include(); @@ -812,4 +816,4 @@ function features_dom_decode_options($options, $keys_only = FALSE) { $encoded[strtr($key, $replacements)] = $keys_only ? $value : strtr($value, $replacements); } return $encoded; -} \ No newline at end of file +} diff --git a/features.drush.inc b/features.drush.inc index fe02c51..7d6e6e9 100644 --- a/features.drush.inc +++ b/features.drush.inc @@ -107,6 +107,10 @@ function features_drush_help($section) { * Get a list of all feature modules. */ function drush_features_list() { + + // Set language temporarily to English + _features_set_original_language(); + module_load_include('inc', 'features', 'features.export'); $rows = array(array(dt('Name'), dt('Feature'), dt('Status'), dt('State'))); foreach (features_get_features(NULL, TRUE) as $k => $m) { @@ -136,6 +140,10 @@ function drush_features_list() { * Create a feature module based on a list of components. */ function drush_features_export() { + + // Set language temporarily to English + _features_set_original_language(); + $args = func_get_args(); if (count($args) == 1) { @@ -173,6 +181,10 @@ function drush_features_export() { * Update an existing feature module. */ function drush_features_update() { + + // Set language temporarily to English + _features_set_original_language(); + if ($args = func_get_args()) { foreach ($args as $module) { if (($feature = feature_load($module, TRUE)) && module_exists($module)) { @@ -201,6 +213,10 @@ function drush_features_update() { * exclude from being updated. */ function drush_features_update_all() { + + // Set language temporarily to English + _features_set_original_language(); + $features_to_update = array(); $features_to_exclude = func_get_args(); foreach (features_get_features() as $module) { @@ -228,6 +244,10 @@ function drush_features_update_all() { * Optional. The name for the exported module. */ function _drush_features_export($stub, $dependencies, $module_name = NULL, $directory = NULL) { + + // Set language temporarily to English + _features_set_original_language(); + $root = drush_get_option(array('r', 'root'), drush_locate_root()); if ($root) { $directory = isset($directory) ? $directory : 'sites/all/modules/' . $module_name; @@ -269,6 +289,10 @@ function _drush_features_export($stub, $dependencies, $module_name = NULL, $dire * Revert a feature to it's code definition. */ function drush_features_revert() { + + // Set language temporarily to English + _features_set_original_language(); + if ($args = func_get_args()) { module_load_include('inc', 'features', 'features.export'); features_include(); @@ -331,6 +355,10 @@ function drush_features_revert() { * a list of features to exclude from being reverted. */ function drush_features_revert_all() { + + // Set language temporarily to English + _features_set_original_language(); + $features_to_revert = array(); $features_to_exclude = func_get_args(); foreach (features_get_features() as $module) { @@ -353,6 +381,10 @@ function drush_features_revert_all() { * Show the diff of a feature module. */ function drush_features_diff() { + + // Set language temporarily to English + _features_set_original_language(); + if (!$args = func_get_args()) { drush_features_list(); return; diff --git a/features.module b/features.module index f85cf4c..434d2dc 100644 --- a/features.module +++ b/features.module @@ -726,6 +726,17 @@ function features_rebuild($rebuild = array()) { } /** + * Switch system language temporary to English + */ +function _features_set_original_language() { + global $language; + if ($language->language != 'en') { + $languages = language_list(); + $language = $languages['en']; + } +} + +/** * Utility functions ================================================== */