Translating custom Application

after run:

$ tutor local run lms django-admin.py makemessages -l ar

Traceback (most recent call last):
  File "/openedx/venv/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/commands/makemessages.py", line 360, in handle
    potfiles = self.build_potfiles()
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/commands/makemessages.py", line 400, in build_potfiles
    file_list = self.find_files(".")
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/commands/makemessages.py", line 460, in find_files
    for dirpath, dirnames, filenames in os.walk(root, topdown=True, followlinks=self.symlinks):
  File "/openedx/venv/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/openedx/venv/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/openedx/venv/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/openedx/venv/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/openedx/venv/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/openedx/venv/lib/python2.7/os.py", line 286, in walk
    if isdir(join(top, name)):
  File "/openedx/venv/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)
Error: Command failed with status 1: docker-compose -f /root/.local/share/tutor/env/local/docker-compose.yml --project-name tutor_local run --rm lms django-admin.py makemessages -l ar

this is my settings.py file:

from django.utils.translation import gettext_lazy as _

LOCALE_PATHS = (
   os.path.join(BASE_DIR, 'locale'),
)

LANGUAGES = (
    ('ar', _('Arabic')),
    ('en', _('English')),
)

MULTILINGUAL_LANGUAGES = (
    "en-us",
    "ar-ae",
)

USE_I18N = True
LANGUAGE_BIDI = True

I found the solution. You do not need to generate a new file po. All you have to do is add the new text to the po file and its corresponding translation. :innocent: