From 9683d93dc81f7803c2a1a82f9d64e7605feadce1 Mon Sep 17 00:00:00 2001 From: Kennyl Date: Mon, 23 Jan 2017 23:35:02 +0800 Subject: [PATCH] Better translation on nav bar Translate navbar to brief chinese word from feedback --- recipes/apple_daily.recipe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/apple_daily.recipe b/recipes/apple_daily.recipe index 728609d776..3f8963321e 100644 --- a/recipes/apple_daily.recipe +++ b/recipes/apple_daily.recipe @@ -262,8 +262,8 @@ class AppleDaily(BasicNewsRecipe): not self.has_single_feed, a.orig_url, __appname__, prefix=prefix, center=self.center_navbar) - elem = BeautifulSoup(templ.render( - doctype='xhtml').decode('utf-8')).find('div') + translatedTempl =re.sub('
.*

','
蘋果日報下載至'+__appname__+'

',templ.render(doctype='xhtml').decode('utf-8'),flags=re.S) + elem = BeautifulSoup(translatedTempl).find('div') body.insert(len(body.contents), elem) with open(last, 'wb') as fi: fi.write(unicode(soup).encode('utf-8'))