Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
467c2102
Commit
467c2102
authored
Oct 17, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): the languages resources are updated (with make) if a qml file changes
parent
35c7003b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
11 deletions
+38
-11
CMakeLists.txt
tests/CMakeLists.txt
+9
-0
CMakeLists.txt
tests/languages/CMakeLists.txt
+27
-9
en.ts
tests/languages/en.ts
+1
-1
fr.ts
tests/languages/fr.ts
+1
-1
No files found.
tests/CMakeLists.txt
View file @
467c2102
# ====================================================================
# CMakeLists.txt
# ====================================================================
cmake_minimum_required
(
VERSION 3.0
)
project
(
linphone
)
...
...
@@ -7,6 +11,10 @@ set(LINPHONE_EXEC linphone)
set
(
CMAKE_AUTOMOC ON
)
set
(
CMAKE_INCLUDE_CURRENT_DIR ON
)
# --------------------------------------------------------------------
# Define packages, libs, sources, headers, resources and languages
# --------------------------------------------------------------------
set
(
QT5_PACKAGES Core Gui Quick Widgets QuickControls2 LinguistTools
)
set
(
LIBS
)
...
...
@@ -65,6 +73,7 @@ endfunction ()
# Force absolute paths.
PREPEND
(
SOURCES
"
${
CMAKE_SOURCE_DIR
}
/"
)
PREPEND
(
HEADERS
"
${
CMAKE_SOURCE_DIR
}
/"
)
PREPEND
(
QRC_RESOURCES
"
${
CMAKE_SOURCE_DIR
}
/"
)
# --------------------------------------------------------------------
...
...
tests/languages/CMakeLists.txt
View file @
467c2102
# ====================================================================
# languages/CMakeLists.txt
# ====================================================================
# This line prevent `.ts` files deletion.
# See: https://bugreports.qt.io/browse/QTBUG-31860
#
# On October 17, 2016, this issue is marked `invalid` but it's a
# bullshit. It's not tolerated to remove sources files.
set_directory_properties
(
PROPERTIES CLEAN_NO_CUSTOM true
)
# Build languages resource file.
set
(
TS_FILES
)
set
(
I18N_CONTENT
"<!DOCTYPE RCC>
\n
<RCC version=
\"
1.0
\"
>
\n
<qresource prefix=
\"
/
\"
>
\n
"
)
...
...
@@ -13,15 +24,22 @@ set(I18N_CONTENT "${I18N_CONTENT} </qresource>\n</RCC>\n")
file
(
WRITE
"
${
CMAKE_BINARY_DIR
}
/
${
LANGUAGES_DIRECTORY
}
/
${
I18N_FILENAME
}
"
"
${
I18N_CONTENT
}
"
)
# --------------------------------------------------------------------
# Prevent `.ts` files deletion.
# See: https://bugreports.qt.io/browse/QTBUG-31860
#
# On October 17, 2016, this issue is marked `invalid` but it's a
# bullshit. It's not tolerated to remove sources files.
set_directory_properties
(
PROPERTIES CLEAN_NO_CUSTOM true
)
# Compute QML files list.
set
(
QML_SOURCES
)
file
(
STRINGS
${
QRC_RESOURCES
}
QRC_RESOURCES_CONTENT
)
foreach
(
line
${
QRC_RESOURCES_CONTENT
}
)
set
(
result
)
string
(
REGEX REPLACE
"^[
\t
]+<file>[
\t
]*(.+
\\
.qml)[
\t
]*</file>[
\t
]*$"
"
\\
1"
result
${
line
}
)
string
(
REGEX MATCH
"qml$"
isQml
${
result
}
)
if
(
NOT
${
isQml
}
STREQUAL
""
)
list
(
APPEND QML_SOURCES
"
${
CMAKE_SOURCE_DIR
}
/
${
result
}
"
)
endif
()
endforeach
()
# Create `qm` files from `ts` files.
qt5_create_translation
(
QM_FILES
${
TS_FILES
}
${
SOURCES
}
${
HEADERS
}
)
qt5_create_translation
(
QM_FILES
${
TS_FILES
}
${
SOURCES
}
${
HEADERS
}
${
QML_SOURCES
}
)
add_custom_target
(
update_translations DEPENDS
${
QM_FILES
}
)
tests/languages/en.ts
View file @
467c2102
...
...
@@ -115,7 +115,7 @@
<
translation
type
=
"
unfinished
"
>
Please
choose
one
or
many
files
<
/translation
>
<
/message
>
<
message
>
<
source
>
DROP
YOUR
ATTACHMENT
<
/source
>
<
source
>
dropYourAttachment
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
...
...
tests/languages/fr.ts
View file @
467c2102
...
...
@@ -115,7 +115,7 @@
<
translation
type
=
"
unfinished
"
>
Merci
de
choisir
un
ou
plusieurs
fichiers
<
/translation
>
<
/message
>
<
message
>
<
source
>
DROP
YOUR
ATTACHMENT
<
/source
>
<
source
>
dropYourAttachment
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
...
...
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