source: ogBrowser-Git/src/main.cpp @ 1b0403f

jenkinsmain
Last change on this file since 1b0403f was 6fd35b6, checked in by ramon <ramongomez@…>, 9 years ago

#244: Copiar ficheros de idiomas a la localización correcta y nuevo Browser con todas las cadenas preparadas.

git-svn-id: https://opengnsys.es/svn/branches/version1.1@4915 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 891 bytes
RevLine 
[050d67a]1#include <QtGui/QApplication>
2#include <stdio.h>
[3648efe]3#include "mainwindow.h"
[553385e]4#include <Qt/qtextcodec.h>
[1ed6e72]5// Internacionalización con GNU Gettext.
6#include <libintl.h>
[6fd35b6]7#define TEXTDOMAIN "browser"
8#define LOCALEDIR "/opt/opengnsys/lib/locale"
9#define CHARSET "UTF-8"
[050d67a]10
11int main(int argc, char *argv[])
12{
[1ed6e72]13    // Preparar internacionalización.
14    setlocale (LC_ALL, "");
[6fd35b6]15    bindtextdomain (TEXTDOMAIN, LOCALEDIR);
16    textdomain (TEXTDOMAIN);
[1ed6e72]17
[3648efe]18    if(argc<=1)
19    {
[1ed6e72]20        printf(gettext("Uso: %s -qws http://sitioweb.com/\n"),argv[0]);
[3648efe]21        return -1;
22    }
[6fd35b6]23    // Codificación de caracteres.
24    QTextCodec::setCodecForTr(QTextCodec::codecForName(CHARSET));
25    QTextCodec::setCodecForCStrings(QTextCodec::codecForName(CHARSET));
26    QTextCodec::setCodecForLocale(QTextCodec::codecForName(CHARSET));
[1fc67a0]27 
[3648efe]28    QApplication a(argc, argv);
29    MainWindow w;
30    w.show();
31    return a.exec();
[050d67a]32}
Note: See TracBrowser for help on using the repository browser.