%global _empty_manifest_terminate_build 0 Name: python-BabelGladeExtractor Version: 0.7.0 Release: 1 Summary: Babel l10n support for Glade, GtkBuilder, and .desktop files License: BSD URL: https://github.com/GNOME-Keysign/babel-glade Source0: https://mirrors.nju.edu.cn/pypi/web/packages/92/d1/322c28eec415ac3469edf3293958b4a57e7028cb78c5eaa6cd010cffa380/BabelGladeExtractor-0.7.0.tar.bz2 BuildArch: noarch %description # BabelGladeExtractor This package contains message catalog extractors for the following formats, extending [Babel][babel] so it can handle them. * The new XML format used by [Glade][glade] 3.8 and above, properly known as the [GtkBuilder UI Definitions][uixml] format; * The older "GladeXML" format used by libglade and older versions of Glade; * The GNOME [AppData XML][appdataxml] dialect, because it's similar; * FreeDesktop.org [Desktop Entry][desktopfile] files. ## Getting started To make these formats translatable, install this package using pip: ```shell pip3 install BabelGladeExtractor ``` Then in your own projects, map some source and data files to the simple extractor names "glade" and "desktop" that are provided by this package. In your `setup.py`, add a section like ```ini [extract_messages] mapping_file = babel.cfg output_file = subdir/myproject.pot input_dirs = . ``` Next, create a separate `babel.cfg` file, and add sections to it for each format you want to translate. ```ini [glade: **.ui] [desktop: **.desktop] ``` You can then use Babel's [setuptools integration][babelsetuptools] or its [command line interface][babelcli] for your routine i18n lifecycle tasks. ```shell python3 setup.py extract_messages ``` There's a lot more to it than this, naturally. See Babel's extensive [Working with Message Catalogs][babelpo] documentation for a detailed explanation of how to get translatable strings into your Python code. In Glade 3.22, when you are editing a string property in a sidebar, click the edit icon on the right hand side of the text entry. In the dialog that pops up, enter the text in the main text box, and make sure that the Translatable checkbox is ticked. You can also add some helpful [context][pocontext] or comments for your translators if you need to give them a hint. BabelGladeExtractor will handle the corresponding XML attributes appropriately when it extracts strings for translation. [babel]: http://babel.pocoo.org/ [glade]: https://glade.gnome.org/ [uixml]: https://developer.gnome.org/gtk3/stable/GtkBuilder.html#BUILDER-UI [appdataxml]: https://wiki.gnome.org/Initiatives/GnomeGoals/AppDataGnomeSoftware [desktopfile]: https://specifications.freedesktop.org/desktop-entry-spec/ [babelsetuptools]: http://babel.pocoo.org/en/latest/setup.html [babelcli]: http://babel.pocoo.org/en/latest/cmdline.html [babelpo]: http://babel.pocoo.org/en/latest/messages.html [pocontext]: https://www.gnu.org/software/gettext/manual/html_node/Contexts.html#Contexts %package -n python3-BabelGladeExtractor Summary: Babel l10n support for Glade, GtkBuilder, and .desktop files Provides: python-BabelGladeExtractor BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-BabelGladeExtractor # BabelGladeExtractor This package contains message catalog extractors for the following formats, extending [Babel][babel] so it can handle them. * The new XML format used by [Glade][glade] 3.8 and above, properly known as the [GtkBuilder UI Definitions][uixml] format; * The older "GladeXML" format used by libglade and older versions of Glade; * The GNOME [AppData XML][appdataxml] dialect, because it's similar; * FreeDesktop.org [Desktop Entry][desktopfile] files. ## Getting started To make these formats translatable, install this package using pip: ```shell pip3 install BabelGladeExtractor ``` Then in your own projects, map some source and data files to the simple extractor names "glade" and "desktop" that are provided by this package. In your `setup.py`, add a section like ```ini [extract_messages] mapping_file = babel.cfg output_file = subdir/myproject.pot input_dirs = . ``` Next, create a separate `babel.cfg` file, and add sections to it for each format you want to translate. ```ini [glade: **.ui] [desktop: **.desktop] ``` You can then use Babel's [setuptools integration][babelsetuptools] or its [command line interface][babelcli] for your routine i18n lifecycle tasks. ```shell python3 setup.py extract_messages ``` There's a lot more to it than this, naturally. See Babel's extensive [Working with Message Catalogs][babelpo] documentation for a detailed explanation of how to get translatable strings into your Python code. In Glade 3.22, when you are editing a string property in a sidebar, click the edit icon on the right hand side of the text entry. In the dialog that pops up, enter the text in the main text box, and make sure that the Translatable checkbox is ticked. You can also add some helpful [context][pocontext] or comments for your translators if you need to give them a hint. BabelGladeExtractor will handle the corresponding XML attributes appropriately when it extracts strings for translation. [babel]: http://babel.pocoo.org/ [glade]: https://glade.gnome.org/ [uixml]: https://developer.gnome.org/gtk3/stable/GtkBuilder.html#BUILDER-UI [appdataxml]: https://wiki.gnome.org/Initiatives/GnomeGoals/AppDataGnomeSoftware [desktopfile]: https://specifications.freedesktop.org/desktop-entry-spec/ [babelsetuptools]: http://babel.pocoo.org/en/latest/setup.html [babelcli]: http://babel.pocoo.org/en/latest/cmdline.html [babelpo]: http://babel.pocoo.org/en/latest/messages.html [pocontext]: https://www.gnu.org/software/gettext/manual/html_node/Contexts.html#Contexts %package help Summary: Development documents and examples for BabelGladeExtractor Provides: python3-BabelGladeExtractor-doc %description help # BabelGladeExtractor This package contains message catalog extractors for the following formats, extending [Babel][babel] so it can handle them. * The new XML format used by [Glade][glade] 3.8 and above, properly known as the [GtkBuilder UI Definitions][uixml] format; * The older "GladeXML" format used by libglade and older versions of Glade; * The GNOME [AppData XML][appdataxml] dialect, because it's similar; * FreeDesktop.org [Desktop Entry][desktopfile] files. ## Getting started To make these formats translatable, install this package using pip: ```shell pip3 install BabelGladeExtractor ``` Then in your own projects, map some source and data files to the simple extractor names "glade" and "desktop" that are provided by this package. In your `setup.py`, add a section like ```ini [extract_messages] mapping_file = babel.cfg output_file = subdir/myproject.pot input_dirs = . ``` Next, create a separate `babel.cfg` file, and add sections to it for each format you want to translate. ```ini [glade: **.ui] [desktop: **.desktop] ``` You can then use Babel's [setuptools integration][babelsetuptools] or its [command line interface][babelcli] for your routine i18n lifecycle tasks. ```shell python3 setup.py extract_messages ``` There's a lot more to it than this, naturally. See Babel's extensive [Working with Message Catalogs][babelpo] documentation for a detailed explanation of how to get translatable strings into your Python code. In Glade 3.22, when you are editing a string property in a sidebar, click the edit icon on the right hand side of the text entry. In the dialog that pops up, enter the text in the main text box, and make sure that the Translatable checkbox is ticked. You can also add some helpful [context][pocontext] or comments for your translators if you need to give them a hint. BabelGladeExtractor will handle the corresponding XML attributes appropriately when it extracts strings for translation. [babel]: http://babel.pocoo.org/ [glade]: https://glade.gnome.org/ [uixml]: https://developer.gnome.org/gtk3/stable/GtkBuilder.html#BUILDER-UI [appdataxml]: https://wiki.gnome.org/Initiatives/GnomeGoals/AppDataGnomeSoftware [desktopfile]: https://specifications.freedesktop.org/desktop-entry-spec/ [babelsetuptools]: http://babel.pocoo.org/en/latest/setup.html [babelcli]: http://babel.pocoo.org/en/latest/cmdline.html [babelpo]: http://babel.pocoo.org/en/latest/messages.html [pocontext]: https://www.gnu.org/software/gettext/manual/html_node/Contexts.html#Contexts %prep %autosetup -n BabelGladeExtractor-0.7.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-BabelGladeExtractor -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Mon May 29 2023 Python_Bot - 0.7.0-1 - Package Spec generated