diff --git a/signbank/api_interface.py b/signbank/api_interface.py index f2a102720..3fbafca66 100644 --- a/signbank/api_interface.py +++ b/signbank/api_interface.py @@ -41,33 +41,33 @@ def api_fields(dataset, language_code='en', advanced=False): dataset = Dataset.objects.get(acronym=settings.DEFAULT_DATASET_ACRONYM) if advanced: for language in dataset.translation_languages.all(): - language_field = _("Lemma ID Gloss") + ": %s" % language.name + language_field = gettext("Lemma ID Gloss") + ": %s" % language.name api_fields_2023.append(language_field) for language in dataset.translation_languages.all(): - language_field = _("Annotation ID Gloss") + ": %s" % language.name + language_field = gettext("Annotation ID Gloss") + ": %s" % language.name api_fields_2023.append(language_field) for language in dataset.translation_languages.all(): - language_field = _("Senses") + ": %s" % language.name + language_field = gettext("Senses") + ": %s" % language.name api_fields_2023.append(language_field) if not advanced: - api_fields_2023.append(_("Handedness")) - api_fields_2023.append(_("Strong Hand")) - api_fields_2023.append(_("Weak Hand")) - api_fields_2023.append(_("Location")) - api_fields_2023.append(_("Semantic Field")) - api_fields_2023.append(_("Word Class")) - api_fields_2023.append(_("Named Entity")) - api_fields_2023.append(_("Link")) - api_fields_2023.append(_("Video")) + api_fields_2023.append(gettext("Handedness")) + api_fields_2023.append(gettext("Strong Hand")) + api_fields_2023.append(gettext("Weak Hand")) + api_fields_2023.append(gettext("Location")) + api_fields_2023.append(gettext("Semantic Field")) + api_fields_2023.append(gettext("Word Class")) + api_fields_2023.append(gettext("Named Entity")) + api_fields_2023.append(gettext("Link")) + api_fields_2023.append(gettext("Video")) else: - api_fields_2023.append(_("Link")) - api_fields_2023.append(_("Video")) - api_fields_2023.append(_("Tags")) - api_fields_2023.append(_("Affiliation")) - api_fields_2023.append(_("Sequential Morphology")) - api_fields_2023.append(_("Simultaneous Morphology")) - api_fields_2023.append(_("Blend Morphology")) + api_fields_2023.append(gettext("Link")) + api_fields_2023.append(gettext("Video")) + api_fields_2023.append(gettext("Tags")) + api_fields_2023.append(gettext("Affiliation")) + api_fields_2023.append(gettext("Sequential Morphology")) + api_fields_2023.append(gettext("Simultaneous Morphology")) + api_fields_2023.append(gettext("Blend Morphology")) fieldnames = FIELDS['main'] + FIELDS['phonology'] + FIELDS['semantics'] + ['inWeb', 'isNew', 'excludeFromEcv'] gloss_fields = [Gloss.get_field(fname) for fname in fieldnames if fname in Gloss.get_field_names()] diff --git a/signbank/csv_interface.py b/signbank/csv_interface.py index d28f85469..f12fe1def 100644 --- a/signbank/csv_interface.py +++ b/signbank/csv_interface.py @@ -877,7 +877,7 @@ def csv_header_row_morphemelist(dataset_languages, fields): keyword_fields = ["Keywords" + " (" + getattr(language, lang_attr_name) + ")" for language in dataset_languages] - with override(LANGUAGE_CODE): + with override(LANGUAGES[0][0]): header = ['Signbank ID'] + annotationidglosstranslation_fields + keyword_fields + [f.verbose_name.title().encode('ascii', 'ignore').decode() for f in fields] for extra_column in ['Appears in signs']: @@ -993,7 +993,7 @@ def csv_header_row_lemmalist(dataset_languages): lemmaidglosstranslation_fields = ["Lemma ID Gloss" + " (" + getattr(language, lang_attr_name) + ")" for language in dataset_languages] - with override(LANGUAGE_CODE): + with override(LANGUAGES[0][0]): header = ['Lemma ID', 'Dataset'] + lemmaidglosstranslation_fields + ['Number of glosses'] return header diff --git a/signbank/dictionary/urls.py b/signbank/dictionary/urls.py index e11060677..6b84af2d7 100755 --- a/signbank/dictionary/urls.py +++ b/signbank/dictionary/urls.py @@ -12,7 +12,7 @@ from signbank.dictionary.views import create_citation_image -#These are needed for the urls below +# These are needed for the urls below import signbank.dictionary.views import signbank.dictionary.tagviews import signbank.dictionary.adminviews @@ -20,6 +20,7 @@ import signbank.manage_videos import signbank.abstract_machine import signbank.gloss_update +import signbank.gloss_morphology_update app_name = 'dictionary' urlpatterns = [ @@ -152,6 +153,8 @@ signbank.gloss_update.api_update_gloss, name='api_update_gloss'), re_path(r'test_am_update_gloss/(?P\d+)/(?P\d+)/$', signbank.dictionary.views.test_am_update_gloss, name='test_am_update_gloss'), + re_path(r'api_update_gloss_morphology/(?P\d+)/(?P\d+)/$', + signbank.gloss_morphology_update.api_update_gloss_morphology, name='api_update_gloss'), re_path(r'info/$', signbank.dictionary.views.info), re_path(r'protected_media/(?P.*)$', signbank.dictionary.views.protected_media, name='protected_media'),