Browse Source

Add CMakeL10n rules.

Create translation template.
Add CMake rules to build translations.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Slávek Banko 4 months ago
parent
commit
f3600bef76
Signed by: Slávek Banko <slavek.banko@axis.cz> GPG Key ID: 608F5293A04BE668
6 changed files with 270 additions and 0 deletions
  1. 23
    0
      CMakeL10n.txt
  2. 2
    0
      CMakeLists.txt
  3. 15
    0
      ConfigureChecks.cmake
  4. 6
    0
      po/CMakeLists.txt
  5. 221
    0
      po/klcddimmer.pot
  6. 3
    0
      src/CMakeL10n.txt

+ 23
- 0
CMakeL10n.txt View File

@@ -0,0 +1,23 @@
1
+#################################################
2
+#
3
+#  (C) 2018 Slávek Banko
4
+#  slavek.banko (AT) axis.cz
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+cmake_minimum_required( VERSION 2.8 )
13
+
14
+
15
+##### include our cmake modules #################
16
+
17
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
18
+include( TDEL10n )
19
+
20
+
21
+##### create translation templates ##############
22
+
23
+tde_l10n_auto_add_subdirectories( )

+ 2
- 0
CMakeLists.txt View File

@@ -48,6 +48,7 @@ option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden"
48 48
 
49 49
 option( BUILD_ALL "Build all" ON                     )
50 50
 option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
51
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
51 52
 
52 53
 
53 54
 ##### configure checks
@@ -68,6 +69,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
68 69
 
69 70
 add_subdirectory( src )
70 71
 tde_conditional_add_subdirectory( BUILD_DOC doc )
72
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
71 73
 
72 74
 
73 75
 ##### write configure files

+ 15
- 0
ConfigureChecks.cmake View File

@@ -27,3 +27,18 @@ if( WITH_GCC_VISIBILITY )
27 27
   set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
28 28
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
29 29
 endif( WITH_GCC_VISIBILITY )
30
+
31
+
32
+##### gettext
33
+
34
+if( BUILD_TRANSLATIONS )
35
+  include( FindGettext )
36
+  if( GETTEXT_FOUND )
37
+    set( MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT_EXECUTABLE}
38
+      CACHE FILEPATH "path to msgfmt executable" )
39
+  endif( GETTEXT_FOUND )
40
+
41
+  if( NOT MSGFMT_EXECUTABLE )
42
+    tde_message_fatal( "msgfmt is required but was not found on your system." )
43
+  endif( NOT MSGFMT_EXECUTABLE )
44
+endif( BUILD_TRANSLATIONS )

+ 6
- 0
po/CMakeLists.txt View File

@@ -0,0 +1,6 @@
1
+# build translations if some are already available
2
+
3
+file( GLOB _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po )
4
+if( _srcs )
5
+  tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} )
6
+endif( )

+ 221
- 0
po/klcddimmer.pot View File

