Skip to content
This repository has been archived by the owner on Feb 14, 2021. It is now read-only.

Commit

Permalink
Update the translations to correctly generate the mo files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlHertel committed Apr 1, 2018
1 parent b8ee47e commit 507dadc
Show file tree
Hide file tree
Showing 6 changed files with 327 additions and 358 deletions.
36 changes: 1 addition & 35 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,41 +56,7 @@ include_directories(${INTL_INCLUDE_DIRS})
link_directories(${INTL_LIBRARY_DIRS})

#INTL INSTALL TRANSLATIONS
FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)

IF(NOT GETTEXT_MSGFMT_EXECUTABLE)
MESSAGE("------
NOTE: msgfmt not found. Translations will *not* be installed
------")
ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE)

SET(catalogname rkward)

FILE(GLOB PO_FILES *.po)
SET(GMO_FILES)

FOREACH(_poFile ${PO_FILES})
GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME)
STRING(REGEX REPLACE "^${catalogname}_?" "" _langCode ${_poFileName} )
STRING(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} )

IF( _langCode )
GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)

ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile}
DEPENDS ${_poFile})
INSTALL(FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname}.mo)
LIST(APPEND GMO_FILES ${_gmoFile})
ENDIF( _langCode )

ENDFOREACH(_poFile ${PO_FILES})

ADD_CUSTOM_TARGET(translations ALL DEPENDS ${GMO_FILES})

ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE)

GETTEXT_CREATE_TRANSLATIONS(po/adriconf.pot ALL po/en.po po/hr.po po/pt_BR.po)

