Revision: 6893
http://ipcop.svn.sourceforge.net/ipcop/?rev=6893&view=rev
Author: owes
Date: 2013-01-04 12:14:27 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
Test for existance of .mo file before changing locale.
Modified Paths:
--------------
ipcop/trunk/src/installer/setup.c
Modified: ipcop/trunk/src/installer/setup.c
===================================================================
--- ipcop/trunk/src/installer/setup.c 2013-01-04 11:37:22 UTC (rev 6892)
+++ ipcop/trunk/src/installer/setup.c 2013-01-04 12:14:27 UTC (rev 6893)
@@ -14,10 +14,9 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with IPCop; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with IPCop. If not, see <http://www.gnu.org/licenses/>.
*
- * (c) 2007-2009, the IPCop team
+ * (c) 2007-2013, the IPCop team
*
* Commandline options:
*
@@ -56,6 +55,7 @@
int rc;
int choice;
char *menuchoices[10];
+ char filename[STRING_SIZE];
/* check cmd line */
for (i = 1; i < argc; i++) {
@@ -99,6 +99,14 @@
read_kv_from_file(&kv, "/var/ipcop/main/settings");
strcpy(selected_locale, "en_GB");
find_kv_default(kv, "LOCALE", selected_locale);
+
+ /* Test if .mo exists */
+ snprintf(filename, STRING_SIZE,
"/usr/share/locale/%s/LC_MESSAGES/install.mo", selected_locale);
+ if (access(filename, 0) == -1) {
+ /* Translation does not exist, revert to English */
+ strcpy(selected_locale, "en_GB");
+ }
+
/* We store locale as en_GB not as en_GB.utf8 in settings
append .utf8 to make setlocale happy.
*/
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Ipcop-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipcop-svn