Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Chakra
Akabei
Akabei core library
Commits
7313d34d
Commit
7313d34d
authored
Jul 14, 2012
by
Lukas Appelhans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translations for akabeicore
parent
96f1cc0b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
1 deletion
+79
-1
CMakeLists.txt
CMakeLists.txt
+1
-0
generateTs.sh
generateTs.sh
+11
-0
lib/akabeibackend.cpp
lib/akabeibackend.cpp
+10
-1
lib/akabeibackend.h
lib/akabeibackend.h
+5
-0
translations/CMakeLists.txt
translations/CMakeLists.txt
+44
-0
translations/allPoToTs.sh
translations/allPoToTs.sh
+8
-0
No files found.
CMakeLists.txt
View file @
7313d34d
...
...
@@ -56,6 +56,7 @@ add_subdirectory(lib)
add_subdirectory
(
tools
)
add_subdirectory
(
etc
)
add_subdirectory
(
docs
)
add_subdirectory
(
translations
)
include
(
UseDoxygen
)
...
...
generateTs.sh
0 → 100755
View file @
7313d34d
#!/bin/bash
mkdir
translations/translations/
for
arg
in
"de"
do
lupdate lib/
*
-ts
translations/akabeicore_
$arg
.ts
ts2po translations/akabeicore_
$arg
.ts
-o
translations/translations/akabeicore_
$arg
.po
done
exit
lib/akabeibackend.cpp
View file @
7313d34d
...
...
@@ -25,6 +25,8 @@
#include <QDir>
#include <QFutureWatcher>
#include <QVariant>
#include <QTranslator>
#include <QCoreApplication>
#include <libarchive++/archivehandler.h>
#include <akabeihook.h>
...
...
@@ -337,6 +339,13 @@ Backend::~Backend()
{
}
void
Backend
::
setLocale
(
const
QString
&
locale
)
{
QTranslator
*
translator
=
new
QTranslator
(
this
);
translator
->
load
(
"akabeicore_"
+
locale
+
".qm"
,
"/usr/share/akabeicore/translations/"
);
//FIXME: Use translations from install dir
QCoreApplication
::
instance
()
->
installTranslator
(
translator
);
}
void
Backend
::
initialize
()
{
Q_D
(
Backend
);
...
...
lib/akabeibackend.h
View file @
7313d34d
...
...
@@ -83,6 +83,11 @@ class AKABEICORESHARED_EXPORT Backend : public QObject
static
Backend
*
instance
();
virtual
~
Backend
();
/**
* Sets the locale for AkabeiCore.
*/
void
setLocale
(
const
QString
&
locale
);
/**
* @returns the status of the backend
*/
...
...
translations/CMakeLists.txt
0 → 100644
View file @
7313d34d
# translation start
FIND_PROGRAM
(
QT_LRELEASE_EXECUTABLE
NAMES lrelease
PATHS
${
QT_BINARY_DIR
}
NO_DEFAULT_PATH
)
# needed to create translation files
IF
(
NOT QT_LRELEASE_EXECUTABLE
)
MESSAGE
(
FATAL_ERROR
"Qt4 lrelease not found. Make sure that it has been built and installed by the Qt4 package."
)
ENDIF
(
NOT QT_LRELEASE_EXECUTABLE
)
MACRO
(
ADD_TRANSLATION_FILES _sources
)
FOREACH
(
_current_FILE
${
ARGN
}
)
GET_FILENAME_COMPONENT
(
_in
${
_current_FILE
}
ABSOLUTE
)
GET_FILENAME_COMPONENT
(
_basename
${
_current_FILE
}
NAME_WE
)
SET
(
_out
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
_basename
}
.qm
)
#
ADD_CUSTOM_COMMAND
(
OUTPUT
${
_out
}
COMMAND
${
QT_LRELEASE_EXECUTABLE
}
ARGS -verbose
${
_in
}
-qm
${
_out
}
DEPENDS
${
_in
}
)
SET
(
${
_sources
}
${${
_sources
}}
${
_out
}
)
ENDFOREACH
(
_current_FILE
)
ENDMACRO
(
ADD_TRANSLATION_FILES
)
FILE
(
GLOB TS_FILES
${
CMAKE_CURRENT_SOURCE_DIR
}
/akabeicore_*.ts
)
ADD_TRANSLATION_FILES
(
QM_FILES
${
TS_FILES
}
)
# creating a custom target is needed to make the files build
# "ALL" means that it will be run by default
ADD_CUSTOM_TARGET
(
translations ALL
DEPENDS
${
QM_FILES
}
)
INSTALL
(
CODE
"MESSAGE(
\"
Installing AkabeiCore i18n files...
\"
)"
)
INSTALL
(
FILES
${
QM_FILES
}
DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/share/akabeicore/translations
)
# translation end
translations/allPoToTs.sh
0 → 100755
View file @
7313d34d
#!/bin/bash
for
arg
in
"de"
do
po2ts translations/akabeicore_
$arg
.po akabeicore_
$arg
.ts
done
exit
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment