1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

[#32] Internationalized the core and localized it to french.

This commit is contained in:
Virgil Dupras
2011-01-18 17:33:33 +01:00
parent 04d7880a0c
commit 42cff20710
17 changed files with 153 additions and 37 deletions

View File

@@ -18,6 +18,7 @@ from hscommon.util import get_file_ext, remove_invalid_xml
from hscommon.path import Path
from hscommon.cocoa import as_fetch
from hscommon.cocoa.objcmin import NSUserDefaults, NSURL
from hscommon.trans import tr
from core import fs
from core import app_cocoa, directories
@@ -152,7 +153,7 @@ class DupeGuruPE(app_cocoa.DupeGuru):
marked = [dupe for dupe in self.results.dupes if self.results.is_marked(dupe)]
self.path2iphoto = {}
if any(isinstance(dupe, IPhoto) for dupe in marked):
j = j.start_subjob([6, 4], "Probing iPhoto. Don\'t touch it during the operation!")
j = j.start_subjob([6, 4], tr("Probing iPhoto. Don't touch it during the operation!"))
try:
a = app('iPhoto')
a.activate(timeout=0)
@@ -165,7 +166,7 @@ class DupeGuruPE(app_cocoa.DupeGuru):
pass
except (CommandError, RuntimeError, ApplicationNotFoundError):
pass
j.start_job(self.results.mark_count, "Sending dupes to the Trash")
j.start_job(self.results.mark_count, tr("Sending dupes to the Trash"))
self.results.perform_on_marked(op, True)
del self.path2iphoto

View File

@@ -10,6 +10,7 @@ import logging
import multiprocessing
from collections import defaultdict, deque
from hscommon.trans import tr
from jobprogress import job
from core.engine import Match
@@ -32,7 +33,7 @@ def prepare_pictures(pictures, cache_path, j=job.nulljob):
cache = Cache(cache_path)
prepared = [] # only pictures for which there was no error getting blocks
try:
for picture in j.iter_with_progress(pictures, 'Analyzed %d/%d pictures'):
for picture in j.iter_with_progress(pictures, tr("Analyzed %d/%d pictures")):
picture.dimensions
picture.unicode_path = str(picture.path)
try:
@@ -76,7 +77,7 @@ def async_compare(ref_id, other_ids, dbname, threshold):
def getmatches(pictures, cache_path, threshold=75, match_scaled=False, j=job.nulljob):
j = j.start_subjob([3, 7])
pictures = prepare_pictures(pictures, cache_path, j)
j = j.start_subjob([9, 1], 'Preparing for matching')
j = j.start_subjob([9, 1], tr("Preparing for matching"))
cache = Cache(cache_path)
id2picture = {}
dimensions2pictures = defaultdict(set)
@@ -94,7 +95,7 @@ def getmatches(pictures, cache_path, threshold=75, match_scaled=False, j=job.nul
async_results = deque()
matches = []
pictures_copy = set(pictures)
for ref in j.iter_with_progress(pictures, 'Matched %d/%d pictures'):
for ref in j.iter_with_progress(pictures, tr("Matched %d/%d pictures")):
others = pictures_copy if match_scaled else dimensions2pictures[ref.dimensions]
others.remove(ref)
if ref.is_ref:
@@ -118,7 +119,7 @@ def getmatches(pictures, cache_path, threshold=75, match_scaled=False, j=job.nul
matches.extend(result.get())
result = []
for ref_id, other_id, percentage in j.iter_with_progress(matches, 'Verified %d/%d matches', every=10):
for ref_id, other_id, percentage in j.iter_with_progress(matches, tr("Verified %d/%d matches"), every=10):
ref = id2picture[ref_id]
other = id2picture[other_id]
if percentage == 100 and ref.md5 != other.md5: