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 API usage for LightDM 1.19.2+.
* Updated bundled JS & CSS vendor libs to their latest versions. * 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 * 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. * Added new theme utility method for getting the current localized time.
* Updated translations with latest changes contributed by the Antergos Community on Transifex. * Updated translations with latest changes contributed by the Antergos Community on Transifex.
* antergos theme (default): * antergos theme (default):

37
build/utils.sh

@ -3,20 +3,6 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 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() { clean_build_dir() {
(cd "${DIR}" \ (cd "${DIR}" \
&& find . -type f ! -path './ci*' ! -name '.gitignore' ! -name utils.sh -delete \ && 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() { list_javascript_sources() {
cd "${MESON_SOURCE_ROOT}/src" && find gresource/js -type f -name '*.js' -print cd "${MESON_SOURCE_ROOT}/src" && find gresource/js -type f -name '*.js' -print
} }
@ -60,4 +65,8 @@ case "$1" in
build-dev) build-dev)
clean_build_dir && do_build && do_quick_install clean_build_dir && do_build && do_quick_install
;; ;;
gen-pot)
generate_pot_file
;;
esac esac

2
meson.build

@ -75,7 +75,7 @@ endif
# ------->>> Sub Directories <<<------- # # ------->>> Sub Directories <<<------- #
# ===================================== # # ===================================== #
subdirs = ['src', 'man', 'themes', 'data'] subdirs = ['src', 'man', 'themes', 'data', 'po']
foreach s : subdirs foreach s : subdirs
subdir(s) 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. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # 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. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: lightdm-webkit2-greeter\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,36 +17,24 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: ../src/lightdm-webkit2-greeter-ext.c:132 #: src/greeter.c:135
msgid "Expected a string" msgid "Greeter Theme Error Detected"
msgstr "" msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:654 #: src/greeter.c:138
msgid "Hint argument not supplied" msgid "Load _Default Theme"
msgstr "" msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:681 #: src/greeter.c:140
msgid "Response not supplied" msgid "Load _Fallback Theme"
msgstr "" msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:911 #: src/greeter.c:142
msgid "Incorrect parameters" msgid "_Cancel"
msgstr "" msgstr ""
#: ../src/lightdm-webkit2-greeter-ext.c:938 #: src/greeter.c:151
msgid "Language not supplied" msgid ""
msgstr "" "An error was detected in the current theme that could interfere with the "
"system login process."
#: ../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"
msgstr "" 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 EXPECTSTRING "Expected a string"
#define ARGNOTSUPPLIED _("Argument(s) not supplied") #define ARGNOTSUPPLIED "Argument(s) not supplied"
G_MODULE_EXPORT void webkit_web_extension_initialize(WebKitWebExtension *extension); G_MODULE_EXPORT void webkit_web_extension_initialize(WebKitWebExtension *extension);

Loading…
Cancel
Save