Translations
stdout.printf ("Not Translatable string");
stdout.printf (_("Translatable string!"));
string normal = "Another non-translatable string";
string translated = _("Another translatable string");# Include the translations module i18n = import('i18n') # Set our translation domain add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')#Translate and install our .desktop file i18n.merge_file( input: 'data' / 'hello-again.desktop.in', output: meson.project_name() + '.desktop', po_dir: meson.project_source_root() / 'po', type: 'desktop', install: true, install_dir: get_option('datadir') / 'applications' ) #Translate and install our .metainfo file i18n.merge_file( input: 'data' / 'hello-again.metainfo.xml.in', output: meson.project_name() + '.metainfo.xml', po_dir: meson.project_source_root() / 'po', install: true, install_dir: get_option('datadir') / 'metainfo' )subdir('po')git mv data/hello-again.desktop data/hello-again.desktop.in git mv data/hello-again.metainfo.xml data/hello-again.metainfo.xml.ini18n.gettext(meson.project_name(), args: '--directory=' + meson.project_source_root(), preset: 'glib' )src/Application.vala data/hello-again.desktop.in data/hello-again.metainfo.xml.inninja io.github.yourusername.yourrepositoryname-potde esninja io.github.yourusername.yourrepositoryname-update-pogit add src/Application.vala meson.build po/ data/ git commit -am "Add translations" git push
Translators Comments
Last updated
Was this helpful?