diff options
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/CMakeLists.txt | 47 | ||||
| -rw-r--r-- | cli/dice.qrc | 0 | ||||
| -rw-r--r-- | cli/i18n/dice_en.ts | 74 | ||||
| -rw-r--r-- | cli/i18n/dice_fr.ts | 74 |
4 files changed, 189 insertions, 6 deletions
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 9497b41..680d1b8 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -1,7 +1,12 @@ cmake_minimum_required(VERSION 2.8) +option(UPDATE_TRANSLATIONS "update Translation" OFF) +MESSAGE(STATUS "UPDATE TRANSLATIONS: ${UPDATE_TRANSLATIONS}") + project(dice) + + # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. @@ -12,19 +17,48 @@ find_package(Qt5Core) set(EXECUTABLE_OUTPUT_PATH bin/) - include_directories(${Qt5Core_INCLUDES} ../) add_definitions(${Qt5Core_DEFINITIONS}) set(MODE "cli") - ADD_DEFINITIONS( -std=c++11 # Or -std=c++0x # Other flags ) -add_executable( - dice + +set(dice_RESOURCES diceparser.qrc) +FIND_PACKAGE(Qt5LinguistTools) + + +IF(UPDATE_TRANSLATIONS) + MESSAGE( update Translation ) + FILE(GLOB_RECURSE translate_dice_SRCS ../*.cpp ../*.h) + SET(translate_SRCS ${translate_dice_SRCS}) + SET(dice_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/dice_en.ts" "${CMAKE_CURRENT_SOURCE_DIR}/i18n/dice_fr.ts") +ELSE() + MESSAGE( NO updates for translations) + FILE(GLOB dice_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/*.ts") +ENDIF(UPDATE_TRANSLATIONS) + +if(Qt5Core_FOUND) + + IF(UPDATE_TRANSLATIONS) + MESSAGE(status "find" ${dice_TS} ${translate_SRCS} ) + QT5_CREATE_TRANSLATION(dice_QM ${translate_SRCS} ${dice_TS}) + ELSE() + QT5_ADD_TRANSLATION(dice_QM ${dice_TS}) + ENDIF() + + QT5_ADD_RESOURCES(dice_RESOURCES_RCC ${dice_RESOURCES}) + + # guess plugins and libraries directory + set(QT_PLUGINS_DIR "${Qt5Core_DIR}/../../../plugins") + get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION) + get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH) +endif() + +SET( dice_sources ../diceparser.cpp ../range.cpp ../booleancondition.cpp @@ -58,10 +92,11 @@ add_executable( ../node/ifnode.cpp main.cpp ../highlightdice.cpp - ) +) + +add_executable( dice ${dice_sources} ${dice_QM} ) target_link_libraries(dice ${Qt5Core_LIBRARIES}) INSTALL_TARGETS(/bin dice) #qt5_use_modules() - diff --git a/cli/dice.qrc b/cli/dice.qrc new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/cli/dice.qrc diff --git a/cli/i18n/dice_en.ts b/cli/i18n/dice_en.ts new file mode 100644 index 0000000..3efc610 --- /dev/null +++ b/cli/i18n/dice_en.ts @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="en_US"> +<context> + <name>QObject</name> + <message> + <location filename="../../diceparser.cpp" line="186"/> + <source>Nothing was understood</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="603"/> + <source>Dice with %1 face(s) does not exist. Please, put a value higher than 0</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="648"/> + <source>List is missing after the L operator. Please, add it (e.g : 1L[sword,spear,gun,arrow])</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="905"/> + <source>Validator is missing after the c operator. Please, change it</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="931"/> + <source>Validator is missing after the %1 operator. Please, change it</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="943"/> + <source>This condition %1 introduces an endless loop. Please, change it</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="954"/> + <source>Validator is missing after the e operator. Please, change it</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/keepdiceexecnode.cpp" line="48"/> + <source> You ask to keep %1 dice but the result only has %2</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/listaliasnode.cpp" line="55"/> + <source>List of Alias: +</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/helpnode.cpp" line="37"/> + <source>Rolisteam Dice Parser: +Full documentation at: %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/jumpbackwardnode.cpp" line="75"/> + <source> The @ operator expects dice result. Please check the documentation to fix your command.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/dicerollernode.cpp" line="30"/> + <source>No dice to roll</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/scalaroperatornode.cpp" line="128"/> + <source>Division by zero</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/cli/i18n/dice_fr.ts b/cli/i18n/dice_fr.ts new file mode 100644 index 0000000..b5d6396 --- /dev/null +++ b/cli/i18n/dice_fr.ts @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="fr_FR"> +<context> + <name>QObject</name> + <message> + <location filename="../../diceparser.cpp" line="186"/> + <source>Nothing was understood</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="603"/> + <source>Dice with %1 face(s) does not exist. Please, put a value higher than 0</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="648"/> + <source>List is missing after the L operator. Please, add it (e.g : 1L[sword,spear,gun,arrow])</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="905"/> + <source>Validator is missing after the c operator. Please, change it</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="931"/> + <source>Validator is missing after the %1 operator. Please, change it</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="943"/> + <source>This condition %1 introduces an endless loop. Please, change it</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../diceparser.cpp" line="954"/> + <source>Validator is missing after the e operator. Please, change it</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/keepdiceexecnode.cpp" line="48"/> + <source> You ask to keep %1 dice but the result only has %2</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/listaliasnode.cpp" line="55"/> + <source>List of Alias: +</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/helpnode.cpp" line="37"/> + <source>Rolisteam Dice Parser: +Full documentation at: %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/jumpbackwardnode.cpp" line="75"/> + <source> The @ operator expects dice result. Please check the documentation to fix your command.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/dicerollernode.cpp" line="30"/> + <source>No dice to roll</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../node/scalaroperatornode.cpp" line="128"/> + <source>Division by zero</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> |