mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-23 16:15:02 +00:00
Merge branch 'locale' of https://github.com/mineo/picard into mineo-locale
This commit is contained in:
@@ -57,13 +57,10 @@ from picard.browser.browser import BrowserIntegration
|
||||
from picard.browser.filelookup import FileLookup
|
||||
from picard.cluster import Cluster, ClusterList, UnmatchedFiles
|
||||
from picard.config import Config
|
||||
from picard.disc import Disc, DiscError
|
||||
from picard.disc import Disc
|
||||
from picard.file import File
|
||||
from picard.formats import open as open_file
|
||||
from picard.metadata import Metadata
|
||||
from picard.track import Track, NonAlbumTrack
|
||||
from picard.config import IntOption
|
||||
from picard.script import ScriptParser
|
||||
from picard.ui.mainwindow import MainWindow
|
||||
from picard.plugin import PluginManager
|
||||
from picard.puidmanager import PUIDManager
|
||||
@@ -71,17 +68,13 @@ from picard.acoustidmanager import AcoustIDManager
|
||||
from picard.util import (
|
||||
decode_filename,
|
||||
encode_filename,
|
||||
make_short_filename,
|
||||
replace_win32_incompat,
|
||||
replace_non_ascii,
|
||||
sanitize_filename,
|
||||
icontheme,
|
||||
webbrowser2,
|
||||
pathcmp,
|
||||
partial,
|
||||
queue,
|
||||
thread,
|
||||
mbid_validate
|
||||
mbid_validate,
|
||||
check_io_encoding
|
||||
)
|
||||
from picard.webservice import XmlWebService
|
||||
|
||||
@@ -152,6 +145,8 @@ class Tagger(QtGui.QApplication):
|
||||
QtCore.QObject.config = self.config
|
||||
QtCore.QObject.log = self.log
|
||||
|
||||
check_io_encoding()
|
||||
|
||||
self.setup_gettext(localedir)
|
||||
|
||||
self.xmlws = XmlWebService()
|
||||
|
||||
@@ -126,8 +126,9 @@ _io_encoding = sys.getfilesystemencoding()
|
||||
#// On a glibc system the system locale defaults to ANSI_X3.4-1968
|
||||
#// It is very unlikely that one would set the locale to ANSI_X3.4-1968
|
||||
#// intentionally
|
||||
if _io_encoding == "ANSI_X3.4-1968":
|
||||
print """
|
||||
def check_io_encoding():
|
||||
if _io_encoding == "ANSI_X3.4-1968":
|
||||
QtCore.QObject.log.warning("""
|
||||
System locale charset is ANSI_X3.4-1968
|
||||
Your system's locale charset (i.e. the charset used to encode filenames)
|
||||
is set to ANSI_X3.4-1968. It is highly unlikely that this has been done
|
||||
@@ -138,12 +139,7 @@ are set. Normally the distribution setup tools take care of this.
|
||||
|
||||
Translation: Picard will have problems with non-english characters
|
||||
in filenames until you change your charset.
|
||||
"""
|
||||
|
||||
|
||||
def set_io_encoding(encoding):
|
||||
"""Sets the encoding used in file names."""
|
||||
_io_encoding = encoding
|
||||
""")
|
||||
|
||||
def encode_filename(filename):
|
||||
"""Encode unicode strings to filesystem encoding."""
|
||||
|
||||
Reference in New Issue
Block a user