Browse Source

update POT file and add meson config for handling translations

sisyphus
Dustin Falgout 8 years ago
parent
commit
b88b485487
  1. 2
      NEWS
  2. 37
      build/utils.sh
  3. 2
      meson.build
  4. 2
      po/POTFILES
  5. 5
      po/POTFILES.in
  6. 42
      po/lightdm-webkit2-greeter.pot
  7. 31
      po/meson.build
  8. 6
      src/webkit2-extension.c

2
NEWS

@ -11,7 +11,7 @@ Overview of changes in lightdm-webkit2-greeter 2.2
* Updated API usage for LightDM 1.19.2+.
* Updated bundled JS & CSS vendor libs to their latest versions.
* Added two new options to the greeter config file which make it possible to override the
language and time format used by the greeter.
language and format used by the greeter when displaying the current time.
* Added new theme utility method for getting the current localized time.
* Updated translations with latest changes contributed by the Antergos Community on Transifex.
* antergos theme (default):

37
build/utils.sh

@ -3,20 +3,6 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
do_build() {
(cd "$(dirname "${DIR}")" \
&& meson build \
&& cd build \
&& ninja)
}
do_quick_install() {
(cd "$(dirname "${DIR}")/build/src" \
&& sudo cp lightdm-webkit2-greeter /usr/bin \
&& sudo cp liblightdm-webkit2-greeter-webext.so /usr/lib/lightdm-webkit2-greeter \
&& sudo cp -R ../../themes/antergos /usr/share/lightdm-webkit/themes)
}
clean_build_dir() {
(cd "${DIR}" \
&& find . -type f ! -path './ci*' ! -name '.gitignore' ! -name utils.sh -delete \
@ -35,6 +21,25 @@ combine_javascript_sources() {
}
}
do_build() {
(cd "$(dirname "${DIR}")" \
&& meson build \
&& cd build \
&& ninja)
}
do_quick_install() {
(cd "${DIR}/src" \
&& sudo cp lightdm-webkit2-greeter /usr/bin \
&& sudo cp liblightdm-webkit2-greeter-webext.so /usr/lib/lightdm-webkit2-greeter \
&& sudo cp -R ../../themes/antergos /usr/share/lightdm-webkit/themes)
}
generate_pot_file() {
REPO_ROOT="$(dirname "${DIR}")"
xgettext --from-code UTF-8 -o "${REPO_ROOT}/po/lightdm-webkit2-greeter.pot" -d lightdm-webkit2-greeter "${REPO_ROOT}"/src/*.c
}
list_javascript_sources() {
cd "${MESON_SOURCE_ROOT}/src" && find gresource/js -type f -name '*.js' -print
}
@ -60,4 +65,8 @@ case "$1" in
build-dev)
clean_build_dir && do_build && do_quick_install
;;
gen-pot)
generate_pot_file
;;
esac

2
meson.build

@ -75,7 +75,7 @@ endif
# ------->>> Sub Directories <<<------- #
# ===================================== #
subdirs = ['src', 'man', 'themes', 'data']
subdirs = ['src', 'man', 'themes', 'data', 'po']
foreach s : subdirs
subdir(s)

2
po/POTFILES

@ -0,0 +1,2 @@
src/greeter.c
src/webkit2-extension.c

5
po/POTFILES.in

@ -1,5 +0,0 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
[encoding: UTF-8]
src/lightdm-webkit2-greeter.c
src/lightdm-webkit2-greeter-ext.c

42
po/lightdm-webkit2-greeter.pot

@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# This file is distributed under the same license as the lightdm-webkit2-greeter package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: lightdm-webkit2-greeter\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-24 11:48-0600\n"
"POT-Creation-Date: 2016-12-03 05:51-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,36 +17,24 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../src/lightdm-webkit2-greeter-ext.c:132
msgid "Expected a string"
#: src/greeter.c:135
msgid "Greeter Theme Error Detected"
msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:654
msgid "Hint argument not supplied"
#: src/greeter.c:138
msgid "Load _Default Theme"
msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:681
msgid "Response not supplied"
#: src/greeter.c:140
msgid "Load _Fallback Theme"
msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:911
msgid "Incorrect parameters"
#: src/greeter.c:142
msgid "_Cancel"
msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:938
msgid "Language not supplied"
msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:967
msgid "Argument not supplied"
msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:996
msgid "Needs 3 arguments"
msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:1038
#: ../src/lightdm-webkit2-greeter-ext.c:1085
#: ../src/lightdm-webkit2-greeter-ext.c:1128
msgid "Needs 2 arguments"
#: src/greeter.c:151
msgid ""
"An error was detected in the current theme that could interfere with the "
"system login process."
msgstr ""

31
po/meson.build

@ -0,0 +1,31 @@
i18n = import('i18n')
langs = ['en']
i18n.gettext(
meson.project_name(),
languages : langs,
args: [
'--default-domain=' + meson.project_name(),
'--from-code=UTF-8',
'--add-comments',
'--keyword=_',
'--keyword=N_',
'--keyword=C_:1c,2',
'--keyword=NC_:1c,2',
'--keyword=g_dcgettext:2',
'--keyword=g_dngettext:2,3',
'--keyword=g_dpgettext2:2c,3',
'--flag=N_:1:pass-c-format',
'--flag=C_:2:pass-c-format',
'--flag=NC_:2:pass-c-format',
'--flag=g_dngettext:2:pass-c-format',
'--flag=g_strdup_printf:1:c-format',
'--flag=g_string_printf:2:c-format',
'--flag=g_string_append_printf:2:c-format',
'--flag=g_error_new:3:c-format',
'--flag=g_set_error:4:c-format',
])

6
src/webkit2-extension.c

@ -68,10 +68,10 @@
/*
* Translatable strings
* Error messages
*/
#define EXPECTSTRING _("Expected a string")
#define ARGNOTSUPPLIED _("Argument(s) not supplied")
#define EXPECTSTRING "Expected a string"
#define ARGNOTSUPPLIED "Argument(s) not supplied"
G_MODULE_EXPORT void webkit_web_extension_initialize(WebKitWebExtension *extension);

Loading…
Cancel
Save