Modification dans le changement du traitement des langues

master
Ulrich Van Den Hekke 12 years ago
parent 8084b9d6d5
commit 52f089aeaa

@ -1,3 +1,4 @@
set(LANGUAGES fr en bg)
set(CMAKE_C_FLAGS "-frtti -fexceptions -Wall")
set(CMAKE_CXX_FLAGS "-frtti -fexceptions -Wall") # -Wold-style-cast") # -Woverloaded-virtual")
@ -48,7 +49,7 @@ macro(xinx_automoc outfiles)
endforeach(it)
endmacro(xinx_automoc)
macro(initialisation_xinx)
macro(initialisation_xinx cible)
unset(LIBRARIES)
include(${QT_USE_FILE})
@ -102,7 +103,15 @@ macro(initialisation_xinx)
file(GLOB_RECURSE sources *.cpp ${UNIQUE_APPPLICATION_SOURCES} ${SOAP_SOURCES})
file(GLOB_RECURSE forms *.ui)
file(GLOB_RECURSE resources *.qrc)
file(GLOB_RECURSE translations *.ts)
file(GLOB_RECURSE other_translations *.ts)
if(${GENTRANSLATION})
set(translations)
foreach(language ${LANGUAGES})
set(translations ${translations} "translations/${cible}_${language}.ts")
endforeach(language ${LANGUAGES})
list(REMOVE_ITEM other_translations ${translations})
endif()
if(WIN32)
file(GLOB_RECURSE winresources *.rc)
@ -110,17 +119,21 @@ macro(initialisation_xinx)
#set_source_files_properties(${translations} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/translations")
set_source_files_properties(${translations} PROPERTIES OUTPUT_LOCATION "${CMAKE_BINARY_DIR}/i18n")
set_source_files_properties(${other_translations} PROPERTIES OUTPUT_LOCATION "${CMAKE_BINARY_DIR}/i18n")
qt4_wrap_ui(generated_forms ${forms})
xinx_automoc(moc_headers ${headers} OPTIONS ${MOC_FRAMEWORK})
qt4_add_resources(generated_resources ${resources})
#qt4_create_translation(translations_qm ${forms} ${headers} ${sources} ${translations})
qt4_add_translation(translations_qm ${translations})
if(${GENTRANSLATION})
qt4_create_translation(translations_qm ${forms} ${headers} ${sources} ${translations})
endif()
qt4_add_translation(other_translations_qm ${other_translations})
endmacro(initialisation_xinx)
macro(add_xinx_executable cible librairies)
initialisation_xinx()
initialisation_xinx(${cible})
add_executable(${cible} WIN32 ${moc_headers} ${sources} ${winresources} ${generated_forms} ${generated_resources} ${translations_qm})
target_link_libraries(${cible} ${librairies} ${LIBRARIES} ${QT_LIBRARIES})
@ -129,7 +142,7 @@ macro(add_xinx_executable cible librairies)
endmacro(add_xinx_executable)
macro(add_xinx_librairie cible librairies version)
initialisation_xinx()
initialisation_xinx(${cible})
#if(WIN32)
# if(MINGW)
@ -150,7 +163,7 @@ macro(add_xinx_plugins cible is_shared librairies version)
set(IS_PLUGINS True)
set(IS_SHARED ${is_shared})
initialisation_xinx()
initialisation_xinx(${cible})
if(${IS_SHARED})
add_library(${cible} MODULE ${moc_headers} ${sources} ${winresources} ${generated_forms} ${generated_resources} ${translations_qm} )

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="bg_BG">
<context>
<name>CustomScheme</name>
<message>
<location filename="../ui/customscheme.ui" line="13"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="40"/>
<source>&amp;Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="46"/>
<source>&amp;Bold</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="53"/>
<source>&amp;Overline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="60"/>
<source>&amp;Strikeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="67"/>
<source>&amp;Italic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="74"/>
<source>&amp;Underline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="84"/>
<source>&amp;WaveUnderline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="100"/>
<source>&amp;Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="106"/>
<source>&amp;Foreground</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="119"/>
<source>&amp;Background</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="135"/>
<source>&amp;Example</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DirectoryEdit</name>
<message>
<location filename="../directoryedit.cpp" line="388"/>
<source>Change the path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../directoryedit.cpp" line="390"/>
<location filename="../directoryedit.cpp" line="392"/>
<source>Change the file</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PluginDelegate</name>
<message>
<location filename="../pluginselector.cpp" line="329"/>
<source>About ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../pluginselector.cpp" line="341"/>
<source>Configure ...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../xinxcolorcombo.cpp" line="59"/>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="61"/>
<source>Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="63"/>
<source>Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="65"/>
<source>Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="67"/>
<source>Cyan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="69"/>
<source>Magenta</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="71"/>
<source>Yellow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="73"/>
<source>Dark Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="75"/>
<source>Dark Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="77"/>
<source>Dark Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="79"/>
<source>Dark Cyan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="81"/>
<source>Dark Magenta</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="83"/>
<source>Dark Yellow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="85"/>
<source>White</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="87"/>
<source>Light Gray</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="89"/>
<source>Gray</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="91"/>
<source>Dark Gray</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="93"/>
<source>Black</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>XinxColorComboPrivate</name>
<message>
<location filename="../xinxcolorcombo.cpp" line="184"/>
<source>Custom...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>XinxDirectoryListWidget</name>
<message>
<location filename="../xinxdirectorylistwidget.cpp" line="37"/>
<source>Get a directory</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>XinxListWidget</name>
<message>
<location filename="../ui/xinxlistwidget.ui" line="40"/>
<source>&amp;Add</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/xinxlistwidget.ui" line="51"/>
<source>&amp;Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/xinxlistwidget.ui" line="62"/>
<source>&amp;Default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/xinxlistwidget.ui" line="86"/>
<source>Move &amp;Up</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/xinxlistwidget.ui" line="97"/>
<source>Move &amp;Down</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en_US">
<context>
<name>CustomScheme</name>
<message>
<location filename="../ui/customscheme.ui" line="13"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="40"/>
<source>&amp;Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="46"/>
<source>&amp;Bold</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="53"/>
<source>&amp;Overline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="60"/>
<source>&amp;Strikeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="67"/>
<source>&amp;Italic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="74"/>
<source>&amp;Underline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="84"/>
<source>&amp;WaveUnderline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="100"/>
<source>&amp;Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="106"/>
<source>&amp;Foreground</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="119"/>
<source>&amp;Background</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/customscheme.ui" line="135"/>
<source>&amp;Example</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DirectoryEdit</name>
<message>
<location filename="../directoryedit.cpp" line="388"/>
<source>Change the path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../directoryedit.cpp" line="390"/>
<location filename="../directoryedit.cpp" line="392"/>
<source>Change the file</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PluginDelegate</name>
<message>
<location filename="../pluginselector.cpp" line="329"/>
<source>About ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../pluginselector.cpp" line="341"/>
<source>Configure ...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../xinxcolorcombo.cpp" line="59"/>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="61"/>
<source>Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="63"/>
<source>Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="65"/>
<source>Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="67"/>
<source>Cyan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="69"/>
<source>Magenta</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="71"/>
<source>Yellow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="73"/>
<source>Dark Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="75"/>
<source>Dark Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="77"/>
<source>Dark Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="79"/>
<source>Dark Cyan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="81"/>
<source>Dark Magenta</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="83"/>
<source>Dark Yellow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="85"/>
<source>White</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="87"/>
<source>Light Gray</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="89"/>
<source>Gray</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="91"/>
<source>Dark Gray</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../xinxcolorcombo.cpp" line="93"/>
<source>Black</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>XinxColorComboPrivate</name>
<message>
<location filename="../xinxcolorcombo.cpp" line="184"/>
<source>Custom...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>XinxDirectoryListWidget</name>
<message>
<location filename="../xinxdirectorylistwidget.cpp" line="37"/>
<source>Get a directory</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>XinxListWidget</name>
<message>
<location filename="../ui/xinxlistwidget.ui" line="40"/>
<source>&amp;Add</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/xinxlistwidget.ui" line="51"/>
<source>&amp;Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/xinxlistwidget.ui" line="62"/>
<source>&amp;Default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/xinxlistwidget.ui" line="86"/>
<source>Move &amp;Up</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/xinxlistwidget.ui" line="97"/>
<source>Move &amp;Down</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

