Freeciv-3.1: /fast/freeciv/nightly/S3_1/utility/fcintl.c File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Functions | Variables
fcintl.c File Reference
`#include <string.h>`
`#include "mem.h"`
`#include "fcintl.h"`

Go to the source code of this file.

## Functions

const char * | skip_intl_qualifier_prefix (const char *str)
char * | capitalized_string (const char *str)
void | free_capitalized (char *str)
void | capitalization_opt_in (bool opt_in)
bool | is_capitalization_enabled (void)
const char * | get_locale_dir (void)

## Variables

static bool | autocap = FALSE

## Function Documentation

## ◆ capitalization_opt_in()

void capitalization_opt_in | ( | bool | opt_in | ) |

Translation opts in to automatic capitalization features.

Definition at line 93 of file fcintl.c.

## ◆ capitalized_string()

char * capitalized_string | ( | const char * | str | ) |

This function tries to capitalize first letter of the string. Currently this handles just single byte UTF-8 characters, since those are same as ASCII.

Definition at line 66 of file fcintl.c.

Referenced by package_event_full().

## ◆ free_capitalized()

void free_capitalized | ( | char * | str | ) |

Free capitalized string.

Definition at line 85 of file fcintl.c.

Referenced by package_event_full().

## ◆ get_locale_dir()

const char * get_locale_dir | ( | void |  | ) |

Return directory containing locales. In a rare cases this can be a relative path, but it tries to return absolute path when ever possible.

Definition at line 111 of file fcintl.c.

Referenced by client_main(), init_nls(), main(), srv_init(), and switch_lang().

## ◆ is_capitalization_enabled()

bool is_capitalization_enabled | ( | void |  | ) |

Automatic capitalization features requested.

Definition at line 101 of file fcintl.c.

Referenced by package_event_full().

## ◆ skip_intl_qualifier_prefix()

const char * skip_intl_qualifier_prefix | ( | const char * | str | ) |

Some strings are ambiguous for translation. For example, "Game" is something you play (like Freeciv!) or animals that can be hunted. To distinguish strings for translation, we qualify them with a prefix string of the form "?qualifier:". So, the above two cases might be: "Game" – when used as meaning something you play "?animals:Game" – when used as animals to be hunted Notice that only the second is qualified; the first is processed in the normal gettext() manner (as at most one ambiguous string can be).

This function tests for, and removes if found, the qualifier prefix part of a string.

This function is called by the Q_() macro and specenum. If used in the Q_() macro it should, if NLS is enabled, have called gettext() to get the argument to pass to this function. Specenum use it untranslated.

Definition at line 48 of file fcintl.c.

Referenced by help_widget::anchor_clicked(), get_tooltip_improvement(), help_hyperlink_callback(), help_update_improvement(), help_update_unit_type(), help_update_wonder(), names_set(), and save_name_translation().

## Variable Documentation

## ◆ autocap

bool autocap = FALSE

static

Definition at line 29 of file fcintl.c.

Referenced by capitalization_opt_in(), capitalized_string(), and is_capitalization_enabled().