script: Support translatable strings for properties

ClutterScript should be able to automatically call gettext() and friends
on strings loaded from a UI definition, prior to passing the string to
the object it is constructing.

The basic implementation is trivial:

  - set a translation domain on the ClutterScript instance
  - mark the translatable strings inside the JSON data, like:

      "property" : {
        "translatable" : true,
        "string" : "a translatable string"
      }

The hard part is now getting the tools we use to extract the
translatable strings to understand the JSON format we use inside
ClutterScript.
This commit is contained in:
Emmanuele Bassi
2012-03-06 14:23:33 +00:00
parent 4a9414ff87
commit 7646404196
5 changed files with 162 additions and 2 deletions

View File

@ -130,6 +130,9 @@ gboolean _clutter_script_parse_color (ClutterScript *script,
ClutterColor *color);
GObject *_clutter_script_parse_alpha (ClutterScript *script,
JsonNode *node);
gboolean _clutter_script_parse_translatable_string (ClutterScript *script,
JsonNode *node,
char **str);
void _clutter_script_construct_object (ClutterScript *script,
ObjectInfo *oinfo);