[vlc-commits] [Git][videolan/vlc][master] meson: add gettext support

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Apr 2 09:41:43 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
e8b6a932 by Marvin Scholz at 2023-04-02T08:37:15+00:00
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

- - - - -


2 changed files:

- meson.build
- + po/meson.build


Changes:

=====================================
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


=====================================
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',
+	])



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e8b6a9324d0048cdede41cbb99db8a483eff016e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e8b6a9324d0048cdede41cbb99db8a483eff016e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list