@ -21,6 +21,7 @@
#include "customgeneralimpl.h"
#include <core/xinxconfig.h>
#include <directoryedit.h>
#include <translations/translationmanager.h>
// Qt header
#include <QStyleFactory>
@ -64,10 +65,17 @@ QWidget * CustomGeneralImpl::settingsDialog()
bool CustomGeneralImpl::loadSettingsDialog()
{
// Language
m_langComboBox->clear();
m_langComboBox->addItem("C", "C");
m_langComboBox->setCurrentIndex(0);
foreach(TranslationManager::Language l, TranslationManager::self()->languages())
{
m_langComboBox->addItem(QIcon(l.image), QString("(%1) %2").arg(l.code).arg(l.name), l.code);
}
for (int i = 0; i < m_langComboBox->count(); i++)
{
if (m_langComboBox->itemText(i).contains(QString("(%1)").arg(XINXConfig::self()->config().language)))
if (m_langComboBox->itemData(i).toString() == XINXConfig::self()->config().language)
{
m_langComboBox->setCurrentIndex(i);
break;
@ -87,9 +95,7 @@ bool CustomGeneralImpl::loadSettingsDialog()
bool CustomGeneralImpl::saveSettingsDialog()
{
// Language
QRegExp exp("^\\((.*)\\).*$");
if (exp.indexIn(m_langComboBox->currentText()) >= 0)
XINXConfig::self()->config().language = exp.cap(1);
XINXConfig::self()->config().language = m_langComboBox->itemData(m_langComboBox->currentIndex()).toString();
// Trace Log File
XINXConfig::self()->config().xinxTrace = QDir::fromNativeSeparators(m_traceLogWidget->lineEdit()->text());

@ -1,120 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CustomGeneral</class>
<widget class="QWidget" name="CustomGeneral">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>598</width>
<height>195</height>
</rect>
</property>
<property name="windowTitle">
<string>General</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Language :</string>
</property>
<property name="buddy">
<cstring>m_langComboBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="m_langComboBox">
<property name="whatsThis">
<string>&lt;p&gt;Langue in which &lt;b&gt;XINX&lt;/b&gt; must be used.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Modification take effect at restart.&lt;/i&gt;&lt;/p&gt;</string>
</property>
<item>
<property name="text">
<string>(en) English</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/usa.png</normaloff>:/images/usa.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>(fr_FR) French</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/france.png</normaloff>:/images/france.png</iconset>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>&amp;Trace Log File :</string>
</property>
<property name="buddy">
<cstring>m_traceLogWidget</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="DirectoryEditWidget" name="m_traceLogWidget" native="true">
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="directory" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Force current &amp;style :</string>
</property>
<property name="buddy">
<cstring>m_styleComboBox</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="m_styleComboBox"/>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>DirectoryEditWidget</class>
<extends>QWidget</extends>
<header>directoryeditwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../../components/xinxpluginselector.qrc"/>
<include location="../../application.qrc"/>
</resources>
<connections/>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CustomGeneral</class>
<widget class="QWidget" name="CustomGeneral">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>598</width>
<height>195</height>
</rect>
</property>
<property name="windowTitle">
<string>General</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Language :</string>
</property>
<property name="buddy">
<cstring>m_langComboBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="m_langComboBox">
<property name="whatsThis">
<string>&lt;p&gt;Langue in which &lt;b&gt;XINX&lt;/b&gt; must be used.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Modification take effect at restart.&lt;/i&gt;&lt;/p&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>&amp;Trace Log File :</string>
</property>
<property name="buddy">
<cstring>m_traceLogWidget</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="DirectoryEditWidget" name="m_traceLogWidget" native="true">
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="directory" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Force current &amp;style :</string>
</property>
<property name="buddy">
<cstring>m_styleComboBox</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="m_styleComboBox"/>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>DirectoryEditWidget</class>
<extends>QWidget</extends>
<header>directoryeditwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

@ -19,6 +19,10 @@
// Xinx header
#include "core/xinxcore.h"
#include <QString>
#include <QDesktopServices>
#include <QDir>
#include <QApplication>
/* XINXStaticDeleter */
@ -44,4 +48,64 @@ XINXStaticDeleter * XINXStaticDeleter::self()
return s_self;
}
void initSearchPath(QApplication * app)
{
const QString configDirectory = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
const QString homeDirectory = QDir::home().absoluteFilePath(configDirectory);
const QString i18nDirectory = QDir(homeDirectory).absoluteFilePath("i18n");
const QString datasDirectory = QDir(homeDirectory).absoluteFilePath("datas");
const QString scriptDirectory = QDir(homeDirectory).absoluteFilePath("scripts");
const QString pluginsDirectory = QDir(homeDirectory).absoluteFilePath("plugins");
const QString templatesDirectory = QDir(homeDirectory).absoluteFilePath("templates");
QDir::home().mkpath(datasDirectory);
QDir::home().mkpath(scriptDirectory);
QDir::home().mkpath(pluginsDirectory);
QDir::home().mkpath(templatesDirectory);
// .. for i18n ...
QDir::addSearchPath("translations", i18nDirectory);
QDir::addSearchPath("translations", QDir(QApplication::applicationDirPath()).absoluteFilePath("../i18n"));
#ifndef Q_WS_WIN
QDir::addSearchPath("translations", QDir(QApplication::applicationDirPath()).absoluteFilePath("../share/xinx/i18n"));
QDir::addSearchPath("translations", QDir(QApplication::applicationDirPath()).absoluteFilePath("../lib/xinx/i18n"));
#endif // Q_WS_WIN
// .. for datas ...
QDir::addSearchPath("datas", datasDirectory);
QDir::addSearchPath("datas", QDir(QApplication::applicationDirPath()).absoluteFilePath("../datas"));
#ifndef Q_WS_WIN
QDir::addSearchPath("datas", QDir(QApplication::applicationDirPath()).absoluteFilePath("../share/xinx/datas"));
QDir::addSearchPath("datas", QDir(QApplication::applicationDirPath()).absoluteFilePath("../lib/xinx/datas"));
#endif // Q_WS_WIN
// ... for scripts ...
QDir::addSearchPath("scripts", scriptDirectory);
QDir::addSearchPath("scripts", QDir(QApplication::applicationDirPath()).absoluteFilePath("../scripts"));
#ifndef Q_WS_WIN
QDir::addSearchPath("scripts", QDir(QApplication::applicationDirPath()).absoluteFilePath("../share/xinx/scripts"));
QDir::addSearchPath("scripts", QDir(QApplication::applicationDirPath()).absoluteFilePath("../lib/xinx/scripts"));
#endif // Q_WS_WIN
// ... for plugins ...
QDir::addSearchPath("plugins", pluginsDirectory);
QDir::addSearchPath("plugins", QDir(QApplication::applicationDirPath()).absoluteFilePath("../plugins"));
#ifndef Q_WS_WIN
QDir::addSearchPath("plugins", QDir(QApplication::applicationDirPath()).absoluteFilePath("../share/xinx/plugins"));
QDir::addSearchPath("plugins", QDir(QApplication::applicationDirPath()).absoluteFilePath("../lib/xinx/plugins"));
#endif // Q_WS_WIN
foreach(const QString & searchPath, QDir::searchPaths("plugins"))
{
app->addLibraryPath(searchPath);
}
// ... for tempalte ...
QDir::addSearchPath("templates", templatesDirectory);
QDir::addSearchPath("templates", QDir(QApplication::applicationDirPath()).absoluteFilePath("../templates"));
#ifndef Q_WS_WIN
QDir::addSearchPath("templates", QDir(QApplication::applicationDirPath()).absoluteFilePath("../share/xinx/templates"));
QDir::addSearchPath("templates", QDir(QApplication::applicationDirPath()).absoluteFilePath("../lib/xinx/templates"));
#endif // Q_WS_WIN
}

@ -28,6 +28,8 @@
#include <QObject>
#include <QObjectCleanupHandler>
class QApplication;
/*!
* \mainpage XINX Library
*
@ -118,5 +120,6 @@ inline void qDeleteAllLater(const Container &c)
qDeleteAllLater(c.begin(), c.end());
}
LIBEXPORT void initSearchPath(QApplication * app);
#endif // __XINXCORE_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,950 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fr_FR">
<context>
<name>AbstractEditor</name>
<message>
<location filename="../editors/abstracteditor.cpp" line="164"/>
<source>&amp;Undo</source>
<translation>&amp;Défaire</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="168"/>
<source>&amp;Redo</source>
<translation>&amp;Refaire</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="173"/>
<source>&amp;Cut</source>
<translation>Co&amp;uper</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="177"/>
<source>C&amp;opy</source>
<translation>Cop&amp;ier</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="181"/>
<source>&amp;Paste</source>
<translation>Co&amp;ller</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="480"/>
<source>Can&apos;t open file for reading %1 : %2</source>
<translation>Ne peut pas ouvrir le fichier en lecture %1 : %2</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="537"/>
<source>Can&apos;t open file for writing %1 : %2</source>
<translation>Ne peut pas ouvrir le fichier en écriture %1 : %2</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="732"/>
<location filename="../editors/abstracteditor.cpp" line="739"/>
<source>Reload page</source>
<translation>Actualiser</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="732"/>
<source>The file %1 was modified. Reload the page ?</source>
<translation>Le fichier %1 a été modifié. Recharger la page ?</translation>
</message>
<message>
<location filename="../editors/abstracteditor.cpp" line="739"/>
<source>The file %1 was removed.</source>
<translation>Le fichier %1 a été supprimé.</translation>
</message>
</context>
<context>
<name>BaseSnipetItemModel</name>
<message>
<location filename="../snipets/basesnipetitemmodel.cpp" line="161"/>
<source>Id</source>
<translation>Id</translation>
</message>
<message>
<location filename="../snipets/basesnipetitemmodel.cpp" line="162"/>
<source>Parent</source>
<translation>Parent</translation>
</message>
<message>
<location filename="../snipets/basesnipetitemmodel.cpp" line="163"/>
<source>Icon</source>
<translation>Icône</translation>
</message>
<message>
<location filename="../snipets/basesnipetitemmodel.cpp" line="164"/>
<source>Name</source>
<translation>Nom</translation>
</message>
<message>
<location filename="../snipets/basesnipetitemmodel.cpp" line="165"/>
<source>Description</source>
<translation>Description</translation>
</message>
<message>
<location filename="../snipets/basesnipetitemmodel.cpp" line="166"/>
<source>Shortcut</source>
<translation>Raccourci</translation>
</message>
<message>
<location filename="../snipets/basesnipetitemmodel.cpp" line="167"/>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<location filename="../snipets/basesnipetitemmodel.cpp" line="168"/>
<source>Available Script</source>
<translation>Script de disponibilité</translation>
</message>
</context>
<context>
<name>BookmarkTextEditorInterface</name>
<message>
<location filename="../editors/bookmarktexteditorinterface.cpp" line="102"/>
<source>In editor &apos;%1&apos; at line %2</source>
<translation>Dans l&apos;éditeur &apos;%1&apos; à la ligne %2</translation>
</message>
</context>
<context>
<name>CallSnipetDialog</name>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="14"/>
<source>Use the snipet &quot;%1&quot;</source>
<translation>Utiliser le modèle &quot;%1&quot;</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="30"/>
<source>&amp;Information</source>
<translation>&amp;Information</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="36"/>
<source>Description</source>
<translation>Description</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="48"/>
<source>&lt;b&gt;This is the name&lt;/b&gt;</source>
<translation>&lt;b&gt;Ceci est le nom&lt;/b&gt;</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="55"/>
<source>This is a long description of the template. This description explains how or in which cases to use the template or all the possible parameters.</source>
<translation>Ceci est la longue description du modèle. Cette description explique comment ou dans quel cas utiliser le modèle ou les paramètres possibles.</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="68"/>
<source>Parameters</source>
<translation>Paramètres</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="80"/>
<source>You are about to &lt;b&gt;replace&lt;/b&gt; the last word of the text you just wrote by the text of the template. If this dialog is showed, the snipet is configured to be called manually and requires that all parameters have a default value.&lt;br/&gt;
If you prefer the snipet to be called automatically in the future, please change the property in the custom dialog.&lt;br/&gt;
&lt;br/&gt;
Please check parameters below and &lt;i&gt;valid&lt;/i&gt; this form if you agree.</source>
<translation>Vous êtes sur le point de &lt;b&gt;remplacer&lt;/b&gt; le dernier mot du texte que vous êtes entrain d&apos;écrire, par celui de modèle. Si cette boite de dialogue s&apos;est ouverte, le modèle est configuré pour être appelé automatiquement et nécessite que tous les paramètres aient une valeur par défaut.&lt;br/&gt;
Si vous préférez que le modèle soit appelé automatiquement par la suite, veuillez changer les propriétés dans la boite de dialogue de personnalisation.&lt;br/&gt;
&lt;br/&gt;
Veuillez vérifier les paramètres ci-dessous et &lt;i&gt;validez&lt;/i&gt; ce formulaire si vous êtes d&apos;accord.</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="100"/>
<source>Name</source>
<translation>Nom</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="105"/>
<source>Value</source>
<translation>Valeur</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.ui" line="117"/>
<location filename="../snipets/callsnipetdlg.ui" line="123"/>
<source>&amp;Result</source>
<translation>&amp;Résultat</translation>
</message>
</context>
<context>
<name>CallSnipetDialogImpl</name>
<message>
<location filename="../snipets/callsnipetdlg.cpp" line="201"/>
<source>Cannot execute the snipet. Please check the script in the snipet in configuration dialog.</source>
<translation>Ne peut exécuter ce modèle. Veuillez verifier le script du modèle dans la boite de dialogue de configuration.</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.cpp" line="218"/>
<source>CallSnipetDialogImpl: Can&apos;t find snipet id &apos;%1&apos;</source>
<translation>CallSnipetDialogImpl: Ne peut trouver l&apos;id du modèle &apos;%1&apos;</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.cpp" line="222"/>
<source>Use the snipet &quot;%1&quot;</source>
<translation>Utiliser le modèle &quot;%1&quot;</translation>
</message>
<message>
<location filename="../snipets/callsnipetdlg.cpp" line="244"/>
<source>Parameter %1</source>
<translation>Paramètre %1</translation>
</message>
</context>
<context>
<name>CategoryItemModel</name>
<message>
<location filename="../snipets/categoryitemmodel.cpp" line="92"/>
<source>Id</source>
<translation>Id</translation>
</message>
<message>
<location filename="../snipets/categoryitemmodel.cpp" line="93"/>
<source>Parent</source>
<translation>Parent</translation>
</message>
<message>
<location filename="../snipets/categoryitemmodel.cpp" line="94"/>
<source>Name</source>
<translation>Nom</translation>
</message>
</context>
<context>
<name>CategoryPropertyDialog</name>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="14"/>
<source>Category property</source>
<translation>Propriété de la catégorie</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="31"/>
<location filename="../snipets/categorypropertydlg.ui" line="37"/>
<source>&amp;Description</source>
<translation>&amp;Description</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="46"/>
<source>&amp;Name :</source>
<translation>&amp;Nom :</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="56"/>
<source>Name of the snipet used to identify it in the menus.</source>
<translation>Nom du modèle utilisé pour l&apos;identifier dans les menus.</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="63"/>
<source>&amp;Description :</source>
<translation>&amp;Description :</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="88"/>
<source>Long description of the snipet.</source>
<translation>Longue description du modèle.</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="99"/>
<source>&amp;Category</source>
<translation>&amp;Catégorie</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="105"/>
<source>Category</source>
<translation>Catégorie</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="121"/>
<source>&amp;Remove Category</source>
<translation>&amp;Suppression de la catégorie</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="132"/>
<source>&amp;Add Category</source>
<translation>&amp;Ajout une catégorie</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="160"/>
<source>&amp;Control</source>
<translation>&amp;Contrôle</translation>
</message>
<message>
<location filename="../snipets/categorypropertydlg.ui" line="166"/>
<source>&amp;Condition to enable the snipet</source>
<translation>&amp;Conditions pour activer le modèle</translation>
</message>
</context>
<context>
<name>CommitMessageDialog</name>
<message>
<location filename="../rcs/commitmessages.ui" line="14"/>
<source>Commit messages</source>
<translation>Messages de validation</translation>
</message>
<message>
<location filename="../rcs/commitmessages.ui" line="26"/>
<source>RCS Messages</source>
<translation>Messages du système de gestion de version</translation>
</message>
<message>
<location filename="../rcs/commitmessages.ui" line="38"/>
<source>&lt;p&gt;Please type your message in this box. The message will be used with your revision control manager.&lt;/p&gt;
&lt;p/&gt;
&lt;p&gt;This message must describe what you have done, to easily find an old version.&lt;/p&gt;
&lt;p/&gt;
&lt;p&gt;&lt;i&gt;With CVS, the list of file commited is appended to the message&lt;/i&gt;&lt;/p&gt;</source>
<translation>&lt;p&gt;Veuillez écrire votre message dans cette boîte de dialogue. Le message sera utilisé par votre gestionnaire de version&lt;/p&gt;
&lt;p/&gt;
&lt;p&gt;Ce message devrait décrire ce que vous avez fait, pour retrouver facilement une ancienne version.&lt;/p&gt;
&lt;p/&gt;
&lt;p&gt;&lt;i&gt;Avec CVS, la liste des fichiers validés est ajoutée à la fin du message&lt;/i&gt;&lt;/p&gt;</translation>
</message>
<message>
<location filename="../rcs/commitmessages.ui" line="52"/>
<source>Files to commit</source>
<translation>Fichiers à valider</translation>
</message>
<message>
<location filename="../rcs/commitmessages.ui" line="64"/>
<source>This is the list of the file to commit. Only files, known by &lt;b&gt;XINX&lt;/b&gt; are listed here (&lt;i&gt;.xsl, .html, .css, .js, ...&lt;/i&gt;).&lt;br/&gt;
In the list &lt;b&gt;XINX&lt;/b&gt; presents three actions :
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Add and Commit&lt;/i&gt; : If the file doesn&apos;t exist in the repository but may be commited.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Remove and Commit&lt;/i&gt; : If the file is deleted from the disk but not from the repository&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Commit&lt;/i&gt; : If the file exists and is modified (checked by default).&lt;/li&gt;
&lt;/ul&gt;
Only checked files are commited.</source>
<translation>Cette liste contient les documents à valider. Seuls les fichiers connus par &lt;b&gt;XINX&lt;/b&gt; sont listés ici (&lt;i&gt;.xsl, .html, .css, .js, ...&lt;/i&gt;).&lt;br/&gt;
Dans cette liste&lt;b&gt;XINX&lt;/b&gt; permet trois actions :
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Ajouter et Valider&lt;/i&gt; : Si le fichier n&apos;existe pas dans le réferenciel mais peut être validé&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Supprimer et Valider&lt;/i&gt; : Si le fichier est supprimé du disque mais pas du référenciel&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Valider&lt;/i&gt; : Si le fichier existe et est modifié (coché par défaut).&lt;/li&gt;
&lt;/ul&gt;
Seuls les fichiers cochés seront validés.</translation>
</message>
</context>
<context>
<name>CommitMessageDialogImpl</name>
<message>
<location filename="../rcs/commitmessagedialogimpl.cpp" line="128"/>
<source> ( Commit )</source>
<translation> ( Valider )</translation>
</message>
<message>
<location filename="../rcs/commitmessagedialogimpl.cpp" line="131"/>
<source> ( Add and Commit )</source>
<translation> ( Ajouter et Valider )</translation>
</message>
<message>
<location filename="../rcs/commitmessagedialogimpl.cpp" line="134"/>
<source> ( Remove and Commit )</source>
<translation> ( Supprimer et Valider )</translation>
</message>
<message>
<location filename="../rcs/commitmessagedialogimpl.cpp" line="179"/>
<source>Commit</source>
<translation>Valider</translation>
</message>
<message>
<location filename="../rcs/commitmessagedialogimpl.cpp" line="179"/>
<source>Nothing to do.</source>
<translation>Il n&apos;y a aucun fichier à valider.</translation>
</message>
</context>
<context>
<name>ContentView2::CompletionModel</name>
<message>
<location filename="../contentview2/contentview2completionmodel.cpp" line="199"/>
<source>Completion not ready</source>
<translation>Complétion pas prête</translation>
</message>
</context>
<context>
<name>ContentView2::Manager</name>
<message>
<location filename="../contentview2/contentview2manager.cpp" line="157"/>
<source>General</source>
<translation>Général</translation>
</message>
</context>
<context>
<name>ContentView2::TreeModel</name>
<message>
<location filename="../contentview2/contentview2treemodel.cpp" line="281"/>
<source>Name</source>
<translation>Nom</translation>
</message>
</context>
<context>
<name>DirRCSModel</name>
<message>
<location filename="../project/dirrcsmodel.cpp" line="45"/>
<source>Unknown</source>
<translation>Inconnu</translation>
</message>
<message>
<location filename="../project/dirrcsmodel.cpp" line="47"/>
<source>Locally modified</source>
<translation>Modifié localement</translation>
</message>
<message>
<location filename="../project/dirrcsmodel.cpp" line="49"/>
<source>Locally added</source>
<translation>Ajouté localement</translation>
</message>
<message>
<location filename="../project/dirrcsmodel.cpp" line="51"/>
<source>Has conflict</source>
<translation>En conflit</translation>
</message>
<message>
<location filename="../project/dirrcsmodel.cpp" line="53"/>
<location filename="../project/dirrcsmodel.cpp" line="54"/>
<source>No modified</source>
<translation>Non modifié</translation>
</message>
<message>
<location filename="../project/dirrcsmodel.cpp" line="53"/>
<source>Need checkout</source>
<translation>Nécessite une mise à jour</translation>
</message>
<message>
<location filename="../project/dirrcsmodel.cpp" line="129"/>
<source>Filename : %1
Status : %2