mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
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:
@ -2,7 +2,7 @@
|
||||
"My Scene" : {
|
||||
"id" : "main-stage",
|
||||
"type" : "ClutterStage",
|
||||
"title" : "ClutterScript test",
|
||||
"title" : { "translatable" : true, "string" : "ClutterScript test" },
|
||||
"color" : "white",
|
||||
"signals" : [
|
||||
{ "name" : "key-press-event", "handler" : "clutter_main_quit" },
|
||||
@ -62,7 +62,7 @@
|
||||
"type" : "ClutterText",
|
||||
"x" : 50,
|
||||
"y" : 200,
|
||||
"text" : "Clutter\tScript",
|
||||
"text" : { "translatable" : true, "string" : "Clutter Script" },
|
||||
"font-name" : "Sans 24px",
|
||||
"color" : "black",
|
||||
"line-alignment" : "center",
|
||||
|
Reference in New Issue
Block a user