[PC-BSD Commits] r21879 - in pcbsd/current: src-qt4/pc-firstbootgui src-qt4/pc-installgui src-qt4/pc-xgui/resources/bin src-qt4/pc-xgui/resources/scripts src-sh/pc-firstgui src-sh/xtrafiles/local/share/pcbsd/scripts

svn at pcbsd.org svn at pcbsd.org
Sat Mar 16 01:28:16 PDT 2013


Author: kris
Date: 2013-03-16 08:28:16 +0000 (Sat, 16 Mar 2013)
New Revision: 21879

Modified:
   pcbsd/current/src-qt4/pc-firstbootgui/main.cpp
   pcbsd/current/src-qt4/pc-installgui/installer.cpp
   pcbsd/current/src-qt4/pc-xgui/resources/bin/rundetect.sh
   pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect
   pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check
   pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz
   pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed
   pcbsd/current/src-sh/pc-firstgui/pc-firstgui
   pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh
Log:

When we run installer in a non-english language, bring up the display wizard
and first boot GUI in the other language by default. 



Modified: pcbsd/current/src-qt4/pc-firstbootgui/main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-firstbootgui/main.cpp	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-qt4/pc-firstbootgui/main.cpp	2013-03-16 08:28:16 UTC (rev 21879)
@@ -32,6 +32,10 @@
       translator.load( QString("FirstBoot_") + langCode, appDir + "/i18n/" );
       a.installTranslator(&translator);
       qDebug() << "Loaded Translation:" << appDir + "/i18n/FirstBoot_" + langCode + ".qm";
+    } else if ( QFile::exists(appDir + "/i18n/FirstBoot_" + langCode.section("_", 0, 0) + ".qm" ) ) {
+      translator.load( QString("FirstBoot_") + langCode.section("_", 0, 0), appDir + "/i18n/" );
+      a.installTranslator(&translator);
+      qDebug() << "Loaded Translation:" << appDir + "/i18n/FirstBoot_" + langCode.section("_", 0, 0) + ".qm";
     } else {
       qDebug() << "Could not find: " << appDir + "/i18n/FirstBoot_" + langCode + ".qm";
       langCode = "";

Modified: pcbsd/current/src-qt4/pc-installgui/installer.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/installer.cpp	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-qt4/pc-installgui/installer.cpp	2013-03-16 08:28:16 UTC (rev 21879)
@@ -1038,8 +1038,14 @@
     // First mount /dev inside chroot
     cfgList << "runExtCommand=mount -t devfs devfs ${FSMNT}/dev";
 
+    QString lang;
+    if ( comboLanguage->currentIndex() != 0 )
+      lang = languages.at(comboLanguage->currentIndex());
+    else
+      lang="en_US";
+
     // Setup the desktop
-    cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh desktop";
+    cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh desktop " + lang;
 
     // Setup for a fresh system first boot
     cfgList << "# Touch flags to enable PC-BSD setup at first boot";

Modified: pcbsd/current/src-qt4/pc-xgui/resources/bin/rundetect.sh
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/bin/rundetect.sh	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-qt4/pc-xgui/resources/bin/rundetect.sh	2013-03-16 08:28:16 UTC (rev 21879)
@@ -17,12 +17,6 @@
 # Set the log file location
 XLOG="/tmp/xsetup.log" ; export XLOG
 
-# Source the language version
-if [ -e "/usr/local/share/pcbsd/conf/system-lang" ] ; then
-  LANG=`cat /usr/local/share/pcbsd/conf/system-lang`
-  export LANG
-fi
-
 # Program Directory
 PROGDIR="/usr/local/share/pcbsd/xorg-gui" ; export PROGDIR
 

Modified: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect	2013-03-16 08:28:16 UTC (rev 21879)
@@ -8,6 +8,12 @@
 then
 . /root/.xprofile
 fi
+
+# Setting a language
+if [ -e "/etc/pcbsd-lang" ] ; then
+   LANG=`cat /etc/pcbsd-lang`
+   export LANG
+fi
  
 touch ${XGUITMP}/.xstartupsuccess
 /usr/local/bin/startfluxbox &

Modified: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check	2013-03-16 08:28:16 UTC (rev 21879)
@@ -5,6 +5,12 @@
 . /root/.xprofile
 fi
 
+# Setting a language
+if [ -e "/etc/pcbsd-lang" ] ; then
+   LANG=`cat /etc/pcbsd-lang`
+   export LANG
+fi
+
 touch ${XGUITMP}/.xstartupsuccess
 /usr/local/bin/startfluxbox &
 PID=$!

Modified: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz	2013-03-16 08:28:16 UTC (rev 21879)
@@ -8,6 +8,12 @@
 then
 . /root/.xprofile
 fi
+
+# Setting a language
+if [ -e "/etc/pcbsd-lang" ] ; then
+   LANG=`cat /etc/pcbsd-lang`
+   export LANG
+fi
  
 touch ${XGUITMP}/.xstartupsuccess
 /usr/local/bin/startfluxbox &

Modified: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed	2013-03-16 08:28:16 UTC (rev 21879)
@@ -8,6 +8,12 @@
 then
 . /root/.xprofile
 fi
+
+# Setting a language
+if [ -e "/etc/pcbsd-lang" ] ; then
+   LANG=`cat /etc/pcbsd-lang`
+   export LANG
+fi
  
 touch ${XGUITMP}/.xstartupsuccess
 /usr/local/bin/startfluxbox &

Modified: pcbsd/current/src-sh/pc-firstgui/pc-firstgui
===================================================================
--- pcbsd/current/src-sh/pc-firstgui/pc-firstgui	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-sh/pc-firstgui/pc-firstgui	2013-03-16 08:28:16 UTC (rev 21879)
@@ -47,8 +47,17 @@
 # Play the video now
 mplayer -fs -nomouseinput -zoom /usr/local/share/pcbsd/movies/$mov
 
+# Setting a language
+if [ -e "/etc/pcbsd-lang" ] ; then
+   LANG=`cat /etc/pcbsd-lang`
+   export LANG
+fi
+
+# Start fluxbox
 /usr/local/bin/startfluxbox &
 PID=$!
+
+# Start first-boot wizard
 /usr/local/bin/pc-firstboot
 if [ $? -eq 0 ] ; then
   rm /var/.pcbsd-firstgui

Modified: pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh
===================================================================
--- pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh	2013-03-15 09:42:40 UTC (rev 21878)
+++ pcbsd/current/src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh	2013-03-16 08:28:16 UTC (rev 21879)
@@ -54,6 +54,11 @@
 
   # Init the desktop
   /usr/local/bin/pc-extractoverlay desktop --sysinit
+
+  # Need to save a language?
+  if [ -n "$2" ] ; then
+     echo "$2" > /etc/pcbsd-lang
+  fi
   exit $?
 fi
 



More information about the Commits mailing list