Brown-University-Library / OLD-ARCHIVED_iip-production

3 stars 9 forks source link

new iso language codes (2 hrs) #106

Closed emylonas closed 3 years ago

emylonas commented 3 years ago

A few (about 10) inscriptions are being added to IIP that are in Armenian and Georgian. Armenian: ISO language code - xcl Example inscriptions - jer0545, jeru0557

Georgian: ISO language code - geo example inscriptions - bqut0001, bqut0002

In order for the search page to display these languages properly, we need to add the ISO codes and full names of the new languages wherever this is managed. I found an array of ISO codes and language names here: iip_smr_web_app/templatetags/iipCustomFilters.py l. 25 iip_smr_web_app/forms.py l. 92

See also #98

emylonas commented 3 years ago

EM check language code once more. See #98

zeichman commented 3 years ago

Would it be possible to add syc = "Syriac" to these language codes as well? As per issue with qast0001 and iip-text issue #140

zeichman commented 3 years ago

Correction: syc/Syriac not necessary

zeichman commented 3 years ago

Sorry for the waffling - can we get syc as "Syriac"? Firm commitment to it this time.

emylonas commented 3 years ago

I think this is the change that should be added: in file iip_smr_web_app/templatetags/iipCustomFilters.py l. 25ff

vocab_dict = {
    "grc":"Greek",
    "he":"Hebrew",
    "la":"Latin",
    "arc":"Aramaic",
    "xcl":"Armenian",
    "geo":"Georgian",
    "syc":"Syriac",
    "x-unknown":"Unknown",
}

and in file iip_smr_web_app/forms.py l. 92ff

        self.languages_dict = {
            "he":"Hebrew",
            "la": "Latin",
            "grc": "Greek",
            "arc": "Aramaic",
            "xcl":"Armenian",
            "geo":"Georgian",
            "syc":"Syriac",
            "x-unknown":"Unknown"
            }

I did a grep for grc in the code base, to find where language arrays appear and this is what I came up with. There may be other places that I haven't found. (it also appears in old_forms.py l. 86, but perhaps it's not in use? if should be updated, then please insert the same array.

birkin commented 3 years ago

I believe the language-codes must also be updated in the indexer. Will look into this.

emylonas commented 3 years ago

It's in the solr xsl, I can change it right now! no need for you to look at this. best, --elli

On Wed, Feb 17, 2021 at 10:42 AM Birkin James Diana < notifications@github.com> wrote:

I believe the language-codes must also be updated in the indexer. Will look into this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Brown-University-Library/iip-production/issues/106#issuecomment-780646786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOA7ZJ4FD4QC6NLREP5GWTS7PPYDANCNFSM4VWRV42A .

birkin commented 3 years ago

I'm on the fence: I'm reluctant to push the changes you suggested -- and that I made in a branch -- to production, because it appears these may be old unused code, with the newer code simply using the solr "language_display" field. If all looks correct with your change to the solr.xsl -- then perhaps this issue could be revised to "Delete unused language-code code".

emylonas commented 3 years ago

@birkin check whether this provisions the search page

zeichman commented 3 years ago

Can we add phn as "Phoenician" as well? syc and phn are right-to-left languages, if that matters.

emylonas commented 3 years ago

@zeichman I can do that in the css and the solr xsl.

emylonas commented 3 years ago

I have added the language codes in the IIP->solr script. There is also a list of langauges in forms.py, which is probably used on the search page. Finally I should add the rtl languages to the CSS so they are displayed in the proper direction.

emylonas commented 3 years ago

I'm on the fence: I'm reluctant to push the changes you suggested -- and that I made in a branch -- to production, because it appears these may be old unused code, with the newer code simply using the solr "language_display" field. If all looks correct with your change to the solr.xsl -- then perhaps this issue could be revised to "Delete unused language-code code".

@birkin the solr "language_display" field is not enough. The languages are not displaying properly on the search page. I think we need forms.py.

atbradley commented 3 years ago

Updating SearchForm.languages_dict in forms.py is enough to make languages show up on the search page. Two issues:

  1. It looks like one Hebrew inscription is coded as 'heb' while all the others are 'he'.
  2. It doesn't seem to be working on the search results page or the individual inscription pages when there's more than one language for an inscription.
zeichman commented 3 years ago

Corrected the file listed as heb (zoor0452).

emylonas commented 3 years ago

@atbradley There is some code in the iip_to_solr.xsk script, around l. 191ff which handles second or more languages. It seems to only know about Latin, Hebrew, Greek and Aramaic. Could this be the problem?

emylonas commented 3 years ago

@atbradley After today's pull request, there are still problems:

  1. inscription display doesn't display the full name of the language, just the code. I think the problem may be here: templates/iip_search_templates/viewinscr.html l. 170. I think the variable here should be language_display and not language
  2. the Search page still shows the codes and not the names for the newer languages that we've added. There is a section in forms.py where there is a list of languages and names, but it has only the original 4+unknown languages. perhaps adding Syriac, Georgian, Armenian here would fix the search page?

Not sure if this is correct, but some places to start looking.

atbradley commented 3 years ago

I've deployed my change to the language dictionary in forms.py. It's looking right to me now.

emylonas commented 3 years ago

Looks great, go ahead and close!

On Thu, Jun 24, 2021 at 2:10 PM Adam Bradley @.***> wrote:

I've deployed my change to the language dictionary in forms.py. It's looking right to me now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Brown-University-Library/iip-production/issues/106#issuecomment-867849898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOA7ZKJVRAL4DHI4N5RHPDTUNYILANCNFSM4VWRV42A .