Browse Source

Add CMakeL10n rules.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Slávek Banko 4 months ago
parent
commit
e532d9345d
38 changed files with 281 additions and 0 deletions
  1. 96
    0
      CMakeL10n.txt
  2. 3
    0
      arts/CMakeL10n.txt
  3. 3
    0
      arts/kde/CMakeL10n.txt
  4. 3
    0
      arts/kde/mcop-dcop/CMakeL10n.txt
  5. 3
    0
      arts/knotify/CMakeL10n.txt
  6. 3
    0
      interfaces/CMakeL10n.txt
  7. 3
    0
      interfaces/tdemediaplayer/CMakeL10n.txt
  8. 3
    0
      interfaces/tdemediaplayer/tdefileaudiopreview/CMakeL10n.txt
  9. 11
    0
      kate/CMakeL10n.txt
  10. 3
    0
      kate/plugins/CMakeL10n.txt
  11. 3
    0
      kate/plugins/autobookmarker/CMakeL10n.txt
  12. 3
    0
      kate/plugins/insertfile/CMakeL10n.txt
  13. 3
    0
      kate/plugins/isearch/CMakeL10n.txt
  14. 3
    0
      kate/plugins/kdatatool/CMakeL10n.txt
  15. 3
    0
      kate/plugins/wordcompletion/CMakeL10n.txt
  16. 3
    0
      kdoctools/CMakeL10n.txt
  17. 3
    0
      libtdescreensaver/CMakeL10n.txt
  18. 3
    0
      tdeabc/CMakeL10n.txt
  19. 3
    0
      tdeabc/formats/CMakeL10n.txt
  20. 3
    0
      tdeabc/plugins/CMakeL10n.txt
  21. 3
    0
      tdeabc/plugins/dir/CMakeL10n.txt
  22. 3
    0
      tdeabc/plugins/file/CMakeL10n.txt
  23. 3
    0
      tdeabc/plugins/ldaptdeio/CMakeL10n.txt
  24. 3
    0
      tdeabc/plugins/net/CMakeL10n.txt
  25. 3
    0
      tdeabc/plugins/sql/CMakeL10n.txt
  26. 3
    0
      tdecmshell/CMakeL10n.txt
  27. 8
    0
      tdeio/CMakeL10n.txt
  28. 3
    0
      tdeio/tdeioexec/CMakeL10n.txt
  29. 8
    0
      tdeprint/CMakeL10n.txt
  30. 3
    0
      tdeprint/cups/CMakeL10n.txt
  31. 40
    0
      tdeprint/cups/cupsdconf2/CMakeL10n.txt
  32. 3
    0
      tdestyles/CMakeL10n.txt
  33. 3
    0
      tdestyles/highcontrast/CMakeL10n.txt
  34. 3
    0
      tdestyles/highcontrast/config/CMakeL10n.txt
  35. 3
    0
      tdestyles/plastik/CMakeL10n.txt
  36. 3
    0
      tdestyles/plastik/config/CMakeL10n.txt
  37. 3
    0
      tdeui/CMakeL10n.txt
  38. 22
    0
      tdeui/colors/CMakeL10n.txt

+ 96
- 0
CMakeL10n.txt View File

