[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#761861: allow to override detected language type



Package: qa.debian.org
Severity: normal
User: qa.debian.org@packages.debian.org
Usertags: debsources

[ bug originally reported by Stuart Prescott ]

The heuristics used to detect language type could be wrong (of course), it
would be nice to allow overriding detected language type with a ?lang=... URL
parameter.

A related problem is that we might wrongly detect that some file is not a
text-like file, and hence only offer to download it, rather than render it on
the web. E.g. http://sources.debian.net/src/make/latest/doc/make.info-4/
currently can only be downloaded, in spite of info being a textual file format.

In terms of code the semantic of a new "lang" URL parameter should therefore be
twofold:

- on one hand its presence should override the detection done by libmagic to
  decide whether to render or download a file (see
  http://anonscm.debian.org/cgit/qa/debsources.git/tree/python/models.py#n652 )

- on the other hand the language specified should override the heuristic based
  language detection. To simply force web display without requiring any
  highlighting, we could use something like ?lang=none


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash


Reply to: