summaryrefslogtreecommitdiffstats
path: root/quanta/CMakeL10n.txt
blob: 295a764d7823594fab003667d82c51b216d5b131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
##### prepare strings from data files ###########

message( STATUS "Prepare to extract strings from quanta data files..." )

## extra resources
unset( _resources_l10n )
file( GLOB_RECURSE _resources_files
      RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_CURRENT_SOURCE_DIR}/data/toolbars/*.actions
      ${CMAKE_CURRENT_SOURCE_DIR}/data/toolbars/*.toolbar
      ${CMAKE_CURRENT_SOURCE_DIR}/*.kmdr
)
list( SORT _resources_files )
foreach( _resource_file ${_resources_files} )
    tde_l10n_prepare_xml( "${_resource_file}" )
    list( APPEND _resources_l10n "${_resource_file}.tde_l10n" )
endforeach( )

## chars
file( READ "${CMAKE_CURRENT_SOURCE_DIR}/data/chars" _chars_file )
string( REPLACE "\"" "\\\"" _chars_l10n "${_chars_file}" )
string( REGEX REPLACE
    "(^|\n)([^\n]+)"
    "\\1i18n(\"\\2\");"
    _chars_l10n "${_chars_l10n}"
)
file( WRITE "${CMAKE_CURRENT_SOURCE_DIR}/data/chars.tde_l10n" "${_chars_l10n}" )


##### create translation templates ##############

tde_l10n_create_template(
    CATALOG "quanta"
    SOURCES
        "."
        "../lib"
        ${_resources_l10n}
        "data/chars.tde_l10n"
        "data/tips"
    ATTRIBUTES
        "data/toolbars/*.actions:action,text"
        "data/toolbars/*.toolbar:action,text"
        "data/config/actions.rc:action,text"
        "*.tag:tag,comment"
)