@@ -0,0 +1,96 @@
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
+##### set directory for POT files ###############
22
+
23
+set( POT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../tde-i18n/template/messages/tdelibs" )
24
+
25
+
26
+##### verify tqt3 sources #######################
27
+
28
+if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src )
29
+  tde_message_fatal( "TQt3 source code is required but not found" )
30
+endif( )
31
+
32
+
33
+##### prepare tqt3/src/xml/qxml.cpp #############
34
+
35
+if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp )
36
+  # hide "#define" to allow strings to be extracted using xgettext
37
+  file( READ ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp _tqt_qxml )
38
+  string( REGEX REPLACE "\n(#define[^\n]*)(QT_TRANSLATE_NOOP)" "\n/*\\1*/\\2" _tqt_qxml ${_tqt_qxml} )
39
+  file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n "${_tqt_qxml}" )
40
+endif( )
41
+
42
+
43
+##### generate tdeabc/addressee files ###########
44
+
45
+execute_process(
46
+  COMMAND perl ./makeaddressee
47
+  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/scripts
48
+)
49
+
50
+
51
+##### create translation templates ##############
52
+
53
+tde_l10n_create_template(
54
+  CATALOG "tdelibs"
55
+  SOURCES
56
+    "."
57
+    "tdecore/tde-config.cpp.cmake"
58
+    "../dependencies/tqt3/src"
59
+    "../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n"
60
+  EXCLUDES
61
+    "/test/" "/tests/"
62
+    "^arts/kde/mcop-dcop/"
63
+    "^arts/knotify/"
64
+    "^interfaces/tdemediaplayer/tdefileaudiopreview/"
65
+    "^kate/"
66
+    "^kdoctools/"
67
+    "^libtdescreensaver/"
68
+    "^tdeabc/formats/"
69
+    "^tdeabc/plugins/"
70
+    "^tdecmshell/"
71
+    "^tdecore/tdeconfig_compiler/example/"
72
+    "^tdeio/"
73
+    "^tdeioslave/"
74
+    "^tdeprint/"
75
+    "^tdeui/colors/"
76
+    "^tdestyles/.*/config/"
77
+    "/dependencies/tqt3/src/xml/qxml.cpp$"
78
+  KEYWORDS
79
+    tr tr:1,2
80
+    translate translate:1,2
81
+    QT_TRANSLATE_NOOP QT_TRANSLATE_NOOP:1,2
82
+)
83
+
84
+
85
+##### clenaup tdeabc/addressee files ############
86
+
87
+file( REMOVE
88
+    ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/addressee.cpp
89
+    ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/addressee.h
90
+    ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/field.cpp
91
+)
92
+
93
+
94
+##### create translation templates ##############
95
+
96
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
arts/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
arts/kde/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
arts/kde/mcop-dcop/CMakeL10n.txt View File

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

+ 3
- 0
arts/knotify/CMakeL10n.txt View File

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

+ 3
- 0
interfaces/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
interfaces/tdemediaplayer/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
interfaces/tdemediaplayer/tdefileaudiopreview/CMakeL10n.txt View File

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

+ 11
- 0
kate/CMakeL10n.txt View File

@@ -0,0 +1,11 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_create_template(
4
+  CATALOG "katepart"
5
+  SOURCES data part plugins
6
+  ATTRIBUTES
7
+    "data/*.xml:language,section,Language Section"
8
+    "data/*.xml:language,name,Language"
9
+)
10
+
11
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
kate/plugins/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
kate/plugins/autobookmarker/CMakeL10n.txt View File

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

+ 3
- 0
kate/plugins/insertfile/CMakeL10n.txt View File

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

+ 3
- 0
kate/plugins/isearch/CMakeL10n.txt View File

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

+ 3
- 0
kate/plugins/kdatatool/CMakeL10n.txt View File

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

+ 3
- 0
kate/plugins/wordcompletion/CMakeL10n.txt View File

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

+ 3
- 0
kdoctools/CMakeL10n.txt View File

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

+ 3
- 0
libtdescreensaver/CMakeL10n.txt View File

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

+ 3
- 0
tdeabc/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tdeabc/formats/CMakeL10n.txt View File

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

+ 3
- 0
tdeabc/plugins/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tdeabc/plugins/dir/CMakeL10n.txt View File

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

+ 3
- 0
tdeabc/plugins/file/CMakeL10n.txt View File

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

+ 3
- 0
tdeabc/plugins/ldaptdeio/CMakeL10n.txt View File

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

+ 3
- 0
tdeabc/plugins/net/CMakeL10n.txt View File

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

+ 3
- 0
tdeabc/plugins/sql/CMakeL10n.txt View File

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

+ 3
- 0
tdecmshell/CMakeL10n.txt View File

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

+ 8
- 0
tdeio/CMakeL10n.txt View File

@@ -0,0 +1,8 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_create_template(
4
+  CATALOG "tdeio"
5
+  SOURCES "." "../tdeioslave"
6
+)
7
+
8
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tdeio/tdeioexec/CMakeL10n.txt View File

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

+ 8
- 0
tdeprint/CMakeL10n.txt View File

