Hi, can you help me to adapt the code that shows ebook reading status in custom column to French please?
In the comments, there is:
Code:
05/07/13
Dernière page lue : Emplacement 6514 (99%)
instead of:
Code:
1/24/2011
Last Page Read: Location 721 (99%)
I've tried:
Code:
def evaluate(self, formatter, kwargs, mi, locals, val, is_read_pct,
is_reading_str, no_page_read_str):
try:
test_val = int(is_read_pct)
except:
return 'is_read_pct is not a number'
import re
mg = re.match('.*\s(\d+[-/]\d+[-/]\d+).*?Dernière page lue : Emplacement \d+ \((\d+)%\)', val, re.I + re.DOTALL);
if mg is None:
return no_page_read_str
date = mg.group(1)
pct = mg.group(2)
try:
f = int(pct)
if f > test_val:
return date
elif f > 0:
return is_reading_str + ': ' + pct + '%'
except:
pass
return no_page_read_str
but it does't work...