GtrMsg

## GtrMsg GtrMsg |

## Synopsis

    struct              GtrMsg;
    struct              GtrMsgClass;
    enum                GtrMsgStatus;
    gboolean            gtr_msg_is_translated               (GtrMsg *msg);
    gboolean            gtr_msg_is_fuzzy                    (GtrMsg *msg);
    void                gtr_msg_set_fuzzy                   (GtrMsg *msg,
                                                             gboolean fuzzy);
    GtrMsgStatus        gtr_msg_get_status                  (GtrMsg *msg);
    void                gtr_msg_set_status                  (GtrMsg *msg,
                                                             GtrMsgStatus status);
    const gchar *       gtr_msg_get_msgid                   (GtrMsg *msg);
    const gchar *       gtr_msg_get_msgid_plural            (GtrMsg *msg);
    const gchar *       gtr_msg_get_msgstr                  (GtrMsg *msg);
    void                gtr_msg_set_msgstr                  (GtrMsg *msg,
                                                             const gchar *msgstr);
    const gchar *       gtr_msg_get_msgstr_plural           (GtrMsg *msg,
                                                             gint index);
    void                gtr_msg_set_msgstr_plural           (GtrMsg *msg,
                                                             gint index,
                                                             const gchar *msgstr);
    const gchar *       gtr_msg_get_comment                 (GtrMsg *msg);
    void                gtr_msg_set_comment                 (GtrMsg *msg,
                                                             const gchar *comment);
    gint                gtr_msg_get_po_position             (GtrMsg *msg);
    void                gtr_msg_set_po_position             (GtrMsg *msg,
                                                             gint po_position);
    const gchar *       gtr_msg_get_extracted_comments      (GtrMsg *msg);
    const gchar *       gtr_msg_get_filename                (GtrMsg *msg,
                                                             gint i);
    gint *              gtr_msg_get_file_line               (GtrMsg *msg,
                                                             gint i);
    const gchar *       gtr_msg_get_msgctxt                 (GtrMsg *msg);
    const gchar *       gtr_msg_get_format                  (GtrMsg *msg);
    gchar *             gtr_msg_check                       (GtrMsg *msg);

## Description

## Details

### struct GtrMsg

    struct GtrMsg {
      GObject parent_instance;
    };

### struct GtrMsgClass

    struct GtrMsgClass {
      GObjectClass parent_class;
    };

### enum GtrMsgStatus

    typedef enum {
      GTR_MSG_STATUS_UNTRANSLATED,
      GTR_MSG_STATUS_FUZZY,
      GTR_MSG_STATUS_TRANSLATED
    } GtrMsgStatus;

`GTR_MSG_STATUS_UNTRANSLATED` |
`GTR_MSG_STATUS_FUZZY` |
`GTR_MSG_STATUS_TRANSLATED` |

### gtr_msg_is_translated ()

    gboolean            gtr_msg_is_translated               (GtrMsg *msg);

Gets whether or not the message is translated. See that a fuzzy message is also counted as translated so it must be checked first that the message is fuzzy.

`msg` : | a GtrMsg
Returns : | `TRUE` if the message is translated

