2
0
Takashi Iwai 2024-09-10 08:06:19 +00:00 committed by Git OBS Bridge
commit 6f78888932
9 changed files with 143 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

16
_service Normal file
View File

@ -0,0 +1,16 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">git@github.com:openSUSE/suse-desktop-translations.git</param>
<param name="scm">git</param>
<param name="versionformat">%cd.%h</param>
<param name="versionprefix">0</param>
<param name="changesgenerate">enable</param>
<param name="changesauthor">opensuse-packaging@opensuse.org</param>
<param name="revision">refs/heads/main</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git@github.com:openSUSE/suse-desktop-translations.git</param>
<param name="changesrevision">481ec87e723761951fbe3f2f73aabad851a34f34</param></service></servicedata>

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5d4999b7663a25af8cb34e80e310efc7bc93a58b2c5c9dccd39a2e07b07e1167
size 23404

View File

@ -0,0 +1,12 @@
-------------------------------------------------------------------
Sat Sep 07 01:46:14 UTC 2024 - opensuse-packaging@opensuse.org
- Update to version 0.20240907.481ec87:
* First import of translations from a newly created project.
-------------------------------------------------------------------
Fri Sep 6 19:01:26 UTC 2024 - Stanislav Brabec <sbrabec@suse.com>
- New package that supports translation of SUSE specific desktop
files. (boo#1158957)

View File

@ -0,0 +1,54 @@
#
# spec file for package translate-suse-desktop
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: translate-suse-desktop
Version: 0.20240907.481ec87
Release: 0
Summary: A Build Tool to Provide Desktop Translation
License: GPL-3.0-or-later
Group: Development/Tools/Building
Source: suse-desktop-translations-%{version}.tar.xz
Source1: translate_suse_desktop.macro
Source2: translate_suse_desktop.sh
Requires: intltool
BuildArch: noarch
%description
This package provides a tool that will import translations for SUSE
specific desktop files.
%prep
%setup -q -n suse-desktop-translations-%{version}
cp -a %{SOURCE1} %{SOURCE2} .
%build
%install
for PO in po/*.po ; do
install -m0644 -D $PO $RPM_BUILD_ROOT%{_datadir}/%{name}/${PO##*/}
done
install -m0755 -D translate_suse_desktop.sh $RPM_BUILD_ROOT%{_rpmconfigdir}/translate_suse_desktop.sh
install -m0644 -D translate_suse_desktop.macro $RPM_BUILD_ROOT%{_rpmmacrodir}/macros.translate_suse_desktop
%files
%defattr(-,root,root)
%{_datadir}/%{name}
%{_rpmconfigdir}/*
%{_rpmmacrodir}/*
%changelog

View File

@ -0,0 +1,6 @@
# macro: %translate_suse_desktop
# Used to add easily a category to .desktop files according to XDG
# standard.
%translate_suse_desktop() \
/usr/lib/rpm/translate_suse_desktop.sh %{**} \
%nil

24
translate_suse_desktop.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# macro: translate_suse_desktop
#
# Used to add translation to a SUSE specifc .desktop files.
#
set -o errexit
intltool-merge /usr/share/translate-suse-desktop $1.in $1 -d -u
mkdir -p suse_translate_desktop
cd suse_translate_desktop
ln ../$1.in .
intltool-extract --type=gettext/ini $1.in
xgettext --default-domain=$APPLICATION --add-comments --keyword=_ --keyword=N_ --keyword=U_ $1.in.h -o ${1%.desktop}.pot
RPM_OTHER_DIR=${RPM_BUILD_DIR%/BUILD*}/OTHER
if test -f $RPM_OTHER_DIR/translate-suse-desktop.tar.gz ; then
X=r
else
X=c
fi
tar ${X}f $RPM_OTHER_DIR/translate-suse-desktop.tar.gz ${1%.desktop}.pot
echo "Wrote ${1%.desktop}.pot to $RPM_OTHER_DIR/translate-suse-desktop.gz"
echo "with for https://github.com/openSUSE/suse-desktop-translations translatable by"
echo "https://l10n.opensuse.org/projects/suse-desktop-translations/"