# Define the executable itself
add_executable(adriconf main.cpp ${SOURCE_FILES})
Expand Down
3 changes: 3 additions & 0 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ void GUI::setupLocale() {
std::locale l = gen("");
std::locale::global(l);
std::cout.imbue(l);
bindtextdomain("adriconf","/usr/share/locale");
textdomain("adriconf");

Glib::ustring langCode(std::use_facet<boost::locale::info>(l).language());

std::cout << Glib::ustring::compose(_("Current language code is %1"), langCode) << std::endl;
Expand Down
File renamed without changes.
212 changes: 106 additions & 106 deletions po/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-20 20:12-0300\n"
"POT-Creation-Date: 2018-03-20 20:13-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -17,68 +17,63 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../ConfigurationResolver.cpp:143
msgid ""
"User-defined driver '%1' on screen '%2' doesn't have a driver loaded on "
"system. Configuration removed."
msgstr "Configuration removed."
#: ../GUI.cpp:667
#, fuzzy
msgid "Add Application app driver widget is not in glade file!"
msgstr "Main window object is not in glade file!"

#: ../ConfigurationResolver.cpp:211
msgid ""
"Driver '%1' doesn't support option '%2' on application '%3'. Option removed."
msgstr ""
"Driver '%1' doesn't support option '%2' on application '%3'. Option removed."
#: ../GUI.cpp:661
#, fuzzy
msgid "Add Application app executable widget is not in glade file!"
msgstr "Main window object is not in glade file!"

#: ../DriConf.glade.h:1
msgid "_File"
msgstr "File"
#: ../GUI.cpp:655
#, fuzzy
msgid "Add Application app name widget is not in glade file!"
msgstr "Main window object is not in glade file!"

#: ../DriConf.glade.h:2
msgid "_Application"
msgstr "Application"
#: ../GUI.cpp:649
#, fuzzy
msgid "Add Application dialog is not in glade file!"
msgstr "Main window object is not in glade file!"

#: ../DriConf.glade.h:3
msgid "_Help"
msgstr "Help"
#: ../GUI.cpp:75
msgid "Add new"
msgstr "Add new"

#: ../DriConf.glade.h:4
msgid "Cancel"
msgstr "Cancel"
#: ../GUI.cpp:584
msgid "An advanced DRI configurator tool."
msgstr "An advanced DRI configurator tool."

#: ../DriConf.glade.h:5
#, fuzzy
msgid "Application name:"
msgstr "Application name"
#: ../GUI.cpp:232
msgid "Application %1 not found "
msgstr "Application %1 not found "

#: ../DriConf.glade.h:6
#, fuzzy
msgid "Application executable:"
msgstr "Application executable"

#: ../DriConf.glade.h:7
#: ../DriConf.glade.h:5
#, fuzzy
msgid "Driver:"
msgstr "Driver:"

#: ../GUI.cpp:51
msgid "Main window object is not in glade file!"
msgstr "Main window object is not in glade file!"
msgid "Application name:"
msgstr "Application name"

#: ../GUI.cpp:75
msgid "Add new"
msgstr "Add new"
#: ../GUI.cpp:633
msgid "Application removed successfully."
msgstr "Application removed successfully."

#: ../GUI.cpp:80
msgid "Remove current Application"
msgstr "Remove current Application"
#: ../GUI.cpp:714
msgid "Application successfully added."
msgstr "Application successfully added."

#: ../GUI.cpp:104
msgid "Generating final XML for saving..."
msgstr "Generating final XML for saving..."
#: ../DriConf.glade.h:4
msgid "Cancel"
msgstr "Cancel"

#: ../GUI.cpp:110
msgid "Writing generated XML: %1"
msgstr "Writing generated XML: %1"
#: ../DRIQuery.cpp:27
msgid "Couldn't open X display"
msgstr "Couldn't open X display"

#: ../GUI.cpp:128
#, fuzzy
Expand All @@ -89,46 +84,65 @@ msgstr "Current language code is %1"
msgid "Driver %1 not found"
msgstr "Driver %1 not found"

#: ../GUI.cpp:232
msgid "Application %1 not found "
msgstr "Application %1 not found "

#: ../GUI.cpp:245
msgid "Driver %1 not found "
msgstr "Driver %1 not found "

#: ../GUI.cpp:261
msgid "Notebook object not found in glade file!"
msgstr "Notebook object not found in glade file!"
#: ../ConfigurationResolver.cpp:211
msgid ""
"Driver '%1' doesn't support option '%2' on application '%3'. Option removed."
msgstr ""
"Driver '%1' doesn't support option '%2' on application '%3'. Option removed."

#: ../GUI.cpp:306
msgid "Option %1 doesn't exist in application %2. Merge failed"
msgstr "Option %1 doesn't exist in application %2. Merge failed"
#: ../DriConf.glade.h:7
#, fuzzy
msgid "Driver:"
msgstr "Driver:"

#: ../GUI.cpp:438
msgid "Use default GPU of screen"
msgstr "Use default GPU of screen"
#: ../DRIQuery.cpp:17
msgid "Error getting function pointers. LibGL must be too old."
msgstr ""

#: ../GUI.cpp:465
#, fuzzy
msgid "Force Application to use GPU"
msgstr "Application %1 not found "

#: ../GUI.cpp:104
msgid "Generating final XML for saving..."
msgstr "Generating final XML for saving..."

#: ../GUI.cpp:51
msgid "Main window object is not in glade file!"
msgstr "Main window object is not in glade file!"

#: ../GUI.cpp:261
msgid "Notebook object not found in glade file!"
msgstr "Notebook object not found in glade file!"

#: ../GUI.cpp:306
msgid "Option %1 doesn't exist in application %2. Merge failed"
msgstr "Option %1 doesn't exist in application %2. Merge failed"

#: ../GUI.cpp:480
msgid "PRIME Settings"
msgstr "PRIME Settings"

#: ../GUI.cpp:584
msgid "An advanced DRI configurator tool."
msgstr "An advanced DRI configurator tool."
#: ../GUI.cpp:80
msgid "Remove current Application"
msgstr "Remove current Application"

#: ../GUI.cpp:588
msgid "Source Code"
msgstr "Source Code"

#: ../GUI.cpp:602
msgid "Unexpected response code from about dialog: %1"
msgstr "Unexpected response code from about dialog: %1"
#: ../GUI.cpp:634
msgid "The application has been removed."
msgstr "The application has been removed."

#: ../GUI.cpp:715
msgid "The application was successfully added. Reloading default app options."
msgstr "The application was successfully added. Reloading default app options."

#: ../GUI.cpp:619
msgid "The default application cannot be removed."
Expand All @@ -138,58 +152,44 @@ msgstr "The default application cannot be removed."
msgid "The driver needs a default configuration."
msgstr "The driver needs a default configuration."

#: ../GUI.cpp:633
msgid "Application removed successfully."
msgstr "Application removed successfully."

#: ../GUI.cpp:634
msgid "The application has been removed."
msgstr "The application has been removed."

#: ../GUI.cpp:649
#, fuzzy
msgid "Add Application dialog is not in glade file!"
msgstr "Main window object is not in glade file!"
#: ../DRIQuery.cpp:106 ../DRIQuery.cpp:115
msgid "Unable to extract configuration for driver %1"
msgstr "Unable to extract configuration for driver %1"

#: ../GUI.cpp:655
#, fuzzy
msgid "Add Application app name widget is not in glade file!"
msgstr "Main window object is not in glade file!"
#: ../GUI.cpp:602
msgid "Unexpected response code from about dialog: %1"
msgstr "Unexpected response code from about dialog: %1"

#: ../GUI.cpp:661
#, fuzzy
msgid "Add Application app executable widget is not in glade file!"
msgstr "Main window object is not in glade file!"
#: ../GUI.cpp:438
msgid "Use default GPU of screen"
msgstr "Use default GPU of screen"

#: ../GUI.cpp:667
#, fuzzy
msgid "Add Application app driver widget is not in glade file!"
msgstr "Main window object is not in glade file!"
#: ../ConfigurationResolver.cpp:143
msgid ""
"User-defined driver '%1' on screen '%2' doesn't have a driver loaded on "
"system. Configuration removed."
msgstr "Configuration removed."

#: ../GUI.cpp:690
msgid "Validation error"
msgstr "Validation error"

#: ../GUI.cpp:110
msgid "Writing generated XML: %1"
msgstr "Writing generated XML: %1"

#: ../GUI.cpp:692
msgid "You need to specify the application name, executable and driver."
msgstr "You need to specify the application name, executable and driver."

#: ../GUI.cpp:714
msgid "Application successfully added."
msgstr "Application successfully added."

#: ../GUI.cpp:715
msgid "The application was successfully added. Reloading default app options."
msgstr "The application was successfully added. Reloading default app options."

#: ../DRIQuery.cpp:17
msgid "Error getting function pointers. LibGL must be too old."
msgstr ""
#: ../DriConf.glade.h:2
msgid "_Application"
msgstr "Application"

#: ../DRIQuery.cpp:27
msgid "Couldn't open X display"
msgstr "Couldn't open X display"
#: ../DriConf.glade.h:1
msgid "_File"
msgstr "File"

#: ../DRIQuery.cpp:106 ../DRIQuery.cpp:115
msgid "Unable to extract configuration for driver %1"
msgstr "Unable to extract configuration for driver %1"
#: ../DriConf.glade.h:3
msgid "_Help"
msgstr "Help"
Loading

0 comments on commit 507dadc

Please sign in to comment.