Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Akabei core library
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
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
Hide 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
);
...
...
@@ -636,7 +645,7 @@ Package* Backend::loadPackageFromFile(const QString& path)
if
(
pkg
.
getEntries
().
contains
(
".INSTALL"
))
{
retpackage
->
d_func
()
->
setScriptlet
(
pkg
.
readTextFile
(
".INSTALL"
));
}
int
isize
=
0
;
foreach
(
QString
const
&
entry
,
pkg
.
getEntries
())
{
retpackage
->
d_func
()
->
addFile
(
entry
);
...
...
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