Commit 0682036e authored by Aurel's avatar Aurel

use "default" domain when specified domain is unknown


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5388 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca8b7f4a
...@@ -23,7 +23,7 @@ except ImportError: ...@@ -23,7 +23,7 @@ except ImportError:
class LocalizerPatchError(Exception): class LocalizerPatchError(Exception):
""""Error wen trying to use or apply the Localizer patch""" """Error wen trying to use or apply the Localizer patch"""
# This patch will not work if Translation Service Zope product exist on the system # This patch will not work if Translation Service Zope product exist on the system
try: try:
...@@ -47,6 +47,8 @@ class LocalizerTranslationService: ...@@ -47,6 +47,8 @@ class LocalizerTranslationService:
message_catalog_aliases = { "Default": "default" message_catalog_aliases = { "Default": "default"
, "ui" : "erp5_ui" , "ui" : "erp5_ui"
, "content": "erp5_content" , "content": "erp5_content"
, "erp5_ui": "erp5_ui"
, "erp5_content": "erp5_content"
} }
# Be carefull to not import Localizer anywhere in that Localizer patch: # Be carefull to not import Localizer anywhere in that Localizer patch:
...@@ -71,7 +73,8 @@ class LocalizerTranslationService: ...@@ -71,7 +73,8 @@ class LocalizerTranslationService:
raise LocalizerPatchError, "Localizer tool not found." raise LocalizerPatchError, "Localizer tool not found."
# Get the Localizer catalog id # Get the Localizer catalog id
catalog_id = message_catalog_aliases.get(domain, domain) catalog_id = message_catalog_aliases.get(domain, 'default')
if catalog_id not in localizer.objectIds(): if catalog_id not in localizer.objectIds():
# No catalog found: return the untranslated string # No catalog found: return the untranslated string
return msgid return msgid
......
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