[amazon] Add french translations
This commit is contained in:
parent
7e42525958
commit
da859b36a1
1 changed files with 13 additions and 4 deletions
17
modules/amazon/fr/pages.py
Normal file → Executable file
17
modules/amazon/fr/pages.py
Normal file → Executable file
|
|
@ -84,6 +84,7 @@ class OrderPage(AmazonPage):
|
||||||
# finalized payment amounts.
|
# finalized payment amounts.
|
||||||
# Payment for not yet shipped orders may change, and is not always
|
# Payment for not yet shipped orders may change, and is not always
|
||||||
# available.
|
# available.
|
||||||
|
# TODO : Other French status applied ?
|
||||||
return bool([x for s in [u'En préparation pour expédition']
|
return bool([x for s in [u'En préparation pour expédition']
|
||||||
for x in self.doc.xpath(u'//*[contains(text(),"%s")]' % s)])
|
for x in self.doc.xpath(u'//*[contains(text(),"%s")]' % s)])
|
||||||
|
|
||||||
|
|
@ -167,11 +168,12 @@ class OrderNewPage(OrderPage):
|
||||||
return self.amount(u'Livraison :')
|
return self.amount(u'Livraison :')
|
||||||
|
|
||||||
def discount(self):
|
def discount(self):
|
||||||
return self.amount(u'Promotion applied', u'Promotion Applied',
|
# TODO : French translation
|
||||||
u'Subscribe & Save', u'Your Coupon Savings',
|
return self.amount(u'Bon de réduction', u'Subscribe & Save', u'Your Coupon Savings',
|
||||||
u'Lightning Deal')
|
u'Lightning Deal')
|
||||||
|
|
||||||
def gift(self):
|
def gift(self):
|
||||||
|
# TODO : French translation
|
||||||
return self.amount(u'Gift Card Amount')
|
return self.amount(u'Gift Card Amount')
|
||||||
|
|
||||||
def amount(self, *names):
|
def amount(self, *names):
|
||||||
|
|
@ -257,10 +259,12 @@ class OrderOldPage(OrderPage):
|
||||||
return self.sum_amounts(u'TVA:')
|
return self.sum_amounts(u'TVA:')
|
||||||
|
|
||||||
def discount(self):
|
def discount(self):
|
||||||
return self.sum_amounts(u'Subscribe & Save:', u'Promotion applied:',
|
# TODO : French translation
|
||||||
|
return self.sum_amounts(u'Subscribe & Save:', u'Bon de réduction:',
|
||||||
u'Promotion Applied:', u'Your Coupon Savings:')
|
u'Promotion Applied:', u'Your Coupon Savings:')
|
||||||
|
|
||||||
def shipping(self):
|
def shipping(self):
|
||||||
|
# TODO : French translation
|
||||||
return self.sum_amounts(u'Shipping & Handling:', u'Free shipping:',
|
return self.sum_amounts(u'Shipping & Handling:', u'Free shipping:',
|
||||||
u'Free Shipping:')
|
u'Free Shipping:')
|
||||||
|
|
||||||
|
|
@ -270,7 +274,7 @@ class OrderOldPage(OrderPage):
|
||||||
if gift:
|
if gift:
|
||||||
pmt = Payment()
|
pmt = Payment()
|
||||||
pmt.date = self.order_date()
|
pmt.date = self.order_date()
|
||||||
pmt.method = u'GIFT CARD'
|
pmt.method = u'CARTE CADEAU'
|
||||||
pmt.amount = -gift
|
pmt.amount = -gift
|
||||||
yield pmt
|
yield pmt
|
||||||
transactions = list(self.transactions())
|
transactions = list(self.transactions())
|
||||||
|
|
@ -287,6 +291,7 @@ class OrderOldPage(OrderPage):
|
||||||
break
|
break
|
||||||
|
|
||||||
def shipments(self):
|
def shipments(self):
|
||||||
|
# TODO : French translation
|
||||||
for cue in (u'Shipment #', u'Subscribe and Save Shipment'):
|
for cue in (u'Shipment #', u'Subscribe and Save Shipment'):
|
||||||
for shmt in self.doc.xpath('//b[contains(text(),"%s")]' % cue):
|
for shmt in self.doc.xpath('//b[contains(text(),"%s")]' % cue):
|
||||||
yield shmt
|
yield shmt
|
||||||
|
|
@ -335,15 +340,18 @@ class OrderOldPage(OrderPage):
|
||||||
return Decimal(0)
|
return Decimal(0)
|
||||||
|
|
||||||
def gift(self, shmt):
|
def gift(self, shmt):
|
||||||
|
# TODO : French translation
|
||||||
return self.amount(shmt, u'Gift Card Amount:')
|
return self.amount(shmt, u'Gift Card Amount:')
|
||||||
|
|
||||||
def paymethods(self):
|
def paymethods(self):
|
||||||
|
# TODO : French translation
|
||||||
root = self.doc.xpath('//b[text()="Payment Method: "]/..')
|
root = self.doc.xpath('//b[text()="Payment Method: "]/..')
|
||||||
if len(root) == 0:
|
if len(root) == 0:
|
||||||
return
|
return
|
||||||
root = root[0]
|
root = root[0]
|
||||||
text = root.text_content().strip()
|
text = root.text_content().strip()
|
||||||
while text:
|
while text:
|
||||||
|
# TODO : French translation
|
||||||
for pattern in [
|
for pattern in [
|
||||||
u'^.*Payment Method:',
|
u'^.*Payment Method:',
|
||||||
u'^([^\n]+)\n +\| Last digits: +([0-9]+)\n',
|
u'^([^\n]+)\n +\| Last digits: +([0-9]+)\n',
|
||||||
|
|
@ -359,6 +367,7 @@ class OrderOldPage(OrderPage):
|
||||||
break
|
break
|
||||||
|
|
||||||
def transactions(self):
|
def transactions(self):
|
||||||
|
# TODO : French translation
|
||||||
for tr in self.doc.xpath(
|
for tr in self.doc.xpath(
|
||||||
u'//div[contains(b,"Credit Card transactions")]'
|
u'//div[contains(b,"Credit Card transactions")]'
|
||||||
u'/following-sibling::table[1]/tr'):
|
u'/following-sibling::table[1]/tr'):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue