#define _(str) gettext (str)
-/* The Internationalization Tag Set (ITS) 2.0 standard is published at:
+/* The Internationalization Tag Set (ITS) 2.0 standard is available at:
http://www.w3.org/TR/its20/
This implementation supports only a few data categories, useful for
gettext-based projects. Other data categories can be added by
- extending a class from its_rule_class_ty and registering it in
+ extending the its_rule_class_ty class and registering it in
init_classes().
- The value associated with a data category is represented as an
- array of key-value pairs. */
+ The message extraction is done in three phases. In the first
+ phase, its_rule_list_apply() associates values to matching XML
+ elements in the target document. In the second phase, it traverses
+ the tree and marks translatable elements. In the final phase, it
+ extracts text contents from the marked elements.
+
+ The values associated with an XML node are represented as an array
+ of key-value pairs, where both keys and values are string. The
+ values are stored in node->_private. */
#define ITS_NS "http://www.w3.org/2005/11/its"
its_value_list_append (&pop->values, "locNotePointer", prop);
free (prop);
}
+ /* FIXME: locNoteRef and locNoteRefPointer */
}
struct its_value_list_ty *
typedef struct its_rule_list_ty its_rule_list_ty;
+/* Creates a fresh its_rule_list_ty holding global ITS rules. */
extern its_rule_list_ty *its_rule_list_alloc (void);
+/* Releases memory allocated for RULES. */
extern void its_rule_list_free (its_rule_list_ty *rules);
+/* Loads global ITS rules from FILENAME. */
extern bool its_rule_list_add_file (its_rule_list_ty *rules,
const char *filename);
+/* Extracts messages from FP, accoding to the loaded ITS rules. */
extern void its_rule_list_extract (its_rule_list_ty *rules,
FILE *fp, const char *real_filename,
const char *logical_filename,
char *target_uri = NULL;
char *result = NULL;
+ /* FIXME: Implement transformURI (the case locators->is_transform). */
if (!target->is_indirection)
target_uri = xstrdup (target->uri);
else
typedef struct xlocator_list_ty xlocator_list_ty;
+/* Creates a fresh xlocator_list_ty with the base URI BASE, and loads
+ the locating rules from the files in DIRECTORY. */
extern struct xlocator_list_ty *xlocator_list_alloc (const char *base,
const char *directory);
+
+/* Determines the location of resource associated with PATH, accoding
+ to the loaded locating rules. If INSPECT_CONTENT is true, it also
+ checks the content of the file pointed by PATH. */
extern char *xlocator_list_locate (xlocator_list_ty *locators,
const char *path,
bool inspect_content);
+
+/* Releases memory allocated for LOCATORS. */
extern void xlocator_list_free (xlocator_list_ty *locators);
#ifdef __cplusplus