I admit I haven't tested the module yet, so this might be a dumb question, but it looks so promissing, that I just had to ask - does the module have an api for other modules to use?
for example - is it possible to add support for combining the results of webforms form two different languages? (if the answer s yes - I'm volunteering to do the webform.inc or whatever it is)

Comments

Roberto Gerola’s picture

Hi.
Yes, some APIs are already present :
- localizer_getnids($nid) : returns an array of translated nids
- localizer_getlocalizednid($_nid, $_locale) : returns the specified translated nid
- localizer_getnodelocale($_path) : returns the locale of the $path
- localizer_getlocalizednode($_nid, $_locale) : returns the localized node
- localizer_localizenode(&$_node, $_locale) : localize a node
- localizer_getlocalizedpath($_path, $_locale) : returns a localized path

I'd like to start a discussion how to implement a better support for external modules.
At now the support for poll and taxonomy modules is implemented through patches.

I think that, extending the modules with some hooks and perhaps using the db_rewrite hook,
(like i18n module already do) we can avoid to patch the external modules.

>to add support for combining the results of webforms form two different languages
Yes, it should be possible. I've already implemented a similar feature to poll module.

--
http://www.speedtech.it

Roberto Gerola’s picture

Status: Active » Closed (fixed)

API for internal translation engine are now available (localizer.module file) for version 2.x
localizer_save_objtrs
localizer_save_objtrs_fromform
localizer_delete_objtrs
localizer_get_objtrs
localizer_get_currobjtrs
localizer_get_objstrs
localizer_get_objfieldtr
localizer_get_currobjfieldtr