Skip to content

Commit

Permalink
Merge pull request #19 from lociii/master
Browse files Browse the repository at this point in the history
Replace ugettext* with gettext*
  • Loading branch information
ralphje authored Mar 27, 2021
2 parents 4c5d295 + 1de8f34 commit 41b9c30
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion internationalflavor/countries/_cldr_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is automatically generated based on the English CLDR file.
# Do not edit manually.

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

COUNTRY_NAMES = {
"001": _("World"),
Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/countries/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from internationalflavor.countries.data import UN_RECOGNIZED_COUNTRIES, get_countries_lazy
from internationalflavor.countries.forms import CountryFormField

Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/iban/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from internationalflavor.iban.validators import BICCleaner, IBANCleaner
from .forms import IBANFormField
Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/iban/validators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from internationalflavor.validators import UpperCaseValueCleaner, _get_mod97_value
from .data import IBAN_REGEXES, EXPERIMENTAL_IBAN_REGEXES, SEPA_COUNTRIES
Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/language/_cldr_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is automatically generated based on the English CLDR file.
# Do not edit manually.

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

LANGUAGE_NAMES = {
"aa": _("Afar"),
Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/language/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from .forms import LanguageFormField
from .data import LANG_MAX_LENGTH, get_languages_lazy

Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/timezone/_cldr_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is automatically generated based on the English CLDR file.
# Do not edit manually.

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

METAZONE_MAPPING_FROM_TZ = {
"Africa/Abidjan": "GMT",
Expand Down
10 changes: 5 additions & 5 deletions internationalflavor/timezone/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils.translation import ugettext_lazy as _, ugettext
from django.utils.translation import gettext_lazy as _, gettext
import itertools
from internationalflavor.timezone._cldr_data import TIMEZONE_NAMES, METAZONE_NAMES, METAZONE_MAPPING_FROM_TZ, \
METAZONE_MAPPING_TO_TZ, TZ_REGION_FORMAT, TZ_GMT_FORMAT, TZ_HOUR_FORMAT
Expand Down Expand Up @@ -113,13 +113,13 @@ def get_metazone_name(metazone, display_format='name'):
* gmt_dst_offset - The above two combined
"""
if display_format == 'name':
display_format = ugettext("%(tzname)s")
display_format = gettext("%(tzname)s")
elif display_format == 'name_cities':
display_format = ugettext("%(tzname)s (%(cities)s)")
display_format = gettext("%(tzname)s (%(cities)s)")
elif display_format == 'offset_name':
display_format = ugettext("%(gmt_offset)s %(tzname)s")
display_format = gettext("%(gmt_offset)s %(tzname)s")
elif display_format == 'offset_name_cities':
display_format = ugettext("%(gmt_offset)s %(tzname)s (%(cities)s)")
display_format = gettext("%(gmt_offset)s %(tzname)s (%(cities)s)")

name = force_text(METAZONE_NAMES.get(metazone, string_format(TZ_REGION_FORMAT, _(metazone))))

Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/timezone/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from internationalflavor.timezone.data import COMMON_TIMEZONES, CURRENT_METAZONES, \
METAZONE_MAPPING_FROM_TZ, get_timezones_cities_lazy, get_metazones_lazy, get_timezone_by_metazone
Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/vat_number/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from .forms import VATNumberFormField
from .data import VAT_MAX_LENGTH
from .validators import VATNumberValidator, VATNumberCleaner
Expand Down
2 changes: 1 addition & 1 deletion internationalflavor/vat_number/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import urllib.request

from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from internationalflavor.validators import UpperCaseValueCleaner, _get_check_digit, _get_mod97_value
from .data import VAT_NUMBER_REGEXES, EU_VAT_AREA
Expand Down
6 changes: 3 additions & 3 deletions scripts/datafromcldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def handle(self, *args, **options):
f.write(b"# coding=utf-8\n")
f.write(b"# This file is automatically generated based on the English CLDR file.\n")
f.write(b"# Do not edit manually.\n\n")
f.write(b"from django.utils.translation import ugettext_lazy as _\n\n")
f.write(b"from django.utils.translation import gettext_lazy as _\n\n")

f.write(b"COUNTRY_NAMES = {\n")
# Loop over each territory
Expand Down Expand Up @@ -127,7 +127,7 @@ def handle(self, *args, **options):
f.write(b"# coding=utf-8\n")
f.write(b"# This file is automatically generated based on the English CLDR file.\n")
f.write(b"# Do not edit manually.\n\n")
f.write(b"from django.utils.translation import ugettext_lazy as _\n\n")
f.write(b"from django.utils.translation import gettext_lazy as _\n\n")

f.write(b"LANGUAGE_NAMES = {\n")
# Loop over each territory
Expand Down Expand Up @@ -162,7 +162,7 @@ def handle(self, *args, **options):
f.write(b"# coding=utf-8\n")
f.write(b"# This file is automatically generated based on the English CLDR file.\n")
f.write(b"# Do not edit manually.\n\n")
f.write(b"from django.utils.translation import ugettext_lazy as _\n\n")
f.write(b"from django.utils.translation import gettext_lazy as _\n\n")

f.write(b"METAZONE_MAPPING_FROM_TZ = {\n")
# We build a map of timezones to metazones
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding=utf-8
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.test import SimpleTestCase
from internationalflavor.forms import SortedSelect

Expand Down

0 comments on commit 41b9c30

Please sign in to comment.