Commit ace57c90 authored by Yusei Tahara's avatar Yusei Tahara

Replace N_ with translateString.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23278 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6e398c2b
...@@ -68,18 +68,17 @@ ...@@ -68,18 +68,17 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import translateString\n
\n \n
closing_period = state_change[\'object\']\n closing_period = state_change[\'object\']\n
portal = closing_period.getPortalObject()\n portal = closing_period.getPortalObject()\n
N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
valid_state_list = [\'started\', \'stopped\', \'delivered\']\n valid_state_list = [\'started\', \'stopped\', \'delivered\']\n
\n \n
start_date = closing_period.getStartDate()\n start_date = closing_period.getStartDate()\n
stop_date = closing_period.getStopDate()\n stop_date = closing_period.getStopDate()\n
\n \n
if start_date > stop_date:\n if start_date > stop_date:\n
raise ValidationFailed, N_("Start Date is After Stop Date")\n raise ValidationFailed, translateString("Start Date is After Stop Date")\n
\n \n
period_list = closing_period.getParentValue().searchFolder(\n period_list = closing_period.getParentValue().searchFolder(\n
simulation_state=valid_state_list,\n simulation_state=valid_state_list,\n
...@@ -90,7 +89,7 @@ for period in period_list:\n ...@@ -90,7 +89,7 @@ for period in period_list:\n
period = period.getObject()\n period = period.getObject()\n
if period.getSimulationState() in valid_state_list:\n if period.getSimulationState() in valid_state_list:\n
if start_date <= period.getStopDate():\n if start_date <= period.getStopDate():\n
raise ValidationFailed, N_(\n raise ValidationFailed, translateString(\n
"${date} is already in an opened accounting period",\n "${date} is already in an opened accounting period",\n
mapping={\'date\': start_date})\n mapping={\'date\': start_date})\n
\n \n
...@@ -99,7 +98,7 @@ if len(period_list) > 1:\n ...@@ -99,7 +98,7 @@ if len(period_list) > 1:\n
if last_period.getId() == closing_period.getId():\n if last_period.getId() == closing_period.getId():\n
last_period = period_list[-2].getObject()\n last_period = period_list[-2].getObject()\n
if (start_date - last_period.getStopDate()) > 1:\n if (start_date - last_period.getStopDate()) > 1:\n
raise ValidationFailed, N_(\n raise ValidationFailed, translateString(\n
"Last opened period ends on ${last_openned_date},"+\n "Last opened period ends on ${last_openned_date},"+\n
" this period starts on ${this_period_start_date}."+\n " this period starts on ${this_period_start_date}."+\n
" Accounting Periods must be consecutive.",\n " Accounting Periods must be consecutive.",\n
...@@ -153,12 +152,11 @@ if len(period_list) > 1:\n ...@@ -153,12 +152,11 @@ if len(period_list) > 1:\n
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>closing_period</string> <string>closing_period</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string> <string>portal</string>
<string>N_</string>
<string>valid_state_list</string> <string>valid_state_list</string>
<string>start_date</string> <string>start_date</string>
<string>stop_date</string> <string>stop_date</string>
......
...@@ -66,11 +66,10 @@ ...@@ -66,11 +66,10 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n <value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import translateString\n
\n \n
period = state_change[\'object\']\n period = state_change[\'object\']\n
portal = period.getPortalObject()\n portal = period.getPortalObject()\n
N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
\n \n
valid_simulation_state_list = [\'cancelled\', \'delivered\', \'deleted\', \'rejected\']\n valid_simulation_state_list = [\'cancelled\', \'delivered\', \'deleted\', \'rejected\']\n
all_state_list = [x[1] for x in\n all_state_list = [x[1] for x in\n
...@@ -86,7 +85,7 @@ movement_list = portal.portal_simulation.getMovementHistoryList(\n ...@@ -86,7 +85,7 @@ movement_list = portal.portal_simulation.getMovementHistoryList(\n
portal_type=portal.getPortalAccountingMovementTypeList(),)\n portal_type=portal.getPortalAccountingMovementTypeList(),)\n
\n \n
if movement_list:\n if movement_list:\n
raise ValidationFailed, N_(\n raise ValidationFailed, translateString(\n
"All Accounting Transactions for this organisation during the period have"\n "All Accounting Transactions for this organisation during the period have"\n
" to be closed first")\n " to be closed first")\n
</string> </value> </string> </value>
...@@ -135,12 +134,11 @@ if movement_list:\n ...@@ -135,12 +134,11 @@ if movement_list:\n
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>period</string> <string>period</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string> <string>portal</string>
<string>N_</string>
<string>valid_simulation_state_list</string> <string>valid_simulation_state_list</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
......
...@@ -73,10 +73,9 @@ XXX why proxy role ???\n ...@@ -73,10 +73,9 @@ XXX why proxy role ???\n
"""\n """\n
\n \n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import translateString\n
\n \n
transaction = state_change[\'object\']\n transaction = state_change[\'object\']\n
N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
\n \n
# XXX manually default start date to stop date\n # XXX manually default start date to stop date\n
if not transaction.getStartDate() and transaction.getStopDate():\n if not transaction.getStartDate() and transaction.getStopDate():\n
...@@ -99,12 +98,12 @@ destination_section = transaction.getDestinationSectionValue(\n ...@@ -99,12 +98,12 @@ destination_section = transaction.getDestinationSectionValue(\n
portal_type=[\'Organisation\', \'Person\'])\n portal_type=[\'Organisation\', \'Person\'])\n
\n \n
if source_section is None and destination_section is None:\n if source_section is None and destination_section is None:\n
raise ValidationFailed(N_(\'At Least One Section Must be Defined\'))\n raise ValidationFailed(translateString(\'At Least One Section Must be Defined\'))\n
\n \n
# check that no categories are used for section\n # check that no categories are used for section\n
if transaction.getSourceSectionValue(portal_type=\'Category\') is not None or\\\n if transaction.getSourceSectionValue(portal_type=\'Category\') is not None or\\\n
transaction.getDestinationSectionValue(portal_type=\'Category\') is not None:\n transaction.getDestinationSectionValue(portal_type=\'Category\') is not None:\n
raise ValidationFailed(N_(\'Using Category for Section is Invalid\'))\n raise ValidationFailed(translateString(\'Using Category for Section is Invalid\'))\n
\n \n
transaction_line_list = transaction.getMovementList(\n transaction_line_list = transaction.getMovementList(\n
portal_type=transaction.getPortalAccountingMovementTypeList())\n portal_type=transaction.getPortalAccountingMovementTypeList())\n
...@@ -136,8 +135,8 @@ if not skip_period_validation :\n ...@@ -136,8 +135,8 @@ if not skip_period_validation :\n
if apd.getStartDate().Date() <= transaction_date.Date() <= apd.getStopDate().Date():\n if apd.getStartDate().Date() <= transaction_date.Date() <= apd.getStopDate().Date():\n
valid_date = True\n valid_date = True\n
if not valid_date:\n if not valid_date:\n
raise ValidationFailed(N_("Date is not in an opened Accounting Period "\n raise ValidationFailed(translateString("Date is not in an opened Accounting Period "\n
"for source section"))\n "for source section"))\n
# do the same for destination section \n # do the same for destination section \n
if destination_section is not None:\n if destination_section is not None:\n
# if we don\'t have any accounts on this side, we don\'t enforce date checks\n # if we don\'t have any accounts on this side, we don\'t enforce date checks\n
...@@ -160,8 +159,8 @@ if not skip_period_validation :\n ...@@ -160,8 +159,8 @@ if not skip_period_validation :\n
if apd.getStartDate().Date() <= transaction_date.Date() <= apd.getStopDate().Date():\n if apd.getStartDate().Date() <= transaction_date.Date() <= apd.getStopDate().Date():\n
valid_date = True\n valid_date = True\n
if not valid_date:\n if not valid_date:\n
raise ValidationFailed(N_("Date is not in an opened Accounting Period "\n raise ValidationFailed(translateString("Date is not in an opened Accounting Period "\n
"for destination section"))\n "for destination section"))\n
]]></string> </value> ]]></string> </value>
...@@ -228,10 +227,9 @@ if not skip_period_validation :\n ...@@ -228,10 +227,9 @@ if not skip_period_validation :\n
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>transaction</string> <string>transaction</string>
<string>N_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>skip_period_validation</string> <string>skip_period_validation</string>
<string>transition</string> <string>transition</string>
......
...@@ -71,7 +71,7 @@ XXX why proxy role ???\n ...@@ -71,7 +71,7 @@ XXX why proxy role ???\n
"""\n """\n
\n \n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import translateString\n
\n \n
transaction = state_change[\'object\']\n transaction = state_change[\'object\']\n
portal = transaction.getPortalObject()\n portal = transaction.getPortalObject()\n
...@@ -99,21 +99,21 @@ for line in transaction.contentValues(filter=dict(\n ...@@ -99,21 +99,21 @@ for line in transaction.contentValues(filter=dict(\n
):\n ):\n
\n \n
if account is not None and account.getValidationState() != \'validated\':\n if account is not None and account.getValidationState() != \'validated\':\n
raise ValidationFailed, N_(\n raise ValidationFailed, translateString(\n
"Account ${account_title} is not opened",\n "Account ${account_title} is not opened",\n
mapping=dict(account_title=unicode(\n mapping=dict(account_title=unicode(\n
account.Account_getFormattedTitle(), \'utf8\')))\n account.Account_getFormattedTitle(), \'utf8\')))\n
\n \n
if third_party is not None and\\\n if third_party is not None and\\\n
third_party.getValidationState() in invalid_state_list:\n third_party.getValidationState() in invalid_state_list:\n
raise ValidationFailed, N_(\n raise ValidationFailed, translateString(\n
"Third Party ${third_party_name} is invalid",\n "Third Party ${third_party_name} is invalid",\n
mapping=dict(third_party_name=unicode(\n mapping=dict(third_party_name=unicode(\n
third_party.getTitle(), \'utf8\')))\n third_party.getTitle(), \'utf8\')))\n
\n \n
if bank_account is not None and\\\n if bank_account is not None and\\\n
bank_account.getValidationState() in invalid_state_list:\n bank_account.getValidationState() in invalid_state_list:\n
raise ValidationFailed, N_(\n raise ValidationFailed, translateString(\n
"Bank Account ${bank_account_reference} is invalid",\n "Bank Account ${bank_account_reference} is invalid",\n
mapping=dict(bank_account_reference=unicode(\n mapping=dict(bank_account_reference=unicode(\n
bank_account.getReference(), \'utf8\')))\n bank_account.getReference(), \'utf8\')))\n
...@@ -124,7 +124,7 @@ for line in transaction.contentValues(filter=dict(\n ...@@ -124,7 +124,7 @@ for line in transaction.contentValues(filter=dict(\n
bank_account_currency = bank_account.getProperty(\'price_currency\')\n bank_account_currency = bank_account.getProperty(\'price_currency\')\n
if bank_account_currency is not None and \\\n if bank_account_currency is not None and \\\n
bank_account_currency != line.getResource():\n bank_account_currency != line.getResource():\n
raise ValidationFailed, N_(\n raise ValidationFailed, translateString(\n
"Bank Account ${bank_account_reference} "\n "Bank Account ${bank_account_reference} "\n
"uses ${bank_account_currency} as default currency",\n "uses ${bank_account_currency} as default currency",\n
mapping=dict(\n mapping=dict(\n
...@@ -199,7 +199,7 @@ transaction.AccountingTransaction_deleteEmptyLines(redirect=0)\n ...@@ -199,7 +199,7 @@ transaction.AccountingTransaction_deleteEmptyLines(redirect=0)\n
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>transaction</string> <string>transaction</string>
<string>_getattr_</string> <string>_getattr_</string>
......
750 751
\ No newline at end of file \ No newline at end of file
...@@ -66,18 +66,17 @@ ...@@ -66,18 +66,17 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n <value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import translateString\n
N_ = lambda msg, **kwd: Message(\'erp5_ui\', msg, **kwd)\n
\n \n
kwargs = state_change[\'kwargs\']\n kwargs = state_change[\'kwargs\']\n
password = kwargs[\'password\']\n password = kwargs[\'password\']\n
password_confirm = kwargs[\'password_confirm\']\n password_confirm = kwargs[\'password_confirm\']\n
if password != password_confirm:\n if password != password_confirm:\n
raise ValidationFailed(N_(\'Passwords do not match\'))\n raise ValidationFailed(translateString(\'Passwords do not match\'))\n
\n \n
reference = kwargs[\'reference\']\n reference = kwargs[\'reference\']\n
if not reference:\n if not reference:\n
raise ValidationFailed(N_(\'User ID is not specified\'))\n raise ValidationFailed(translateString(\'User ID is not specified\'))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -124,8 +123,7 @@ if not reference:\n ...@@ -124,8 +123,7 @@ if not reference:\n
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>N_</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>kwargs</string> <string>kwargs</string>
<string>password</string> <string>password</string>
......
410 411
\ No newline at end of file \ No newline at end of file
...@@ -65,12 +65,11 @@ ...@@ -65,12 +65,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Message import Message\n <value> <string>from Products.ERP5Type.Message import translateString\n
\n \n
pref = sci[\'object\']\n pref = sci[\'object\']\n
portal = sci.getPortal()\n portal = sci.getPortal()\n
LOG = lambda msg: pref.log("PreferenceWorkflow.disableOtherPreferences on %s"%pref, msg)\n LOG = lambda msg: pref.log("PreferenceWorkflow.disableOtherPreferences on %s"%pref, msg)\n
N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
\n \n
# deactivate all other preferences of the same level \n # deactivate all other preferences of the same level \n
for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
...@@ -83,8 +82,9 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n ...@@ -83,8 +82,9 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
p.portal_workflow.doActionFor(p,\n p.portal_workflow.doActionFor(p,\n
\'disable_action\',\n \'disable_action\',\n
wf_id=\'preference_workflow\', \n wf_id=\'preference_workflow\', \n
comment=N_(\'Automatically disabled when enabling ${preference_title}\',\n comment=translateString(\n
mapping={\'preference_title\': pref.getTitle()}) )\n \'Automatically disabled when enabling ${preference_title}\',\n
mapping={\'preference_title\': pref.getTitle()}))\n
except \'Unauthorized\', a :\n except \'Unauthorized\', a :\n
LOG("not authorized to deactivate %s"%p)\n LOG("not authorized to deactivate %s"%p)\n
</string> </value> </string> </value>
...@@ -137,13 +137,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n ...@@ -137,13 +137,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
<tuple> <tuple>
<string>sci</string> <string>sci</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>translateString</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>pref</string> <string>pref</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string> <string>portal</string>
<string>LOG</string> <string>LOG</string>
<string>N_</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>p</string> <string>p</string>
<string>a</string> <string>a</string>
......
945 946
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment