Skip to content

Commit

Permalink
Merge pull request #744 from jazzband/translation-cleanup
Browse files Browse the repository at this point in the history
Fix translation files
  • Loading branch information
rtpg committed Jul 5, 2021
2 parents 9bfbb4d + b0beba4 commit 91f1f02
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ coverage.xml
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
Expand Down
Binary file added taggit/locale/da/LC_MESSAGES/django.mo
Binary file not shown.
Binary file modified taggit/locale/uk/LC_MESSAGES/django.mo
Binary file not shown.
18 changes: 18 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import os
import os.path

from django.test import TestCase
from django.utils import translation

from taggit.utils import split_strip

Expand All @@ -15,3 +19,17 @@ def test_should_return_list_of_non_empty_words(self):
result = split_strip("foo|bar||", delimiter="|")

self.assertListEqual(result, expected_result)


class TestLanguages(TestCase):
maxDiff = None

def get_locale_dir(self):
return os.path.join(os.path.dirname(__file__), "..", "taggit", "locale")

def test_language_file_integrity(self):
locale_dir = self.get_locale_dir()
for locale in os.listdir(locale_dir):
# attempt translation activation to confirm that the language files are working
with translation.override(locale):
pass

0 comments on commit 91f1f02

Please sign in to comment.