Skip to content

Commit bfebedc

Browse files
committed
fix build of multiple locales
1 parent 8bf4c48 commit bfebedc

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

locale/meson.build

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,20 @@ wayfire_locale_dir = join_paths(share_dir, 'locale')
33

44
fs = import('fs')
55

6-
mo_targets = []
7-
86
po_files_raw = run_command('find', '.', '-name', '*.po', check : true).stdout().strip().split('\n')
97
po_files = files(po_files_raw)
108

119
foreach po_file : po_files
1210
language = fs.name(fs.parent(fs.parent(po_file)))
13-
mo_file = fs.stem(po_file) + '.mo'
14-
t = custom_target('mo-' + language,
15-
input : po_file,
16-
output : mo_file,
17-
command : ['msgfmt', '@INPUT@', '-o', '@OUTPUT@'],
18-
install : true,
19-
install_dir : join_paths(
20-
wayfire_locale_dir,
21-
language,
22-
'LC_MESSAGES'
23-
)
11+
install_path = join_paths(
12+
wayfire_locale_dir,
13+
language,
14+
'LC_MESSAGES'
2415
)
25-
26-
mo_targets += t
27-
endforeach
16+
run_command('mkdir', '-p', meson.project_build_root() + '/locale/' + language + '/LC_MESSAGES', check : true)
17+
run_command('msgfmt', po_file, '-o', meson.project_build_root() + '/locale/' + language + '/LC_MESSAGES/' + fs.stem(po_file) + '.mo', check : true)
18+
install_data(
19+
meson.project_build_root() + '/locale/' + language + '/LC_MESSAGES/' + fs.stem(po_file) + '.mo',
20+
install_dir : install_path
21+
)
22+
endforeach

0 commit comments

Comments
 (0)