Difference between revisions of "Requirements:Translations"

From ISFDB
Jump to navigation Jump to search
Line 41: Line 41:
 
*New title overview for translations (translator added, original language and translation language added)
 
*New title overview for translations (translator added, original language and translation language added)
 
[[Image:Title translation.JPG]]
 
[[Image:Title translation.JPG]]
 +
shortfiction example:
 +
[[Image:translation_shortfiction.JPG]]
 
*Title screen: translations listed in an own section
 
*Title screen: translations listed in an own section
 
[[Image:Title parent.JPG]]
 
[[Image:Title parent.JPG]]

Revision as of 10:30, 13 June 2010

This page is intended to be a clean specification for the support of creating/editing/displaying translations. Discussions about the data here should be entered on the discussion page.

Description of the current situation

ISFDB2 support the translations with the following restrictions:

  • Translations of novels can be added as new publications. (Technically it would be possible to add them as variant titles, but the current isfdb guidelines advise to add them as publications.)
  • Translators of the translated works can be added only as text notes of the given publication.
  • Translations of omnibus editions or foreign language omnibus editions can be added but as a consequence this information is displayed on the author's page mixed with the original language omnibus editions.
  • Translations of short stories, magazines cannot are not supported by the isfdb2.

Requirement specification

The translation support enhancement should fulfill the following requirements:

  1. Backward compatibility: the new language fields are optional fields and the isfdb2 should work with the old database content as before w/o any data migration
  2. Users should be able set their languages in the user preferences
  3. Author's data should be extended by two optional language fields storing the "working language" of the given author
  4. Title data should be extended by a new optional language field storing the "original language" of the given title. In case of translations the same field should be used to store the translation language.
  5. Authors' summary pages should display only the titles with languages stored in the user preferences
  6. Users should be able to add translations to the titles. If we add translation then the original author cannot be changed, but translators can be added to the translated title. Original title cannot be changed, but new translation title has to be specified. Original language cannot be changed, but new translation language can be added. Translation language and original language cannot be the same language. Title type and story length cannot be changed in the translated title.
  7. In case of editing translations the same limitations apply as described above for adding translations
  8. Translations can be deleted the same way as any other variant titles
  9. Authors' summary pages should diplay only those omnibus titles whose language is one of the authors' "working languages"
  10. Users should be able to query the titles translated to the most languages
  11. Translations of reviews and interviews are out of scope
  12. Existing translation record (stored as publications) can be migrated into new translations with the following steps: 1) Unmerge your translations 2) Create Variant Title of the original title from the unmerged title and 3) Set the language of the translation by editing the Variant Title 4) Set the translators by editing the Translations

Database schema changes

The following database schema changes are required:

ALTER TABLE titles ADD title_language INT(11) DEFAULT NULL;
ALTER TABLE authors ADD author_language INT(11) DEFAULT NULL;
ALTER TABLE authors ADD author_language2 INT(11) DEFAULT NULL;

Note that some changes are already implemented in the database schema:

  • languages table added
  • user_languages table added
  • user_preferences table enhanced with display_all_languages field

UI changes

  • Add "Add Translation to This Title" menu item to the navigation bar of the title screen

Navbar.JPG

  • New title overview for translations (translator added, original language and translation language added)

Title translation.JPG shortfiction example: Translation shortfiction.JPG

  • Title screen: translations listed in an own section

Title parent.JPG

  • Author's screen: translation of the given author listed in an own section
  • Author's screen: omnibus list restricted to the "working languages" to the author
  • New "Add translation" screen (the yellow fields are read only)

Title add translation.JPG

  • Edit author data screen (extended by two language fields)

Author edit.JPG

  • Edit title screen for translations (the yellow fields are read only)

Title translation edit.JPG

  • Edit title screen for original titles and variant titles (extended by original language field)

Title edit original.JPG

  • New confirmation screen for add translation action

Title add translation conf.JPG

  • Updated confirmation screen for edit title action

Title edit translation conf.JPG

Detailed design

biblio package

  • common.py
    • add new menu item to the title page
  • mylanguages.py
    • call SQLisDisplayAllLanguages instead of direct db access
  • title.sy
    • add step2 - get the title's authors
      • display original language in the header
      • display original language and translation language in the header for translation
      • display "translation" instead of "varian title" in case of translation
    • in step3 - collect translations and variant titles in different lists
    • step6 - display translations

