Closed (fixed)
Project:
Localizer
Version:
4.7.x-1.0
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Nov 2006 at 19:41 UTC
Updated:
14 Dec 2006 at 09:09 UTC
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
Comment #1
Roberto Gerola commentedHi.
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
Comment #2
Roberto Gerola commentedAPI 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