Skip to content

Commit

Permalink
Add localization to debian package
Browse files Browse the repository at this point in the history
Add locale compilation in debian build rules
  • Loading branch information
LyzardKing committed Jan 7, 2024
1 parent d04e85d commit a89134a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
10 changes: 10 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

%:
dh $@ --with python3 --buildsystem=pybuild --fail-missing
dh_clean

override_dh_auto_build:
dh_auto_build
# Add commands to generate .mo files from .po files for all languages
for lang in $(shell ls po/*.po | cut -d/ -f2 | cut -d. -f1); do \
mkdir -p debian/locale/$$lang/LC_MESSAGES; \
msgfmt -o debian/locale/$$lang/LC_MESSAGES/ubuntu-make.mo po/$$lang.po; \
done

override_dh_auto_test:
./runtests pep8
Expand All @@ -15,4 +24,5 @@ override_dh_installman:

override_dh_clean:
rm -f debian/umake.1
rm -rf debian/locale
dh_clean
1 change: 1 addition & 0 deletions debian/ubuntu-make.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
usr/bin/umake
usr/lib/
debian/locale/* usr/share/locale/
2 changes: 1 addition & 1 deletion po/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ msgstr ""

#: umake/tools.py:48
msgid "# Ubuntu make installation of {}\n"
msgstr "{}\n'in Ubuntu make kurulumu"
msgstr "{}\n'in Ubuntu make kurulumu\n"

#: umake/__init__.py:99
msgid "* Command '{}':"
Expand Down
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ description = "Easy setup of common tools for developers on Ubuntu."
readme = "README.md"
requires-python = ">=3.7"
keywords = ["one", "two"]
license = {text = "BSD-3-Clause"}
license = {text = "COPYING"}
classifiers = [
"Framework :: Django",
"Operating System :: POSIX :: Linux",
"Topic :: Software Development",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
]
dependencies = [
Expand All @@ -27,7 +29,11 @@ dependencies = [
dynamic = ["version"]

[tool.setuptools.packages.find]
where = ["umake"]
where = ["."]
include = ["umake*"]

[tool.setuptools.package-data]
umake = ["version"]

[project.scripts]
umake = "umake:main"
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[flake8]
exclude = env/, build, .git
exclude = env/, build, .git, debian/
# Only check for unused_imports
select = F401

[pycodestyle]
exclude = env/, build, .git
exclude = env/, build, .git, debian/, .pybuild
max-line-length = 150
# Ignore:
# E111 indentation is not a multiple of four
Expand Down

0 comments on commit a89134a

Please sign in to comment.