Freeciv-3.2
Loading...
Searching...
No Matches
Macros | Functions
fcintl.h File Reference
#include "freeciv_config.h"
#include "shared.h"

Go to the source code of this file.

Macros

#define _(String)   (String)
 
#define DG_(domain, String)   (String)
 
#define N_(String)   String
 
#define Q_(String)   skip_intl_qualifier_prefix(String)
 
#define PL_(String1, String2, n)   ((n) == 1 ? (String1) : (String2))
 
#define C_(String)   capitalized_string(String)
 
#define R__(String)   (String)
 
#define RQ_(String)   skip_intl_qualifier_prefix(String)
 
#define textdomain(Domain)
 
#define bindtextdomain(Package, Directory)
 
#define Qn_(String)   skip_intl_qualifier_prefix(String)
 

Functions

const charskip_intl_qualifier_prefix (const char *str) fc__attribute((__format_arg__(1)))
 
charcapitalized_string (const char *str)
 
void free_capitalized (char *str)
 
void capitalization_opt_in (bool opt_in)
 
bool is_capitalization_enabled (void)
 
const charget_locale_dir (void)
 

Macro Definition Documentation

◆ _

#define _ (   String)    (String)

Definition at line 67 of file fcintl.h.

◆ bindtextdomain

#define bindtextdomain (   Package,
  Directory 
)

Definition at line 82 of file fcintl.h.

◆ C_

Definition at line 72 of file fcintl.h.

◆ DG_

#define DG_ (   domain,
  String 
)    (String)

Definition at line 68 of file fcintl.h.

◆ N_

#define N_ (   String)    String

Definition at line 69 of file fcintl.h.

◆ PL_

#define PL_ (   String1,
  String2,
  n 
)    ((n) == 1 ? (String1) : (String2))

Definition at line 71 of file fcintl.h.

◆ Q_

Definition at line 70 of file fcintl.h.

◆ Qn_

Definition at line 89 of file fcintl.h.

◆ R__

#define R__ (   String)    (String)

Definition at line 75 of file fcintl.h.

◆ RQ_

Definition at line 76 of file fcintl.h.

◆ textdomain

#define textdomain (   Domain)

Definition at line 81 of file fcintl.h.

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().