Merge lp:~xapantu/scratch/translations into lp:~registry/scratch/scratch

Proposed by xapantu
Status: Merged
Approved by: Mario Guerriero
Approved revision: 114
Merged at revision: 117
Proposed branch: lp:~xapantu/scratch/translations
Merge into: lp:~registry/scratch/scratch
Diff against target: 386 lines (+145/-74)
9 files modified
.bzrignore (+1/-0)
CMakeLists.txt (+2/-14)
cmake/Translations.cmake (+41/-0)
org.elementary.scratch.gschema.xml (+1/-1)
po/CMakeLists.txt (+6/-0)
po/POTFILES.in (+0/-8)
po/scratch.pot (+93/-48)
pot-generator.sh (+0/-2)
src/settings.vala (+1/-1)
To merge this branch: bzr merge lp:~xapantu/scratch/translations
Reviewer Review Type Date Requested Status
Registry Administrators Pending
Review via email: mp+73171@code.launchpad.net

Description of the change

Change the translations system, it uses macro and it is easier to maintain.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2011-08-28 09:55:23 +0000
4@@ -0,0 +1,1 @@
5+build
6
7=== modified file 'CMakeLists.txt'
8--- CMakeLists.txt 2011-08-22 22:04:04 +0000
9+++ CMakeLists.txt 2011-08-28 09:55:23 +0000
10@@ -14,6 +14,7 @@
11
12
13 list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/vala)
14+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
15
16
17 # Configure file
18@@ -70,20 +71,7 @@
19 )
20
21 # tranlation stuff
22-find_package (Gettext REQUIRED)
23-
24-add_custom_command (OUTPUT ${CMAKE_SOURCE_DIR}/po/scratch.pot
25- COMMAND xgettext -c --files-from ${CMAKE_SOURCE_DIR}/po/POTFILES.in --keyword=_ -o ${CMAKE_SOURCE_DIR}/po/scratch.pot --no-wrap --no-location
26- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
27- )
28-
29-if (${GETTEXT_FOUND} STREQUAL "TRUE")
30- set (HAVE_GETTEXT true)
31- file (GLOB _translations ${CMAKE_SOURCE_DIR}/po/*.po)
32- GETTEXT_CREATE_TRANSLATIONS (${CMAKE_SOURCE_DIR}/po/${PROJECT_NAME}.pot
33- ALL ${_translations})
34-endif (${GETTEXT_FOUND} STREQUAL "TRUE")
35-
36+add_subdirectory(po)
37 # add_definitions (${CFLAGS} -Wall -Winit-self -Wwrite-strings -Wunreachable-code -Wstrict-prototypes )
38 add_executable (scratch ${VALA_C})
39
40
41=== added file 'cmake/Translations.cmake'
42--- cmake/Translations.cmake 1970-01-01 00:00:00 +0000
43+++ cmake/Translations.cmake 2011-08-28 09:55:23 +0000
44@@ -0,0 +1,41 @@
45+# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
46+
47+macro(add_translations_directory NLS_PACKAGE)
48+ add_custom_target (i18n ALL COMMENT “Building i18n messages.”)
49+ find_program (MSGFMT_EXECUTABLE msgfmt)
50+ file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
51+ foreach (PO_INPUT ${PO_FILES})
52+ get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
53+ set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
54+ add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
55+
56+ install (FILES ${MO_OUTPUT} DESTINATION
57+ share/locale/${PO_INPUT_BASE}/LC_MESSAGES
58+ RENAME ${NLS_PACKAGE}.mo)
59+ endforeach (PO_INPUT ${PO_FILES})
60+endmacro(add_translations_directory)
61+
62+
63+macro(add_translations_catalog NLS_PACKAGE)
64+ add_custom_target (pot COMMENT “Building translation catalog.”)
65+ find_program (XGETTEXT_EXECUTABLE xgettext)
66+
67+
68+ set(C_SOURCE "")
69+
70+ foreach(FILES_INPUT ${ARGN})
71+ file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c)
72+ foreach(C_FILE ${SOURCE_FILES})
73+ set(C_SOURCE ${C_SOURCE} ${C_FILE})
74+ endforeach()
75+ file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala)
76+ foreach(C_FILE ${SOURCE_FILES})
77+ set(C_SOURCE ${C_SOURCE} ${C_FILE})
78+ endforeach()
79+ endforeach()
80+
81+ add_custom_command (TARGET pot COMMAND
82+ ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
83+ ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-8
84+ )
85+endmacro()
86
87=== modified file 'org.elementary.scratch.gschema.xml'
88--- org.elementary.scratch.gschema.xml 2011-08-02 22:17:19 +0000
89+++ org.elementary.scratch.gschema.xml 2011-08-28 09:55:23 +0000
90@@ -4,7 +4,7 @@
91 <value nick="Maximized" value="1" />
92 <value nick="Fullscreen" value="2" />
93 </enum>
94- <schema path="/apps/scratch/savedstate/" id="org.elementary.Scratch.SavedState" gettext-domain="scratch">
95+ <schema path="/apps/scratch/savedstate/" id="org.elementary.scratch.savedstate" gettext-domain="scratch">
96 <key name="window-width" type="i">
97 <default>850</default>
98 <summary>The saved width of the window.</summary>
99
100=== added file 'po/CMakeLists.txt'
101--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
102+++ po/CMakeLists.txt 2011-08-28 09:55:23 +0000
103@@ -0,0 +1,6 @@
104+include(Translations)
105+add_translations_directory("scratch")
106+add_translations_catalog("scratch"
107+ ../src/Widgets
108+ ../src/Dialogs
109+)
110
111=== removed file 'po/POTFILES.in'
112--- po/POTFILES.in 2011-08-10 17:52:09 +0000
113+++ po/POTFILES.in 1970-01-01 00:00:00 +0000
114@@ -1,8 +0,0 @@
115-src/Widgets/notebook.vala
116-src/Widgets/menu.vala
117-src/Widgets/share_menu.vala
118-src/Widgets/toolbar.vala
119-src/Dialogs/pastebin_dialog.vala
120-src/Dialogs/preferences_dialog.vala
121-src/Dialogs/save_dialog.vala
122-src/Dialogs/save_on_close_dialog.vala
123
124=== modified file 'po/scratch.pot'
125--- po/scratch.pot 2011-08-23 09:35:34 +0000
126+++ po/scratch.pot 2011-08-28 09:55:23 +0000
127@@ -8,7 +8,7 @@
128 msgstr ""
129 "Project-Id-Version: PACKAGE VERSION\n"
130 "Report-Msgid-Bugs-To: \n"
131-"POT-Creation-Date: 2011-08-23 11:31+0200\n"
132+"POT-Creation-Date: 2011-08-28 11:52+0200\n"
133 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
134 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
135 "Language-Team: LANGUAGE <LL@li.org>\n"
136@@ -17,138 +17,183 @@
137 "Content-Type: text/plain; charset=CHARSET\n"
138 "Content-Transfer-Encoding: 8bit\n"
139
140+#: /home/xapantu/scratch/po/../src/Widgets/menu.vala:42
141+msgid "Add a new view"
142+msgstr ""
143+
144+#: /home/xapantu/scratch/po/../src/Widgets/menu.vala:44
145+msgid "Remove current view"
146+msgstr ""
147+
148+#: /home/xapantu/scratch/po/../src/Widgets/menu.vala:47
149+msgid "Fullscreen"
150+msgstr ""
151+
152+#: /home/xapantu/scratch/po/../src/Widgets/notebook.vala:262
153+#: /home/xapantu/scratch/po/../src/Widgets/notebook.vala:313
154 msgid "New file"
155 msgstr ""
156
157+#: /home/xapantu/scratch/po/../src/Widgets/notebook.vala:308
158 msgid "No files opened."
159 msgstr ""
160
161+#: /home/xapantu/scratch/po/../src/Widgets/notebook.vala:308
162 msgid "Open a file to start editing"
163 msgstr ""
164
165+#: /home/xapantu/scratch/po/../src/Widgets/notebook.vala:312
166 msgid "Open file"
167 msgstr ""
168
169+#: /home/xapantu/scratch/po/../src/Widgets/notebook.vala:312
170 msgid "open a saved file"
171 msgstr ""
172
173+#: /home/xapantu/scratch/po/../src/Widgets/notebook.vala:313
174 msgid "create an new empty file"
175 msgstr ""
176
177-msgid "Add a new view"
178-msgstr ""
179-
180-msgid "Remove current view"
181-msgstr ""
182-
183-msgid "Fullscreen"
184-msgstr ""
185-
186-msgid "Upload to Pastebin..."
187-msgstr ""
188-
189-msgid "Share via email..."
190-msgstr ""
191-
192+#: /home/xapantu/scratch/po/../src/Widgets/toolbar.vala:78
193 msgid "Search in the text..."
194 msgstr ""
195
196-#. combobox.append (_("File language"));
197+#: /home/xapantu/scratch/po/../src/Widgets/toolbar.vala:121
198 msgid "Normal Text"
199 msgstr ""
200
201+#: /home/xapantu/scratch/po/../src/Widgets/toolbar.vala:151
202 msgid "Create a new file in a new tab"
203 msgstr ""
204
205+#: /home/xapantu/scratch/po/../src/Widgets/toolbar.vala:152
206 msgid "Open an existing file"
207 msgstr ""
208
209+#: /home/xapantu/scratch/po/../src/Widgets/toolbar.vala:153
210 msgid "Save the current file"
211 msgstr ""
212
213+#: /home/xapantu/scratch/po/../src/Widgets/toolbar.vala:154
214 msgid "Cancel the last operation"
215 msgstr ""
216
217+#: /home/xapantu/scratch/po/../src/Widgets/toolbar.vala:155
218 msgid "Repeat the last cancelled operation"
219 msgstr ""
220
221+#: /home/xapantu/scratch/po/../src/Widgets/toolbar.vala:156
222 msgid "Share this file with others"
223 msgstr ""
224
225+#: /home/xapantu/scratch/po/../src/Widgets/share_menu.vala:38
226+msgid "Upload to Pastebin..."
227+msgstr ""
228+
229+#: /home/xapantu/scratch/po/../src/Widgets/share_menu.vala:39
230+msgid "Share via email..."
231+msgstr ""
232+
233+#: /home/xapantu/scratch/po/../src/Dialogs/preferences_dialog.vala:75
234+msgid "Show line numbers"
235+msgstr ""
236+
237+#: /home/xapantu/scratch/po/../src/Dialogs/preferences_dialog.vala:78
238+msgid "Highlight current line"
239+msgstr ""
240+
241+#: /home/xapantu/scratch/po/../src/Dialogs/preferences_dialog.vala:81
242+msgid "Use spaces instead of tabs"
243+msgstr ""
244+
245+#: /home/xapantu/scratch/po/../src/Dialogs/preferences_dialog.vala:86
246+msgid "Tab width:"
247+msgstr ""
248+
249+#: /home/xapantu/scratch/po/../src/Dialogs/preferences_dialog.vala:94
250+msgid "Style scheme:"
251+msgstr ""
252+
253+#: /home/xapantu/scratch/po/../src/Dialogs/preferences_dialog.vala:100
254+msgid "Use the system fixed width font ("
255+msgstr ""
256+
257+#: /home/xapantu/scratch/po/../src/Dialogs/preferences_dialog.vala:109
258+msgid "Select font:"
259+msgstr ""
260+
261+#: /home/xapantu/scratch/po/../src/Dialogs/preferences_dialog.vala:115
262+msgid "Close"
263+msgstr ""
264+
265+#: /home/xapantu/scratch/po/../src/Dialogs/save_dialog.vala:44
266+msgid "Changes on this file aren't saved."
267+msgstr ""
268+
269+#: /home/xapantu/scratch/po/../src/Dialogs/save_dialog.vala:44
270+msgid "Do you want to save changes before close this file?"
271+msgstr ""
272+
273+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:249
274 msgid "Share via PasteBin"
275 msgstr ""
276
277+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:268
278 msgid "Name:"
279 msgstr ""
280
281-msgid "Code highlight:"
282+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:289
283+msgid "Format:"
284 msgstr ""
285
286+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:297
287 msgid "Expiry time:"
288 msgstr ""
289
290+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:302
291 msgid "Keep this paste private"
292 msgstr ""
293
294+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:408
295 msgid "The text is void!"
296 msgstr ""
297
298+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:412
299 msgid "The text format doesn't exist"
300 msgstr ""
301
302+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:416
303 msgid "An error occured"
304 msgstr ""
305
306+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:421
307 msgid "The text is sended"
308 msgstr ""
309
310+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:469
311 msgid "Never"
312 msgstr ""
313
314+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:470
315 msgid "Ten minutes"
316 msgstr ""
317
318+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:471
319 msgid "One hour"
320 msgstr ""
321
322+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:472
323 msgid "One day"
324 msgstr ""
325
326+#: /home/xapantu/scratch/po/../src/Dialogs/pastebin_dialog.vala:473
327 msgid "One month"
328 msgstr ""
329
330-msgid "Show line numbers"
331-msgstr ""
332-
333-msgid "Highlight current line"
334-msgstr ""
335-
336-msgid "Use spaces instead of tabs"
337-msgstr ""
338-
339-msgid "Tab width:"
340-msgstr ""
341-
342-msgid "Style scheme:"
343-msgstr ""
344-
345-msgid "Use the system fixed width font ("
346-msgstr ""
347-
348-msgid "Select font:"
349-msgstr ""
350-
351-msgid "Close"
352-msgstr ""
353-
354-msgid "Changes on this file aren't saved."
355-msgstr ""
356-
357-msgid "Do you want to save changes before close this file?"
358-msgstr ""
359-
360+#: /home/xapantu/scratch/po/../src/Dialogs/save_on_close_dialog.vala:35
361 msgid "Save this file? "
362 msgstr ""
363
364+#: /home/xapantu/scratch/po/../src/Dialogs/save_on_close_dialog.vala:36
365 msgid "All your work will be lost!"
366 msgstr ""
367
368=== removed file 'pot-generator.sh'
369--- pot-generator.sh 2011-08-14 17:02:29 +0000
370+++ pot-generator.sh 1970-01-01 00:00:00 +0000
371@@ -1,2 +0,0 @@
372-#used to create the pot file
373-xgettext -c --files-from ./po/POTFILES.in --keyword=_ -o ./po/scratch.pot --no-wrap --no-location
374
375=== modified file 'src/settings.vala'
376--- src/settings.vala 2011-08-19 10:42:12 +0000
377+++ src/settings.vala 2011-08-28 09:55:23 +0000
378@@ -34,7 +34,7 @@
379 public ScratchWindowState window_state { get; set; }
380
381 public SavedState () {
382- base ("org.elementary.Scratch.SavedState");
383+ base ("org.elementary.scratch.savedstate");
384 }
385
386 }

Subscribers

People subscribed via source and target branches