Freeciv21
Develop your civilization from humble roots to a global empire
fcintl.cpp File Reference
#include <fc_config.h>
#include <cstring>
#include "fcintl.h"
+ Include dependency graph for fcintl.cpp:

Go to the source code of this file.

Functions

const char * skip_intl_qualifier_prefix (const char *str)
 Some strings are ambiguous for translation. More...
 
char * capitalized_string (const char *str)
 This function tries to capitalize first letter of the string. More...
 
void free_capitalized (char *str)
 Free capitalized string. More...
 
void capitalization_opt_in (bool opt_in)
 Translation opts in to automatic capitalization features. More...
 
bool is_capitalization_enabled ()
 Automatic capitalization features requested. More...
 
const char * get_locale_dir ()
 Return directory containing locales. More...
 

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 84 of file fcintl.cpp.

◆ 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 57 of file fcintl.cpp.

Referenced by package_event_full().

◆ free_capitalized()

void free_capitalized ( char *  str)

Free capitalized string.

Definition at line 75 of file fcintl.cpp.

◆ get_locale_dir()

const char* get_locale_dir ( )

Return directory containing locales.

Definition at line 94 of file fcintl.cpp.

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

◆ is_capitalization_enabled()

bool is_capitalization_enabled ( )

Automatic capitalization features requested.

Definition at line 89 of file fcintl.cpp.

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 39 of file fcintl.cpp.

Referenced by help_widget::anchor_clicked(), get_tooltip_improvement(), names_set(), and save_name_translation().

Variable Documentation

◆ autocap

bool autocap = false
static

Definition at line 20 of file fcintl.cpp.

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