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

@ -188,6 +188,12 @@ gchar * clutter_script_lookup_filename (ClutterScript
GType clutter_script_get_type_from_name (ClutterScript *script,
const gchar *type_name);
CLUTTER_AVAILABLE_IN_1_10
void clutter_script_set_translation_domain (ClutterScript *script,
const gchar *domain);
CLUTTER_AVAILABLE_IN_1_10
const gchar * clutter_script_get_translation_domain (ClutterScript *script);
const gchar * clutter_get_script_id (GObject *gobject);
G_END_DECLS