19 |
$Id$ |
$Id$ |
20 |
'''.strip() |
'''.strip() |
21 |
|
|
22 |
|
from AccessControl import ModuleSecurityInfo, allow_module, allow_class, allow_type |
23 |
from PlacelessTranslationService import PlacelessTranslationService, log |
from PlacelessTranslationService import PlacelessTranslationService, log |
24 |
|
from Negotiator import negotiate |
25 |
from GettextMessageCatalog import GettextMessageCatalog |
from GettextMessageCatalog import GettextMessageCatalog |
26 |
from Products.PageTemplates.GlobalTranslationService import setGlobalTranslationService |
from Products.PageTemplates.GlobalTranslationService import setGlobalTranslationService |
27 |
import os, glob, zLOG, sys |
import os, glob, zLOG, sys |
34 |
# set the translation service |
# set the translation service |
35 |
setGlobalTranslationService(translation_service) |
setGlobalTranslationService(translation_service) |
36 |
|
|
37 |
|
translate = translation_service.translate |
38 |
|
getLanguages = translation_service.getLanguages |
39 |
|
getLanguageName = translation_service.getLanguageName |
40 |
|
|
41 |
|
security = ModuleSecurityInfo('Products.PlacelessTranslationService') |
42 |
|
security.declarePublic('negotiate') |
43 |
|
security.declarePublic('translate') |
44 |
|
security.declarePublic('getLanguages') |
45 |
|
security.declarePublic('getLanguageName') |
46 |
|
|
47 |
# sweep the i18n directory |
# sweep the i18n directory |
48 |
basepath = os.path.join(INSTANCE_HOME, 'i18n') |
basepath = os.path.join(INSTANCE_HOME, 'i18n') |
49 |
if os.path.isdir(basepath): |
if os.path.isdir(basepath): |