Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
92ed6f88
Commit
92ed6f88
authored
Nov 01, 2017
by
Jérome Perrin
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bts: translation mapping should be utf-8 encoded strings
parent
3c61a753
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
37 deletions
+33
-37
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.py
...unting/AccountingTransaction_createReversalTransaction.py
+4
-4
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_createRelatedPaymentTransaction.py
...rp5_accounting/Invoice_createRelatedPaymentTransaction.py
+3
-4
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransactionLines.py
...w/accounting_workflow/scripts/validateTransactionLines.py
+5
-8
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.py
...teItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.py
+4
-4
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Order_jumpToInvoice.py
...teItem/portal_skins/erp5_invoicing/Order_jumpToInvoice.py
+4
-4
bt5/erp5_payment_mean/SkinTemplateItem/portal_skins/erp5_payment_mean/PaymentTransaction_jumpToPaymentTransactionGroup.py
..._mean/PaymentTransaction_jumpToPaymentTransactionGroup.py
+6
-6
bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/Person_createUserPreference.py
...l_skins/erp5_web_ung_theme/Person_createUserPreference.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
...teItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
+6
-6
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.py
View file @
92ed6f88
...
@@ -28,11 +28,11 @@ reversal = accounting_module.newContent (
...
@@ -28,11 +28,11 @@ reversal = accounting_module.newContent (
destination_payment_request
=
context
.
getProperty
(
'destination_payment_request'
),
destination_payment_request
=
context
.
getProperty
(
'destination_payment_request'
),
source_administration
=
context
.
getSourceAdministration
(),
source_administration
=
context
.
getSourceAdministration
(),
destination_administration
=
context
.
getDestinationAdministration
(),
destination_administration
=
context
.
getDestinationAdministration
(),
title
=
Base_translateString
(
"Reversal Transaction for ${title}"
,
title
=
Base_translateString
(
"Reversal Transaction for ${title}"
,
mapping
=
{
'title'
:
unicode
(
context
.
getTitleOrId
(),
'utf8'
)}),
mapping
=
{
'title'
:
context
.
getTitleOrId
(
)}),
description
=
Base_translateString
(
description
=
Base_translateString
(
"Reversal Transaction for ${title} (${specific_reference})"
,
"Reversal Transaction for ${title} (${specific_reference})"
,
mapping
=
{
'title'
:
unicode
(
context
.
getTitleOrId
(),
'utf8'
),
mapping
=
{
'title'
:
context
.
getTitleOrId
(
),
'specific_reference'
:
specific_reference
}),
'specific_reference'
:
specific_reference
}),
resource
=
context
.
getResource
(),
resource
=
context
.
getResource
(),
specialise_list
=
context
.
getSpecialiseList
(),
specialise_list
=
context
.
getSpecialiseList
(),
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_createRelatedPaymentTransaction.py
View file @
92ed6f88
...
@@ -37,10 +37,9 @@ if sum(total_payable_price_details.values()) == 0:
...
@@ -37,10 +37,9 @@ if sum(total_payable_price_details.values()) == 0:
related_payment
=
portal
.
accounting_module
.
newContent
(
related_payment
=
portal
.
accounting_module
.
newContent
(
portal_type
=
"Payment Transaction"
,
portal_type
=
"Payment Transaction"
,
title
=
str
(
Base_translateString
(
"Payment of ${invoice_title}"
,
title
=
Base_translateString
(
"Payment of ${invoice_title}"
,
mapping
=
dict
(
invoice_title
=
unicode
((
context
.
getReference
()
or
mapping
=
dict
(
invoice_title
=
(
context
.
getReference
()
or
context
.
getTitle
()
or
''
),
context
.
getTitle
()
or
''
))),
'utf8'
,
'repr'
)))),
source_section
=
context
.
getSourceSection
(),
source_section
=
context
.
getSourceSection
(),
destination_section
=
context
.
getDestinationSection
(),
destination_section
=
context
.
getDestinationSection
(),
source_project
=
context
.
getSourceProject
(),
source_project
=
context
.
getSourceProject
(),
...
...
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransactionLines.py
View file @
92ed6f88
...
@@ -34,22 +34,19 @@ for line in transaction_lines:
...
@@ -34,22 +34,19 @@ for line in transaction_lines:
if
account
is
not
None
and
account
.
getValidationState
()
!=
'validated'
:
if
account
is
not
None
and
account
.
getValidationState
()
!=
'validated'
:
raise
ValidationFailed
,
translateString
(
raise
ValidationFailed
,
translateString
(
"Account ${account_title} is not validated."
,
"Account ${account_title} is not validated."
,
mapping
=
dict
(
account_title
=
unicode
(
mapping
=
dict
(
account_title
=
account
.
Account_getFormattedTitle
()))
account
.
Account_getFormattedTitle
(),
'utf8'
)))
if
third_party
is
not
None
and
\
if
third_party
is
not
None
and
\
third_party
.
getValidationState
()
in
invalid_state_list
:
third_party
.
getValidationState
()
in
invalid_state_list
:
raise
ValidationFailed
,
translateString
(
raise
ValidationFailed
,
translateString
(
"Third party ${third_party_name} is invalid."
,
"Third party ${third_party_name} is invalid."
,
mapping
=
dict
(
third_party_name
=
unicode
(
mapping
=
dict
(
third_party_name
=
third_party
.
getTitle
()))
third_party
.
getTitle
(),
'utf8'
)))
if
bank_account
is
not
None
:
if
bank_account
is
not
None
:
if
bank_account
.
getValidationState
()
in
invalid_state_list
:
if
bank_account
.
getValidationState
()
in
invalid_state_list
:
raise
ValidationFailed
,
translateString
(
raise
ValidationFailed
,
translateString
(
"Bank Account ${bank_account_reference} is invalid."
,
"Bank Account ${bank_account_reference} is invalid."
,
mapping
=
dict
(
bank_account_reference
=
unicode
(
mapping
=
dict
(
bank_account_reference
=
bank_account
.
getReference
()))
bank_account
.
getReference
(),
'utf8'
)))
if
account
is
not
None
and
account
.
isMemberOf
(
'account_type/asset/cash/bank'
):
if
account
is
not
None
and
account
.
isMemberOf
(
'account_type/asset/cash/bank'
):
# also check that currencies are consistent if we use this quantity for
# also check that currencies are consistent if we use this quantity for
...
@@ -60,8 +57,8 @@ for line in transaction_lines:
...
@@ -60,8 +57,8 @@ for line in transaction_lines:
raise
ValidationFailed
,
translateString
(
raise
ValidationFailed
,
translateString
(
"Bank Account ${bank_account_reference} "
"Bank Account ${bank_account_reference} "
"uses ${bank_account_currency} as default currency."
,
"uses ${bank_account_currency} as default currency."
,
mapping
=
dict
(
bank_account_reference
=
unicode
(
bank_account
.
getReference
(),
'utf8'
),
mapping
=
dict
(
bank_account_reference
=
bank_account
.
getReference
(
),
bank_account_currency
=
unicode
(
bank_account
.
getPriceCurrencyReference
(),
'utf8'
)))
bank_account_currency
=
bank_account
.
getPriceCurrencyReference
(
)))
source_currency
=
None
source_currency
=
None
source_section
=
line
.
getSourceSectionValue
()
source_section
=
line
.
getSourceSectionValue
()
...
...
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.py
View file @
92ed6f88
...
@@ -17,10 +17,10 @@ if packing_list_list:
...
@@ -17,10 +17,10 @@ if packing_list_list:
# first, try to get a full translated message with portal types
# first, try to get a full translated message with portal types
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
# if not found, fallback to generic translation
# if not found, fallback to generic translation
default
=
unicode
(
translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
default
=
translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()
}),
'utf8'
))
"that_title"
:
context
.
getTitleOrId
()
}
))
return
related_order_list
[
0
].
Base_redirect
(
'view'
,
return
related_order_list
[
0
].
Base_redirect
(
'view'
,
keep_items
=
dict
(
portal_status_message
=
message
))
keep_items
=
dict
(
portal_status_message
=
message
))
else
:
else
:
...
...
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Order_jumpToInvoice.py
View file @
92ed6f88
...
@@ -18,10 +18,10 @@ if packing_list_list:
...
@@ -18,10 +18,10 @@ if packing_list_list:
# first, try to get a full translated message with portal types
# first, try to get a full translated message with portal types
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
# if not found, fallback to generic translation
# if not found, fallback to generic translation
default
=
unicode
(
translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
default
=
translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()
}),
'utf8'
))
"that_title"
:
context
.
getTitleOrId
()
}
))
return
related_object
.
Base_redirect
(
'view'
,
return
related_object
.
Base_redirect
(
'view'
,
keep_items
=
dict
(
portal_status_message
=
message
))
keep_items
=
dict
(
portal_status_message
=
message
))
else
:
else
:
...
...
bt5/erp5_payment_mean/SkinTemplateItem/portal_skins/erp5_payment_mean/PaymentTransaction_jumpToPaymentTransactionGroup.py
View file @
92ed6f88
...
@@ -13,13 +13,13 @@ for line in context.getMovementList(
...
@@ -13,13 +13,13 @@ for line in context.getMovementList(
# first, try to get a full translated message with portal types
# first, try to get a full translated message with portal types
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
# if not found, fallback to generic translation
# if not found, fallback to generic translation
default
=
unicode
(
translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
default
=
translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()
}),
'utf8'
))))
"that_title"
:
context
.
getTitleOrId
()}
))))
return
context
.
Base_redirect
(
'view'
,
keep_items
=
dict
(
return
context
.
Base_redirect
(
'view'
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
portal_status_message
=
translateString
(
'No %s Related'
%
portal_type
,
'No %s Related'
%
portal_type
,
default
=
unicode
(
translateString
(
'No ${portal_type} related.'
,
default
=
translateString
(
'No ${portal_type} related.'
,
mapping
=
{
'portal_type'
:
translateString
(
portal_type
)}),
'utf8'
))))
mapping
=
{
'portal_type'
:
translateString
(
portal_type
)}
))))
bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/Person_createUserPreference.py
View file @
92ed6f88
...
@@ -17,7 +17,7 @@ preference = portal.portal_preferences.createPreferenceForUser(
...
@@ -17,7 +17,7 @@ preference = portal.portal_preferences.createPreferenceForUser(
context
.
Person_getUserId
(),
enable
=
True
)
context
.
Person_getUserId
(),
enable
=
True
)
preference
.
setTitle
(
translateString
(
'Preference for ${name}'
,
preference
.
setTitle
(
translateString
(
'Preference for ${name}'
,
mapping
=
dict
(
name
=
context
.
getTitle
()
.
decode
(
'utf-8'
)
)))
mapping
=
dict
(
name
=
context
.
getTitle
())))
for
assignment
in
context
.
contentValues
(
portal_type
=
'Assignment'
):
for
assignment
in
context
.
contentValues
(
portal_type
=
'Assignment'
):
group
=
assignment
.
getGroup
(
base
=
True
)
group
=
assignment
.
getGroup
(
base
=
True
)
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.py
View file @
92ed6f88
...
@@ -42,8 +42,8 @@ if len(related_list) == 0:
...
@@ -42,8 +42,8 @@ if len(related_list) == 0:
url
=
context
.
absolute_url
()
url
=
context
.
absolute_url
()
message
=
Base_translateString
(
message
=
Base_translateString
(
'No %s Related'
%
portal_type
[
0
],
'No %s Related'
%
portal_type
[
0
],
default
=
unicode
(
Base_translateString
(
'No ${portal_type} related.'
,
default
=
Base_translateString
(
'No ${portal_type} related.'
,
mapping
=
{
'portal_type'
:
Base_translateString
(
portal_type
[
0
])}),
'utf8'
))
mapping
=
{
'portal_type'
:
Base_translateString
(
portal_type
[
0
])}
))
elif
len
(
related_list
)
==
1
:
elif
len
(
related_list
)
==
1
:
relation_found
=
1
relation_found
=
1
...
@@ -63,10 +63,10 @@ elif len(related_list) == 1:
...
@@ -63,10 +63,10 @@ elif len(related_list) == 1:
# first, try to get a full translated message with portal types
# first, try to get a full translated message with portal types
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
# if not found, fallback to generic translation
# if not found, fallback to generic translation
default
=
unicode
(
Base_translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
default
=
Base_translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()
}),
'utf8'
)
)
"that_title"
:
context
.
getTitleOrId
()
}),
)
else
:
else
:
url
=
context
.
absolute_url
()
url
=
context
.
absolute_url
()
message
=
Base_translateString
(
"You are not authorised to view the related document."
)
message
=
Base_translateString
(
"You are not authorised to view the related document."
)
...
...
Jérome Perrin
@jerome
mentioned in merge request
nexedi/erp5!459 (merged)
·
Nov 02, 2017
mentioned in merge request
nexedi/erp5!459 (merged)
mentioned in merge request nexedi/erp5!459
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment