Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#603 closed enhancement (fixed)

Add preference to disable title-casing in translators

Reported by: stakats Owned by: dstillman
Priority: major Milestone: 1.0 RC 1
Component: ingester Version: 1.0
Keywords: Cc: dcohen, simon

Description (last modified by stakats)

Automatic title-casing is not desired when importing sources other than American English. Should ignore Zotero.Utilities.capitalize title function?

Change History (7)

comment:1 Changed 9 years ago by stakats

  • Description modified (diff)
  • Summary changed from Add preference to disable title-casing on MARC import to Add preference to disable title-casing in translators

comment:2 Changed 9 years ago by dstillman

  • Cc dcohen added; dstillman removed

Well, a few different options that I can think of here:

1) Just add a pref to leave the title unchanged, and change the various translators (which call capitalizeTitle() themselves) to follow the pref. Doing it in the individual translators is a little annoying, but it wouldn't really be appropriate to check the pref in capitalizeTitle() itself (though I suppose we could wrap that function in a Utilities.Ingester version that did obey the pref if we didn't need the flexibility in the translators).

2) Only run capitalizeTitle() when the title is all uppercase (since that's the reason we're doing it in the first place, right?).

3) Add a section to the prefs that let people specify which sites should get particular treatments (as well as a default, like the Quick Copy prefs), add a utilities function that formatted a title various ways (uppercase, lowercase, title-case, first letter, unchanged), and make translate.js run titles through that function in the appropriate mode based on the URL being scraped. This would be the most elegant approach, but I guess it partly depends on whether the formatting is dependent on the language of the reference or the language of the user. If user, a general pref that would let the user choose between those various treatments might be sufficient, but there are probably sites that already format things well (including words like "iPod"), so some sort of site-specific option might still be helpful...

4) Add a submenu in the context menu of metadata fields to format the text in various ways. We should probably do this regardless.

comment:3 Changed 9 years ago by stakats

I vote for a combination of options 1 and 4. Here's why:

We tend to run capitalizeTitle() on records that only capitalize proper nouns. So a book title like The republic of letters: a cultural history of the French enlightenment becomes The Republic of Letters: A Cultural History of the French Enlightenment. So basically there's no good way to tell whether we should run capitalizeTitle() or not. Thus option 2 is out.

Option 3 strikes me as too clever since I don't think there's any reliable concordance among URL, language, and citation format. These all can and do operate independently of each other.

Option 1 will let people just turn the option off. Option 4 will let people quickly reformat problem strings (e.g. all lowercase, all uppercase, title case, etc.)

comment:4 Changed 9 years ago by stakats

  • Priority changed from minor to major

comment:5 Changed 9 years ago by dstillman

  • Cc simon added
  • Owner changed from simon to dstillman

I can take care of this, and I'll do Option 4 too.

comment:6 Changed 9 years ago by dstillman

  • Resolution set to fixed
  • Status changed from new to closed

(In [1551]) Closes #603, Add preference to disable title-casing in translators

  • Zotero.Utilities.capitalizeTitle() now follows the capitalizeTitles pref, enabled by default; added |force| parameter to override
  • Added context menu on metadata fields to lowercase or title case title-ish fields; only works in non-editor mode currently, since overriding the textbox context menu is more annoying
  • Fixed error in capitalizeTitle() on string with just whitespace

comment:7 Changed 9 years ago by dstillman

(In [1552]) Addresses #603, Add preference to disable title-casing in translators

Make capitalizeTitles default to true

Note: See TracTickets for help on using tickets.