ErwinKomen / RU-collbank

0 stars 1 forks source link

Language: include all languages #80

Closed ErwinKomen closed 2 years ago

ErwinKomen commented 2 years ago

Make sure that all languages are included in the processing -- right now it seems some languages are missing

ErwinKomen commented 2 years ago

Suggested way forward:

  • Alleen ‘bestaande’ 3-letter-codes accepteren, en daar een lijst van opnemen (in de XSD zat trouwens al een lijst met 7000+ talen, maar de URLs daarvan leiden nergens naar)
  • De link tussen 3-letter-code en taalnaam wordt in Collbank in een aparte tabel bijgehouden, waarbij één 3-letter-code tot meerdere namen mag leiden
  • Per link tussen 3-letter-code en taalnaam moet wel een URL oid zijn om te verantwoorden dat die naam bij die 3-letter-code hoort

Overigens is sgn volgens mij wel een isocode, maar dan voor een groep. Je hebt isocodes voor aparte talen, en ook voor groepen (ik ben even kwijt waar ik dat gezien heb, maar dat is wat ik me herinner).

That is to say:

  1. There is a fixed list of 3-letter codes, and that list is kept in the LanguageIso model/table in the database
  2. One or more language names may point from LanguageName to one and the same 3-letter-code (i.e. to the same LanguageIso.

Action points:

  1. convert the downloaded list of 3-letter-codes and language names into the correct tables (using fixtures)
  2. change the existing pointers to Language (field name) into pointers to LanguageName (field name)
    1. Using adapt_langname_add() the pointers to LanguageName have been added
    2. TODO:
      1. Adapt the __str__() function of Language - ok
      2. Adapt the get_view() function of Language - ok
      3. Adapt get_language() and all calling it correctly - ok I changed it into get_language_code_name()
      4. Adapt add_collection_xml() to process language correctly - ok (with the previous fix already)
      5. remove the FK to the FieldChoice entry + make field langname obligatory
  3. allow entering language names using select2 (that should be doable in the admin system now?)
    1. Added fields specification to CollectionLangaugeInline (to restrict language input to just langname) as well as to DocumentationLanguageInline
    2. Added autocomplete_fields specification to CollectionLangaugeInline as well as to DocumentationLanguageInline
    3. Added search_fields specification to LanguageNameAdmin
  4. Adapt the Component Registry entry for Language to just contain the 3-letter-codes (and not the names of the languages? - or else these names as 'free text field')
    1. Yes, done, the Component registry is okay.
  5. Adapt the export of the XML to reflect this
    1. I think this is working already, but need to verify this...
    2. Verified: this is working okay
  6. Adapt the importing of XML to take this into consideration
    1. See issue #79
ErwinKomen commented 1 year ago

NOTE

make sure to upload the adapted xsd file (after code beautifying) to the appropriate xsd subdirectory on the server