@@ -0,0 +1,221 @@
1
+# SOME DESCRIPTIVE TITLE.
2
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3
+#
4
+#, fuzzy
5
+msgid ""
6
+msgstr ""
7
+"Project-Id-Version: PACKAGE VERSION\n"
8
+"POT-Creation-Date: 2018-12-11 17:56+0100\n"
9
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11
+"Language-Team: LANGUAGE <LL@li.org>\n"
12
+"MIME-Version: 1.0\n"
13
+"Content-Type: text/plain; charset=UTF-8\n"
14
+"Content-Transfer-Encoding: 8bit\n"
15
+
16
+#: _translatorinfo:1
17
+msgid ""
18
+"_: NAME OF TRANSLATORS\n"
19
+"Your names"
20
+msgstr ""
21
+
22
+#: _translatorinfo:2
23
+msgid ""
24
+"_: EMAIL OF TRANSLATORS\n"
25
+"Your emails"
26
+msgstr ""
27
+
28
+#: brightnesschooser.cpp:83 brightnesschooser.ui:16 progpreferences.ui:16
29
+#: progpreferences.cpp:120
30
+#, no-c-format
31
+msgid "Form1"
32
+msgstr ""
33
+
34
+#: brightnesschooser.cpp:84 brightnesschooser.ui:74
35
+#, no-c-format
36
+msgid "0"
37
+msgstr ""
38
+
39
+#: brightnesschooser.cpp:85 brightnesschooser.ui:88
40
+#, no-c-format
41
+msgid "set the brightness and click OK or press ENTER"
42
+msgstr ""
43
+
44
+#: brightnesschooser.cpp:86 brightnesschooser.ui:125
45
+#, no-c-format
46
+msgid "&OK"
47
+msgstr ""
48
+
49
+#: brightnesschooser.cpp:87 brightnesschooser.ui:128
50
+#, no-c-format
51
+msgid "Alt+O"
52
+msgstr ""
53
+
54
+#: klcddimmer.cpp:100
55
+msgid "Applet for LCD brightness adjustment"
56
+msgstr ""
57
+
58
+#: klcddimmer.cpp:114
59
+msgid "This is a help box"
60
+msgstr ""
61
+
62
+#: klcddimmer.cpp:123
63
+msgid "Program"
64
+msgstr ""
65
+
66
+#: klcddimmer.cpp:171
67
+msgid "&About KLcdDimmer"
68
+msgstr ""
69
+
70
+#: klcddimmer.cpp:173
71
+msgid "&Configure KLcdDimmer..."
72
+msgstr ""
73
+
74
+#: progpreferences.ui:43 progpreferences.cpp:121
75
+#, no-c-format
76
+msgid "program"
77
+msgstr ""
78
+
79
+#: progpreferences.ui:51 progpreferences.ui:54 progpreferences.cpp:122
80
+#: progpreferences.cpp:123
81
+#, no-c-format
82
+msgid "the program to set the brightness"
83
+msgstr ""
84
+
85
+#: progpreferences.ui:72 progpreferences.cpp:124
86
+#, no-c-format
87
+msgid "set argument"
88
+msgstr ""
89
+
90
+#: progpreferences.ui:80 progpreferences.cpp:125
91
+#, no-c-format
92
+msgid "the argument to pass to the program<br>to set the brightness"
93
+msgstr ""
94
+
95
+#: progpreferences.ui:84 progpreferences.cpp:126
96
+#, no-c-format
97
+msgid ""
98
+"the argument to pass to the program<br>\n"
99
+"to set the brightness"
100
+msgstr ""
101
+
102
+#: progpreferences.ui:102 progpreferences.cpp:128
103
+#, no-c-format
104
+msgid "get argument"
105
+msgstr ""
106
+
107
+#: progpreferences.ui:110 progpreferences.cpp:129
108
+#, no-c-format
109
+msgid "the argument to pass to the program<br>to get the brightness"
110
+msgstr ""
111
+
112
+#: progpreferences.ui:117 progpreferences.cpp:130
113
+#, no-c-format
114
+msgid ""
115
+"the argument to pass to the program<br>\n"
116
+"to get the brightness.\n"
117
+"<p>\n"
118
+"This can be left empty if the program does not support\n"
119
+"a \"get\" argument."
120
+msgstr ""
121
+
122
+#: progpreferences.ui:135 progpreferences.cpp:135
123
+#, no-c-format
124
+msgid "minimum value"
125
+msgstr ""
126
+
127
+#: progpreferences.ui:160 progpreferences.cpp:136
128
+#, no-c-format
129
+msgid "the minimum value for the brightness"
130
+msgstr ""
131
+
132
+#: progpreferences.ui:163 progpreferences.ui:209 progpreferences.ui:255
133
+#: progpreferences.cpp:137 progpreferences.cpp:140 progpreferences.cpp:143
134
+#, no-c-format
135
+msgid "brightness"
136
+msgstr ""
137
+
138
+#: progpreferences.ui:181 progpreferences.cpp:138
139
+#, no-c-format
140
+msgid "maximum value"
141
+msgstr ""
142
+
143
+#: progpreferences.ui:206 progpreferences.cpp:139
144
+#, no-c-format
145
+msgid "the maximum value for the brightness"
146
+msgstr ""
147
+
148
+#: progpreferences.ui:227 progpreferences.cpp:141
149
+#, no-c-format
150
+msgid "step"
151
+msgstr ""
152
+
153
+#: progpreferences.ui:252 progpreferences.cpp:142
154
+#, no-c-format
155
+msgid "step value<br>to increment/decrement the brightness"
156
+msgstr ""
157
+
158
+#: progpreferences.ui:265 progpreferences.cpp:144
159
+#, no-c-format
160
+msgid "S&ave the current brightness value"
161
+msgstr ""
162
+
163
+#: progpreferences.ui:268 progpreferences.cpp:145
164
+#, no-c-format
165
+msgid "Alt+A"
166
+msgstr ""
167
+
168
+#: progpreferences.ui:271 progpreferences.cpp:146
169
+#, no-c-format
170
+msgid ""
171
+"When closing, it saves the current brightness value<br>so that it can be "
172
+"restored<br>when the applet starts."
173
+msgstr ""
174
+
175
+#: progpreferences.ui:276 progpreferences.cpp:147
176
+#, no-c-format
177
+msgid ""
178
+"When closing, it saves the current brightness value<br>\n"
179
+"so that it can be restored<br>\n"
180
+"when the applet starts."
181
+msgstr ""
182
+
183
+#: preferences.kcfg:7
184
+#, no-c-format
185
+msgid "program to adjust lcd brightness"
186
+msgstr ""
187
+
188
+#: preferences.kcfg:11
189
+#, no-c-format
190
+msgid "argument to set the brighness"
191
+msgstr ""
192
+
193
+#: preferences.kcfg:15
194
+#, no-c-format
195
+msgid "argument to get the brighness"
196
+msgstr ""
197
+
198
+#: preferences.kcfg:19
199
+#, no-c-format
200
+msgid "minimum value for brightness"
201
+msgstr ""
202
+
203
+#: preferences.kcfg:23
204
+#, no-c-format
205
+msgid "maximum value for brightness"
206
+msgstr ""
207
+
208
+#: preferences.kcfg:27
209
+#, no-c-format
210
+msgid "step to increment"
211
+msgstr ""
212
+
213
+#: preferences.kcfg:31
214
+#, no-c-format
215
+msgid "save the current value"
216
+msgstr ""
217
+
218
+#: preferences.kcfg:35
219
+#, no-c-format
220
+msgid "the current brightness value"
221
+msgstr ""

+ 3
- 0
src/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_create_template( "klcddimmer" )

Loading…
Cancel
Save