Ticket #581 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Library-type gettext/libintl usage

Reported by: courmisch Assigned to: courmisch
Priority: low Milestone: 0.9.0 features freeze
Component: LibVLC Version: master
Severity: normal Keywords:
Cc: Platform(s): all
Difficulty: unknown Work status: Not started

Description

Gettext is currently used by libvlc (and plugins) as if libvlc was a program. That works fine with the VLC binary itself... but that's flawed when used as a library, such as in browser's plugin or bound to a scripting language.

Change History

05/03/06 16:03:38 changed by courmisch

  • summary changed from Library-type use gettext/libintl to Library-type gettext/libintl usage.

05/03/06 16:21:52 changed by courmisch

LibVLC already knows of dgettext and use it properly... But:

  • it calls textdomain() while it should not,
  • it calls setlocale() which only program should call,
  • it sets LC_NUMERIC to C and assumes it is C afterward, which is broken.

The setlocale() is a bit tricky to solve because we sometime override it according to VLC configuration (if the user asked for a different locale).

As for LC_NUMERIC, it is mainly known to break live555, which is an underlying library.

05/03/06 16:34:22 changed by courmisch

(In [14647]) Don't call textdomain - it is not only useless but harmful (refs #581)

06/03/06 09:11:40 changed by zorglub

  • milestone changed from 0.8.5-test1 to 0.8.5-test2.

08/03/06 00:26:25 changed by tumu

  • priority changed from normal to low.

09/03/06 14:15:48 changed by courmisch

  • status changed from new to assigned.
  • milestone changed from 0.8.5-test2 to 0.8.6 features freeze.

14/04/06 19:28:25 changed by courmisch

(In [15226]) Do not alter LC_NUMERIC (refs #581). *** NOT MEANT FOR BACKPORTING ***

14/04/06 19:30:13 changed by courmisch

Only the setlocale() issue is left. libvlc should probably not call SetLanguage?() except when run from VLC.

14/04/06 19:31:27 changed by courmisch

(In [15227]) Same as previous commit (refs #581)

28/04/06 20:59:40 changed by courmisch

  • status changed from assigned to closed.
  • include_gantt changed.
  • dependencies changed.
  • due_assign changed.
  • resolution set to fixed.
  • due_close changed.

The only remaining issue is the usage of setlocale() when called as an embedded plugin. Maybe we should still do that, so that we don't fallback to ASCII/C/POSIX if the using program does not call setlocale itself (I doubt ActiveX users do that...).

Also, in most case, this won't conflict. On POSIX systems, there is no problem at all, as a side effect of manual language setting being broken.