X-Git-Url: http://review.tizen.org/git/?p=framework%2Fuifw%2Felementary.git;a=blobdiff_plain;f=src%2Flib%2Felm_object_item.h;h=8ea325fae781fd328dfb16d270da184371c56392;hp=bad0754432d307db934625a30ae3901f7b03588b;hb=d215ac8135d866b5486d3a91f3f9daedf4059a38;hpb=25ee5b1debf1e5d278265ade368bab575b79412b diff --git a/src/lib/elm_object_item.h b/src/lib/elm_object_item.h index bad0754..8ea325f 100644 --- a/src/lib/elm_object_item.h +++ b/src/lib/elm_object_item.h @@ -115,6 +115,54 @@ EAPI const char *elm_object_item_part_text_get(const Elm_Object #define elm_object_item_text_get(it) elm_object_item_part_text_get((it), NULL) /** + * Set the text for an object item's part, marking it as translatable. + * + * The string to set as @p text must be the original one. Do not pass the + * return of @c gettext() here. Elementary will translate the string + * internally and set it on the object item using + * elm_object_item_part_text_set(), also storing the original string so that it + * can be automatically translated when the language is changed with + * elm_language_set(). The @p domain will be stored along to find the + * translation in the correct catalog. It can be NULL, in which case it will use + * whatever domain was set by the application with @c textdomain(). This is + * useful in case you are building a library on top of Elementary that will have + * its own translatable strings, that should not be mixed with those of programs + * using the library. + * + * @param it The object item containing the text part + * @param part The name of the part to set + * @param domain The translation domain to use + * @param text The original, non-translated text to set + * + * @ingroup General + * @since 1.8 + */ +EAPI void elm_object_item_domain_translatable_part_text_set(Elm_Object_Item *it, const char *part, const char *domain, const char *text); + +#define elm_object_item_domain_translatable_text_set(it, domain, text) elm_object_item_domain_translatable_part_text_set((it), NULL, (domain), (text)) + +#define elm_object_item_translatable_text_set(it, text) elm_object_item_domain_translatable_part_text_set((it), NULL, NULL, (text)) + +/** + * Gets the original string set as translatable for an object item. + * + * When setting translated strings, the function elm_object_item_part_text_get() + * will return the translation returned by @c gettext(). To get the original + * string use this function. + * + * @param it The object item. + * @param part The name of the part that was set + * + * @return The original, untranslated string + * + * @ingroup General + * @since 1.8 + */ +EAPI const char *elm_object_item_translatable_part_text_get(const Elm_Object_Item *it, const char *part); + +#define elm_object_item_translatable_text_get(it) elm_object_item_translatable_part_text_get((it), NULL) + +/** * Set the text to read out when in accessibility mode * * @param it The object item which is to be described