Index: pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/pages.inc,v
retrieving revision 1.1.2.19
diff -u -r1.1.2.19 pages.inc
--- pages.inc 28 Dec 2007 16:40:12 -0000 1.1.2.19
+++ pages.inc 11 Mar 2008 12:31:40 -0000
@@ -23,6 +23,12 @@
return '';
}
+ // If there is only one language then redirect to that language page
+ if (count($languages) == 1) {
+ list($language_code, $language_name) = each($languages);
+ drupal_goto('translate/languages/' . $language_code);
+ }
+
// Generate listing of all languages with summaries. The list of languages
// is relatively "short", compared to projects, so we don't need a pager here.
$groups = array();
Index: welcome.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/welcome.inc,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 welcome.inc
--- welcome.inc 28 Dec 2007 16:40:12 -0000 1.1.2.6
+++ welcome.inc 11 Mar 2008 08:43:40 -0000
@@ -99,16 +99,25 @@
$form['dummy'] = array('#type' => 'markup', '#value' => t('No languages defined or no projects scanned yet.'));
return $form;
}
-
- $form['langcode'] = array(
- // For three or less languages, display radio buttons.
- '#type' => (count($languages) <= 3) ? 'radios' : 'select',
- '#title' => t('Pick a language'),
- '#options' => array('' => t('All')) + l10n_community_get_languages('name'),
- '#description' => t('Alternatively you can explore languages.', array('@explore' => url('translate/languages')))
- );
+
+ if (count($languages) > 1) {
+ $form['langcode'] = array(
+ // For three or less languages, display radio buttons.
+ '#type' => (count($languages) <= 3) ? 'radios' : 'select',
+ '#title' => t('Pick a language'),
+ '#options' => array('' => t('All')) + l10n_community_get_languages('name'),
+ '#description' => t('Alternatively you can explore languages.', array('@explore' => url('translate/languages')))
+ );
+ }
+ else {
+ list($language_code, $language_name) = each($languages);
+ $form['langcode'] = array(
+ '#type' => 'value',
+ '#value' => $language_code
+ );
+ }
$form['project'] = array(
- '#title' => t('And/or pick a project'),
+ '#title' => (count($languages) > 1) ? t('And/or pick a project') : t('Pick a project for @lang translation', array('@lang' => $language_name)),
'#description' => t('Alternatively you can explore projects.', array('@explore' => url('translate/projects')))
);
if (($count = count($projects)) <= 30) {