← Back to team overview

openshot.developers team mailing list archive

[Bug 650910] Re: Localization does not respect LC_MESSAGES

 

Your patch seems to have
#!/usr/bin/ env python
when it should have
#!/usr/bin/env python
(note that there's no space between slash and "env").

About "encoding". I'm not sure why your patch adds that to every file.
It's only needed if your literal source code contains UTF-8 encoded
characters. The fact, that your program deals with UTF-8 strings does
not require UTF-8 encoding for the source code. See
http://www.python.org/dev/peps/pep-0263/ for details.

Note that modules and libraries do not require shebang - only files that
have executable bit set and are intented for direct execution require
the shebang.

About the incorrect localization strings: it seems that the problem is
in the openshot/language/Language_Init.py at code

                # Setup foreign language support
                langs = []
                lc, encoding = locale.getdefaultlocale()
                ...
                self.lang = gettext.translation("OpenShot", self.project.LOCALE_DIR, languages = langs, fallback = True)
The getdefaultlocale() gives lc="fi_FI" and encoding="UTF8" with my locale settings. However,
$ locale
LANG=en_DK.utf8
LC_CTYPE=fi_FI.UTF-8
LC_NUMERIC=en_DK.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE=fi_FI.UTF-8
LC_MONETARY=fi_FI.UTF-8
LC_MESSAGES=en_DK.UTF-8
LC_PAPER=fi_FI.UTF-8
LC_NAME=fi_FI.UTF-8
LC_ADDRESS=fi_FI.UTF-8
LC_TELEPHONE=fi_FI.UTF-8
LC_MEASUREMENT=fi_FI.UTF-8
LC_IDENTIFICATION="en_DK.utf8"
LC_ALL=

and gettext should get en_DK as specified by LC_MESSAGES.

In the end, gettext should not be initialized with the results from
getdefaultlocale(). I'm not sure if this is because getdefaultlocale()
is broken or because getdefaultlocale() is not mean for localization
strings and the returned locale string is designed for something else
but message localization.

-- 
You received this bug notification because you are a member of OpenShot
Developers, which is subscribed to OpenShot Video Editor.
https://bugs.launchpad.net/bugs/650910

Title:
  Localization does not respect LC_MESSAGES

Status in OpenShot Video Editor:
  New

Bug description:
  Openshot Video Editor incorrectly uses Finnish user interface localization in following environment:

LC_ADDRESS=fi_FI.UTF-8
LC_COLLATE=fi_FI.UTF-8
LC_CTYPE=fi_FI.UTF-8
LC_MEASUREMENT=fi_FI.UTF-8
LC_MESSAGES=en_DK.UTF-8
LC_MONETARY=fi_FI.UTF-8
LC_NAME=fi_FI.UTF-8
LC_NUMERIC=en_DK.UTF-8
LC_PAPER=fi_FI.UTF-8
LC_TELEPHONE=fi_FI.UTF-8
LC_TIME=en_DK.UTF-8

As far as I know, LC_MESSAGES should specify user interface text language.





References