### gtr_msg_is_fuzzy ()

    gboolean            gtr_msg_is_fuzzy                    (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | TRUE if the message is fuzzy

### gtr_msg_set_fuzzy ()

    void                gtr_msg_set_fuzzy                   (GtrMsg *msg,
                                                             gboolean fuzzy);

Change the fuzzy mark of a message.

`msg` : | a GtrMsg
`fuzzy` : | the fuzzy value to set to the message

### gtr_msg_get_status ()

    GtrMsgStatus        gtr_msg_get_status                  (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the message's status.

### gtr_msg_set_status ()

    void                gtr_msg_set_status                  (GtrMsg *msg,
                                                             GtrMsgStatus status);

Sets the status for a message.

`msg` : | a GtrMsg
`status` : | a GtrMsgStatus

### gtr_msg_get_msgid ()

    const gchar *       gtr_msg_get_msgid                   (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the msgid (untranslated English string) of a message.

### gtr_msg_get_msgid_plural ()

    const gchar *       gtr_msg_get_msgid_plural            (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the msgid_plural (untranslated English plural string) of a message, or NULL for a message without plural. [transfer none]

### gtr_msg_get_msgstr ()

    const gchar *       gtr_msg_get_msgstr                  (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the msgstr (translation) of a message. Return the empty string for an untranslated message. [transfer none]

### gtr_msg_set_msgstr ()

    void                gtr_msg_set_msgstr                  (GtrMsg *msg,
                                                             const gchar *msgstr);

Change the msgstr (translation) of a message. Use an empty string to denote an untranslated message.

`msg` : | a GtrMsg
`msgstr` : | the string to set in the `msg`

### gtr_msg_get_msgstr_plural ()

    const gchar *       gtr_msg_get_msgstr_plural           (GtrMsg *msg,
                                                             gint index);

`msg` : | a GtrMsg
`index` : | the index of the plural array
Returns : | the msgstr[index] for a message with plural handling, or NULL when the index is out of range or for a message without plural. [transfer none]

### gtr_msg_set_msgstr_plural ()

    void                gtr_msg_set_msgstr_plural           (GtrMsg *msg,
                                                             gint index,
                                                             const gchar *msgstr);

Change the msgstr[index] for a message with plural handling. Use a NULL value at the end to reduce the number of plural forms.

`msg` : | a GtrMsg
`index` : | the index where to set the msgstr
`msgstr` : | the message to set in the msg

### gtr_msg_get_comment ()

    const gchar *       gtr_msg_get_comment                 (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | (transfer none) the comments for a message.

### gtr_msg_set_comment ()

    void                gtr_msg_set_comment                 (GtrMsg *msg,
                                                             const gchar *comment);

Change the comments for a message. comments should be a multiline string, ending in a newline, or empty.

`msg` : | a GtrMsg
`comment` : | the comment to set for a message

### gtr_msg_get_po_position ()

    gint                gtr_msg_get_po_position             (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the position of the message. Gets the position of this message in the PO file in relation to the other messages.

### gtr_msg_set_po_position ()

    void                gtr_msg_set_po_position             (GtrMsg *msg,
                                                             gint po_position);

Sets the numerical position of this message in relation to other messages.

`msg` : | a GtrMsg
`po_position` : | the numerical position of the message.

### gtr_msg_get_extracted_comments ()

    const gchar *       gtr_msg_get_extracted_comments      (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the extracted comments for a message. [transfer none]

### gtr_msg_get_filename ()

    const gchar *       gtr_msg_get_filename                (GtrMsg *msg,
                                                             gint i);

`msg` : | a GtrMsg
`i` : | the i-th file for a message.
Returns : | the i-th filename for a message, or NULL if `i` is out of range. [transfer none]

### gtr_msg_get_file_line ()

    gint *              gtr_msg_get_file_line               (GtrMsg *msg,
                                                             gint i);

`msg` : | a GtrMsg
`i` : | the i-th file for a message.
Returns : | the i-th file line for a message, or NULL if `i` is out of range. [transfer none]

### gtr_msg_get_msgctxt ()

    const gchar *       gtr_msg_get_msgctxt                 (GtrMsg *msg);

`msg` : | a GtrMsg
Returns : | the context of a message, or NULL for a message not restricted to a context. [transfer none]

### gtr_msg_get_format ()

    const gchar *       gtr_msg_get_format                  (GtrMsg *msg);

Return the pretty name associated with a format type. For example, for "csharp-format", return "C#". Return NULL if the are no format type in the message.

`msg` : | a GtrMsg
Returns : | the pretty name associated with a format type or NULL if the message hasn't any format type. [transfer none]

### gtr_msg_check ()

    gchar *             gtr_msg_check                       (GtrMsg *msg);

Test whether the message translation is a valid format string if the message is marked as being a format string.

`msg` : | a GtrMsg
Returns : | the message error or NULL if there is not any error. Must be freed with g_free. [transfer full]