## GtrMsg

GtrMsg

## Functions

gboolean | gtr_msg_is_translated ()
gboolean | gtr_msg_is_fuzzy ()
void | gtr_msg_set_fuzzy ()
GtrMsgStatus | gtr_msg_get_status ()
void | gtr_msg_set_status ()
const gchar * | gtr_msg_get_msgid ()
const gchar * | gtr_msg_get_msgid_plural ()
const gchar * | gtr_msg_get_msgstr ()
void | gtr_msg_set_msgstr ()
const gchar * | gtr_msg_get_msgstr_plural ()
void | gtr_msg_set_msgstr_plural ()
const gchar * | gtr_msg_get_comment ()
void | gtr_msg_set_comment ()
gint | gtr_msg_get_po_position ()
void | gtr_msg_set_po_position ()
const gchar * | gtr_msg_get_extracted_comments ()
const gchar * | gtr_msg_get_filename ()
gint * | gtr_msg_get_file_line ()
const gchar * | gtr_msg_get_msgctxt ()
const gchar * | gtr_msg_get_format ()
gchar * | gtr_msg_check ()

## Types and Values

enum | GtrMsgStatus

## Description

## Functions

### 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.

#### Parameters

msg | a GtrMsg |

#### Returns

`TRUE` if the message is translated

### gtr_msg_is_fuzzy ()

    gboolean
    gtr_msg_is_fuzzy (GtrMsg *msg);

#### Parameters

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.

#### Parameters

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

### gtr_msg_get_status ()

    GtrMsgStatus
    gtr_msg_get_status (GtrMsg *msg);

#### Parameters

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.

#### Parameters

msg | a GtrMsg |
status | a GtrMsgStatus |

### gtr_msg_get_msgid ()

    const gchar *
    gtr_msg_get_msgid (GtrMsg *msg);

#### Parameters

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);

#### Parameters

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);

#### Parameters

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.

#### Parameters

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);

#### Parameters

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.

#### Parameters

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);

#### Parameters

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.

#### Parameters

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

### gtr_msg_get_po_position ()

    gint
    gtr_msg_get_po_position (GtrMsg *msg);

#### Parameters

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.

#### Parameters

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);

#### Parameters

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);

#### Parameters

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);

#### Parameters

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);

#### Parameters

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.

#### Parameters

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.

#### Parameters

msg | a GtrMsg |

#### Returns

the message error or NULL if there is not any error. Must be freed with g_free.

[transfer full]

## Types and Values

### enum GtrMsgStatus

#### Members

GTR_MSG_STATUS_UNTRANSLATED |  |
GTR_MSG_STATUS_FUZZY |  |
GTR_MSG_STATUS_TRANSLATED |  |