labwc-tweaks-gtk
is now on Weblate.
You can register here and use the instructions to add a new translation or edit an existing one.
If you don't want to use Weblate you can still branch off the repository and create a pull request. We use GNU Gettext for translations.
- Make sure you wrap any new strings that you add, exposed in the GTK user interface, with the gettext macro:
gtk_label_new(_("My New Feature"));
-
If you create a new file that has exposed strings append the filename to
po/POTFILES.in
. Also you must add it to thexgettext
command string in point 4. -
After adding and testing your code additions to satisfaction, backup
po/labwc-tweaks-gtk.pot
. You need the custom header from that file for the newly generated .pot file in the next step. -
From the root of the repository run this:
xgettext --keyword=_ --add-comments -o po/labwc-tweaks-gtk.pot main.c \
stack-appearance.c stack-lang.c stack-mouse.c data/labwc-tweaks-gtk.desktop.in \
--package-name=labwc-tweaks-gtk --package-version=0.1.0 \
--msgid-bugs-address=https://github.com/labwc/labwc-tweaks-gtk/issues
If you add a new file add it to the command string like so:
xgettext --keyword=_ --add-comments -o po/labwc-tweaks-gtk.pot main.c \
stack-appearance.c stack-lang.c stack-mouse.c stack-newfile.c data/labwc-tweaks-gtk.desktop.in \
--package-name=labwc-tweaks-gtk --package-version=0.1.0 \
--msgid-bugs-address=https://github.com/labwc/labwc-tweaks-gtk/issues
where stack-newfile.c
is your newly created file.
This generates a new pot file at po/labwc.pot
- Copy the header from the original
labwc.pot
to the new one, keeping the newly generated dates, check for sanity and commit. It's important to preserve the dates and thecharset=UTF-8
variable declaration. Please consider that many translators are not coders so may overlook small details when copying the.pot
file to theirlocale. po
file.