Merge lp:~paulliu/unity/i18n-po-msgmerge into lp:unity/phablet

Proposed by Ying-Chun Liu
Status: Merged
Approved by: Michał Sawicz
Approved revision: 700
Merged at revision: 699
Proposed branch: lp:~paulliu/unity/i18n-po-msgmerge
Merge into: lp:unity/phablet
Diff against target: 59 lines (+22/-5)
3 files modified
main.cpp (+1/-3)
paths.h.in (+5/-1)
po/CMakeLists.txt (+16/-1)
To merge this branch: bzr merge lp:~paulliu/unity/i18n-po-msgmerge
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Approve
Review via email: mp+165899@code.launchpad.net

Commit message

Don't update(msgmerge) *.po files everytime when build.

Description of the change

Don't update(msgmerge) *.po files everytime when build.

To post a comment you must log in.
lp:~paulliu/unity/i18n-po-msgmerge updated
699. By Ying-Chun Liu on 2013-05-27

Remove isRunningInstalled() in main.cpp for bindtextdomain().

Michał Sawicz (saviq) wrote :

46 + COMMAND install -D ${_gmoFile} ${CMAKE_CURRENT_BINARY_DIR}/locale/${_lang}/LC_MESSAGES/unity8.mo

50 + INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${CMAKE_INSTALL_PREFIX}/share/locale/${_lang}/LC_MESSAGES/ RENAME unity8.mo)

Can we make "unity8" a variable please?

review: Needs Fixing
lp:~paulliu/unity/i18n-po-msgmerge updated
700. By Ying-Chun Liu on 2013-05-28

Use variable for unity8.mo

Michał Sawicz (saviq) :
review: Approve
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'main.cpp'
2--- main.cpp 2013-05-24 16:35:19 +0000
3+++ main.cpp 2013-05-28 10:40:31 +0000
4@@ -83,9 +83,7 @@
5 }
6 }
7
8- if (!isRunningInstalled()) {
9- bindtextdomain("unity8", translationDirectory().toUtf8().data());
10- }
11+ bindtextdomain("unity8", translationDirectory().toUtf8().data());
12
13 QQuickView* view = new QQuickView();
14 view->setResizeMode(QQuickView::SizeRootObjectToView);
15
16=== modified file 'paths.h.in'
17--- paths.h.in 2013-05-24 08:00:04 +0000
18+++ paths.h.in 2013-05-28 10:40:31 +0000
19@@ -28,7 +28,11 @@
20 }
21
22 inline QString translationDirectory() {
23- return QString("@CMAKE_INSTALL_PREFIX@/share/locale");
24+ if (isRunningInstalled()) {
25+ return QString("@CMAKE_INSTALL_PREFIX@/share/locale");
26+ } else {
27+ return QString("@CMAKE_BINARY_DIR@/po/locale");
28+ }
29 }
30
31 inline QString shellAppDirectory() {
32
33=== modified file 'po/CMakeLists.txt'
34--- po/CMakeLists.txt 2013-05-24 08:00:04 +0000
35+++ po/CMakeLists.txt 2013-05-28 10:40:31 +0000
36@@ -9,7 +9,22 @@
37 *.po
38 )
39
40-GETTEXT_CREATE_TRANSLATIONS(${POT_FILE} ALL ${PO_FILES})
41+SET(MO_FILE unity8.mo)
42+
43+FOREACH(_file ${PO_FILES})
44+ GET_FILENAME_COMPONENT(_lang ${_file} NAME_WE)
45+ SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
46+ ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile}
47+ COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_file}
48+ COMMAND install -D ${_gmoFile} ${CMAKE_CURRENT_BINARY_DIR}/locale/${_lang}/LC_MESSAGES/${MO_FILE}
49+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
50+ DEPENDS ${_file}
51+ )
52+ INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${CMAKE_INSTALL_PREFIX}/share/locale/${_lang}/LC_MESSAGES/ RENAME ${MO_FILE})
53+ _GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName)
54+ ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFile})
55+ENDFOREACH(_file)
56+
57 ADD_CUSTOM_COMMAND(OUTPUT ${POT_FILE}
58 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/update-unity-pot
59 )

Subscribers

People subscribed via source and target branches