From: Jonny B. <jo...@ti...> - 2011-01-30 13:15:24
|
+1 (not tested personally but chealer said it was good, so voting on his behalf) On 30 Jan 2011, at 08:36, Stephane Casset wrote: > Le Sat, Jan 29, 2011 at 07:27:43PM +0000, ny...@us... écrivait : >> Revision: 32236 >> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=32236&view=rev >> Author: nyloth >> Date: 2011-01-29 19:27:42 +0000 (Sat, 29 Jan 2011) >> >> Log Message: >> ----------- >> [bp/r32235][FIX] HomePage content translation: When the HomePage has >> not been translated yet (by translating the special string >> '_HOMEPAGE_CONTENT_'), fallback to the 'en' translation. Also >> correctly set the language of the HomePage (to the language from prefs >> if the translation was available, or to 'en' if the fallback occured). > > +1 > >> Modified Paths: >> -------------- >> branches/proposals/6.x/lib/setup/wiki.php >> >> Modified: branches/proposals/6.x/lib/setup/wiki.php >> =================================================================== >> --- branches/proposals/6.x/lib/setup/wiki.php 2011-01-29 19:25:32 UTC (rev 32235) >> +++ branches/proposals/6.x/lib/setup/wiki.php 2011-01-29 19:27:42 UTC (rev 32236) >> @@ -67,7 +67,21 @@ >> >> } >> >> + // If the HomePage does not exist, create it >> if ($check && !$tikilib->page_exists($_REQUEST['page'])) { >> - $tikilib->create_page($_REQUEST['page'], 0,tra('_HOMEPAGE_CONTENT_'),$tikilib->now,'Tiki initialization', 'admin', '0.0.0.0', '', 'en', false, null, 'n', ''); >> + >> + // Get the translated HomePage content >> + $homePageLang = $prefs['language']; >> + $homePageTranslationKey = '_HOMEPAGE_CONTENT_'; >> + $translatedHomePageContent = tra( $homePageTranslationKey ); >> + >> + // If the HomePage has not been translated yet, fallback to the 'en' translation >> + if ( $translatedHomePageContent == $homePageTranslationKey ) { >> + $homePageLang = 'en'; >> + $translatedHomePageContent = tra( $homePageTranslationKey, $homePageLang ); >> + } >> + >> + $tikilib->create_page( $_REQUEST['page'], 0, $translatedHomePageContent, $tikilib->now, 'Tiki initialization', 'admin', '0.0.0.0', '', $homePageLang, false, null, 'n', '' ); >> + unset( $homePageTranslationKey, $translatedHomePageContent, $homePageLang ); >> } >> } >> >> > > A+ > -- > Stéphane Casset LOGIDÉE sàrl Se faire plaisir d'apprendre > 1a, rue Pasteur Tel : +33 388 23 69 77 ca...@lo... > F-67540 OSTWALD Fax : +33 388 23 69 77 http://logidee.com > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs |