Index: trunk/api.wordpress.org/public_html/translations/lib.php
===================================================================
--- trunk/api.wordpress.org/public_html/translations/lib.php	(revision 1706)
+++ trunk/api.wordpress.org/public_html/translations/lib.php	(working copy)
@@ -51,6 +51,22 @@
 	}
 
 	require_once WPORGPATH . 'translate/glotpress/locales/locales.php';
+	// Add some language variants to locales until GlotPress supports them.
+	$GLOBALS['gp_locales'] = new GP_Locales;
+	$de_formal = clone GP_Locales::by_field( 'wp_locale', 'de_DE' );
+	$de_formal->english_name = 'German (Formal)';
+	$de_formal->native_name = 'Deutsch (Sie)';
+	$de_formal->slug = 'de/formal';
+	$de_formal->wp_locale = 'de_DE_formal';
+	$GLOBALS['gp_locales']->locales['de/formal'] = $de_formal;
+
+	$pt_informal = clone GP_Locales::by_field( 'wp_locale', 'pt_PT' );
+	$pt_informal->english_name = 'Portuguese (Portugal/Informal)';
+	$pt_informal->native_name = 'Português (informal)';
+	$pt_informal->slug = 'pt/informal';
+	$pt_informal->wp_locale = 'pt_PT_informal';
+	$GLOBALS['gp_locales']->locales['pt/formal'] = $pt_informal;
+
 	$base_url = is_ssl() ? 'https' : 'http';
 	$base_url .= '://downloads.wordpress.org/translation/';
 	$base_url .= ( $type == 'core' ) ? 'core' : "$type/$domain";
@@ -61,12 +77,13 @@
 		if ( ! $continue_translations ) {
 			// Magic numbers: 78 is wp/dev/admin. 326 is 'Continue'.
 			$continue_translations = $wpdb->get_results(
-				"SELECT locale as gp_locale, translation_0 as translation
+				"SELECT
+					IF(ts.slug <> 'default', CONCAT(ts.locale, '/', ts.slug), ts.locale) as gp_locale,
+					translation_0 as translation
 				FROM translate_translation_sets ts
 				INNER JOIN translate_translations t
 				ON ts.id = t.translation_set_id
 				WHERE project_id = 78
-				AND slug = 'default'
 				AND original_id = 326", OBJECT_K
 			);
 			wp_cache_add( 'continue-strings', $continue_translations, $cache_group, $cache_time );
@@ -246,4 +263,3 @@
 
 	return $translations;
 }
-
