From 63672aea9e12ef3932cea4553d092b8ea56df893 Mon Sep 17 00:00:00 2001 From: fossfreedom Date: Tue, 9 Oct 2012 20:40:54 +0100 Subject: [PATCH] initial translation conversion --- TRANSLATE_README | 9 +++++++- babel.cfg | 3 +++ coverart_browser.py | 2 ++ tmpl/albumartsearch-tmpl.html | 37 +++++++++++++++--------------- tmpl/albumartsearchempty-tmpl.html | 2 +- 5 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 babel.cfg diff --git a/TRANSLATE_README b/TRANSLATE_README index 8060d43..3ad18df 100644 --- a/TRANSLATE_README +++ b/TRANSLATE_README @@ -10,7 +10,14 @@ intltool-extract --type=gettext/glade ui/coverart_browser.ui intltool-extract --type=gettext/glade ui/coverart_entryview.ui #create a new template file called po/package.pot by running -pygettext -d package -k _ -k N_ -p po *.py ui/*.h +pygettext -d ui -k _ -k N_ -p po *.py ui/*.h + +#create a template file for the mako templates +pybabel extract -F babel.cfg -o po/tmpl.pot . + +#now combine the pot files +cd po +msgcat ui.pot tmpl.pot -o package.pot #now update existing po's with changes in the template file package.pot ./update_all_po.sh diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 0000000..580e6d3 --- /dev/null +++ b/babel.cfg @@ -0,0 +1,3 @@ +# Extraction from Genshi HTML and text templates +[mako: **/tmpl/**.html] +input_encoding = utf-8 diff --git a/coverart_browser.py b/coverart_browser.py index 96bb2e0..e07db27 100644 --- a/coverart_browser.py +++ b/coverart_browser.py @@ -93,6 +93,8 @@ class CoverArtBrowserPlugin(GObject.Object, Peas.Activatable): self.shell.register_entry_type_for_source(self.source, entry_type) self.shell.append_display_page(self.source, group) + self.shell.props.display_page_tree.select(self.source) + print "CoverArtBrowser DEBUG - end do_activate" def do_deactivate(self): diff --git a/tmpl/albumartsearch-tmpl.html b/tmpl/albumartsearch-tmpl.html index 7417a92..b8c3105 100644 --- a/tmpl/albumartsearch-tmpl.html +++ b/tmpl/albumartsearch-tmpl.html @@ -123,11 +123,12 @@ if (searchdiv.style.display=="none") { searchdiv.style.display="block"; - linkObj.innerText="Search Options: [-]"; + linkObj.innerText=${_("Search Options")}+": [-]"; } else { searchdiv.style.display="none"; - linkObj.innerText="Search Options: [+]"; + ## TRANSLATORS: jkjkjkj + linkObj.innerText=${_("Search Options")}+": [+]"; } } @@ -162,40 +163,40 @@ -

Album art search

+

${_("Album art search")}

-
- +
+

- Search Options: [+] + ${_("Search Options")}: [+]

-
Loading...
+
${_("Loading...")}
- Show more results + ${_("Show more results")} diff --git a/tmpl/albumartsearchempty-tmpl.html b/tmpl/albumartsearchempty-tmpl.html index 62ba07f..71e4fe5 100644 --- a/tmpl/albumartsearchempty-tmpl.html +++ b/tmpl/albumartsearchempty-tmpl.html @@ -6,6 +6,6 @@ -

Album art search - Select an album

+

${_(' Album art search - Select an album')}