Browse Source

meson: add gettext support

While runtime gettext support was already working,
this adds the missing piece of build integrations.

With these changes, three new targets are now available
to manage translation files:

- vlc-pot: Regenerates the .pot files using xgettext
- vlc-update-po: Regenerates the .po files from the current .pot files
- vlc-gmo: Builds (but not installs) the translations
pull/162/head
Marvin Scholz 3 years ago
committed by Jean-Baptiste Kempf
parent
commit
e8b6a9324d
  1. 2
      meson.build
  2. 18
      po/meson.build

2
meson.build

@ -173,6 +173,8 @@ intl_dep = dependency('intl', required: get_option('nls'))
if intl_dep.found()
cdata.set('HAVE_GETTEXT', 1)
cdata.set('ENABLE_NLS', 1)
subdir('po')
endif
# Domain name i18n support via GNU libidn

18
po/meson.build

@ -0,0 +1,18 @@
i18n = import('i18n')
add_project_arguments(f'-DGETTEXT_PACKAGE="@vlc_package_name@"',
language: ['c', 'cpp', 'objc'])
i18n.gettext(vlc_package_name,
args: [
'--keyword=_',
'--keyword=N_',
'--keyword=_NS',
'--keyword=qtr',
'--keyword=Q_',
'--language=C++',
'--keyword=vlc_ngettext:1,2',
'--keyword=vlc_pgettext:1c,2',
'--keyword=_PNS:1c,2',
'--add-comments=xgettext:',
'--from-code=UTF-8',
])
Loading…
Cancel
Save