@@ -0,0 +1,8 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_create_template(
4
+  CATALOG "tdeprint"
5
+  EXCLUDES "^cups/cupsdconf2/"
6
+)
7
+
8
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tdeprint/cups/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 40
- 0
tdeprint/cups/cupsdconf2/CMakeL10n.txt View File

@@ -0,0 +1,40 @@
1
+##### prepare cupsd.conf.template as C source ###
2
+
3
+set( _conf_context "Do not translate the keyword between brackets (e.g. ServerName, ServerAdmin, etc.)" )
4
+file( READ ${CMAKE_CURRENT_SOURCE_DIR}/cupsd.conf.template _conf_template )
5
+string( REGEX REPLACE "[^\n]" "" _conf_len "${_conf_template}" )
6
+string( LENGTH "+${_conf_len}" _conf_len )
7
+unset( _conf_comment )
8
+unset( _conf_l10n )
9
+set( _conf_pos 0 )
10
+while( _conf_pos LESS ${_conf_len} )
11
+  string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _conf_line "${_conf_template}" )
12
+  string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _conf_template "${_conf_template}" )
13
+  math( EXPR _conf_pos "${_conf_pos}+1" )
14
+  if( _conf_comment )
15
+    if( "${_conf_line}" MATCHES "^\\$\\$" OR "${_conf_line}" MATCHES "^@@" )
16
+      unset( _conf_comment )
17
+      set( _conf_line ");" )
18
+    else( )
19
+      string( REGEX REPLACE "\\\"" "\\\\\"" _conf_line "${_conf_line}" )
20
+      string( REGEX REPLACE "^# +(.*)$" "\"\\1\\\\n\"" _conf_line "${_conf_line}" )
21
+    endif( )
22
+  else( )
23
+    if( "${_conf_line}" MATCHES "^%%" AND NOT "${_conf_line}" STREQUAL "%%header" )
24
+      set( _conf_comment 1 )
25
+      set( _conf_line "i18n(\"${_conf_context}\"," )
26
+    else( )
27
+      set( _conf_line "" )
28
+    endif( )
29
+  endif( )
30
+  set( _conf_l10n "${_conf_l10n}${_conf_line}\n" )
31
+endwhile( )
32
+file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/cupsd.conf.template.tde_l10n "${_conf_l10n}" )
33
+
34
+
35
+##### create translation templates ##############
36
+
37
+tde_l10n_create_template(
38
+  CATALOG "cupsdconf"
39
+  SOURCES "." cupsd.conf.template.tde_l10n
40
+)

+ 3
- 0
tdestyles/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tdestyles/highcontrast/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tdestyles/highcontrast/config/CMakeL10n.txt View File

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

+ 3
- 0
tdestyles/plastik/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tdestyles/plastik/config/CMakeL10n.txt View File

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

+ 3
- 0
tdeui/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
1
+##### create translation templates ##############
2
+
3
+tde_l10n_auto_add_subdirectories( )

+ 22
- 0
tdeui/colors/CMakeL10n.txt View File

@@ -0,0 +1,22 @@
1
+##### prepare rgb.txt as C source ###############
2
+
3
+file( READ "${CMAKE_CURRENT_SOURCE_DIR}/rgb.txt" _colorsRC )
4
+string( REGEX REPLACE
5
+  "([ \t]*([0-9]+[ \t]+)([0-9]+[ \t]+)([0-9]+[ \t]+))([^ \t\n]+)(\n|$)"
6
+  "\\1/* xgettext: no-c-format */i18n(\"color\", \"\\5\");\\6"
7
+  _colorsRC ${_colorsRC}
8
+)
9
+string( REGEX REPLACE
10
+  "[^\n]*gr[ae]y[^\n]*(\n|$)"
11
+  "\\1"
12
+  _colorsRC ${_colorsRC}
13
+)
14
+file( WRITE "${CMAKE_CURRENT_SOURCE_DIR}/rgb.txt.tde_l10n" "${_colorsRC}" )
15
+
16
+
17
+##### create translation templates ##############
18
+
19
+tde_l10n_create_template(
20
+  CATALOG "tdelibs_colors"
21
+  SOURCES rgb.txt.tde_l10n
22
+)

Loading…
Cancel
Save