common package

  • authorClass.py
    • add author_language and author_language2 (XML tags: AuthorLanguage and AuthorLanguage2)
  • isfdb.py
    • add AUTHOR_LANGUAGE = 14 and AUTHOR_LANGUAGE2 = 15
    • add TITLE_LANGUAGE = 16
    • add MOD_TRANSLATION = 28 with long name "Translation"
    • add DEFAULT_LANGUAGE = 'eng'
  • library.py
    • add new PrintLangField2XML method
  • SQLparsing.py
    • SQLloadLanguages
      • select lang_id,lang_name from languages order by lang_name
    • SQLreadLanguageName
      • select lang_name from languages where lang_id = %d
    • SQLgetLanguageId
      • select lang_id from languages where lang_code = '%s'
    • SQLTitleTranslators
      • select authors.author_canonical from authors,canonical_author where authors.author_id=canonical_author.author_id and canonical_author.ca_status=4 and canonical_author.title_id='%d'
    • SQLisDisplayAllLanguages
      • select display_all_languages from user_preferences where user_id='%d'
  • titleClass.py
    • add title_language
    • add is_translation flag (calculated only from the db content, i.e. old or current title data)
    • for translations: author array should be filled translators instead of authors
  • viewers.py
    • DisplayAuthorChanges method: add Language and Language2 fields by calling PrintLangField2XML

edit package

  • addtranslation.py (new source file in the edit package, based on old addVariant.py)
    • print Add Translation header
    • query the given title from db
    • display read only original title and editable translation title
    • query authors and display them as read only fields
    • add translators field and button
    • add read only copyright year and editable translation year
    • add read only original language and editable translation language (original language should be disabled in the drop down list of the translation language)
    • display read only storylen and title type
    • add empty note text area
  • editauth.py
    • add Language drop down list - list of allowed values is read from languages table via SQLlistLanguages call - empty value allowed only for authors w/o author_language in the db for sake of backward compatibility, if you set the language then deleting is not allowed, only changing
    • add Language2 drop down list - list of allowed values is read from languages table via SQLlistLanguages call - deleting second working language is always allowed
  • edittitle.py
    • add SQLTitleTranslators method to query translators of the given title (translators are stored with ca_status = 4 in the canonical_author table
    • add printReadOnlyField method to display yellow read only fields for translations
    • determine if the title being edited is a translation (definion: translations have translators in the canonical_author table OR they have parent title and the parent title has a different language)
    • for translations: display read only original title and editable translation title
    • for translations: display read only authors and editable translators
    • add language field (for original titles and translations as well)
    • for translations: storylen and title type should be readonly
  • isfdblib.py
    • addMetadataTitleTranslation script to be added based on addMetadataTitleAuthor
  • submitauth.py
    • add Language and Language2
    • if the Language and Language2 has the same value then only the Language is stored
    • if Language is empty, but Language2 is filled out, then the value of the Language2 is stored in the Language instead of the Language2
  • submittitle.py
    • support Translators tag instead of Authors tag in case of translations
    • add Language field
  • submittranslation.py (new source file in the edit package)
    • display Translation Submission title
    • create XML message for submission including Title, TranslationYear, Language, TitleType, Storylen, Note, Authors, Translators XML tags

mod package

  • aa_update.py
    • add AUTHOR_LANGUAGE and AUTHOR_LANGUAGE2 fields and convert their values from int to string
  • common.py
    • add setTitleTranslators method
    • support ca_status = 4 in the deleteTitleAuthor and addTitleAuthor methods
  • ta_update.py
    • add Language field for titles
    • add Translators by calling setTitleTranslators of common.py
  • tr_new.py (new source file)
    • display Proposed Translation Submission title
    • process Title, TranslationYear, Language, Note, Authors, Translators XML tags
  • tv_update.py
    • add Language field
    • remove old Translator field
    • add new Translators fields if is_translation of the title class is set
  • va.new.py
    • addTranslator method
    • add support for Translation XML tag in addition to VariantTitle
    • add Language field
    • process Translators tag