Clean up call to fribidi, add capabilities to insert values to the _ macro
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7508 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -26,7 +26,7 @@ echo "---------------------------"
|
||||
echo " Generating .pot file..."
|
||||
|
||||
# C++ Files
|
||||
xgettext -d supertuxkart -s --keyword=_ --add-comments="I18N:" -p ./data/po -o supertuxkart.pot $CPP_FILE_LIST --package-name=supertuxkart
|
||||
xgettext -d supertuxkart -s --keyword=_ --keyboard=_LTR --add-comments="I18N:" -p ./data/po -o supertuxkart.pot $CPP_FILE_LIST --package-name=supertuxkart
|
||||
|
||||
# Lisp files
|
||||
xgettext -j -L lisp -d supertuxkart -s --keyword=_ --add-comments="I18N:" -p ./data/po -o supertuxkart.pot $XML_FILE_LIST --package-name=supertuxkart
|
||||
|
||||
@@ -42,14 +42,12 @@ const irr::core::stringw UnlockableFeature::getUnlockedMessage() const
|
||||
// shouldn't happen but let's avoid crashes as much as possible...
|
||||
if (track == NULL) return irr::core::stringw( L"????" );
|
||||
|
||||
return StringUtils::insertValues(_("New track '%s' now available"),
|
||||
track->getName().c_str() );
|
||||
return _("New track '%s' now available", track->getName());
|
||||
break;
|
||||
}
|
||||
case UNLOCK_MODE:
|
||||
{
|
||||
return StringUtils::insertValues(_("New game mode '%s' now available"),
|
||||
user_name.c_str());
|
||||
return _("New game mode '%s' now available", user_name);
|
||||
}
|
||||
case UNLOCK_GP:
|
||||
{
|
||||
@@ -59,13 +57,11 @@ const irr::core::stringw UnlockableFeature::getUnlockedMessage() const
|
||||
if (gp == NULL) return irr::core::stringw( L"????" );
|
||||
|
||||
const irr::core::stringw& gp_user_name = gp->getName();
|
||||
return StringUtils::insertValues(_("New Grand Prix '%s' now available"),
|
||||
gp_user_name.c_str());
|
||||
return _("New Grand Prix '%s' now available", gp_user_name);
|
||||
}
|
||||
case UNLOCK_DIFFICULTY:
|
||||
{
|
||||
return StringUtils::insertValues(_("New difficulty '%s' now available"),
|
||||
user_name.c_str());
|
||||
return _("New difficulty '%s' now available", user_name);
|
||||
}
|
||||
case UNLOCK_KART:
|
||||
{
|
||||
@@ -74,8 +70,7 @@ const irr::core::stringw UnlockableFeature::getUnlockedMessage() const
|
||||
// shouldn't happen but let's avoid crashes as much as possible...
|
||||
if (kp == NULL) return irr::core::stringw( L"????" );
|
||||
|
||||
return StringUtils::insertValues( _("New kart '%s' now available"),
|
||||
kp->getName().c_str());
|
||||
return _("New kart '%s' now available", kp->getName());
|
||||
}
|
||||
default:
|
||||
assert(false);
|
||||
|
||||
@@ -249,30 +249,23 @@ irr::core::stringw Binding::getAsString() const
|
||||
break;
|
||||
case Input::IT_STICKMOTION:
|
||||
//I18N: to appear in input configuration screen, for gamepad axes
|
||||
s = StringUtils::insertValues( _("Axis %d %s"), m_id,
|
||||
(m_dir == Input::AD_NEGATIVE)
|
||||
? L"-"
|
||||
: L"+");
|
||||
s = _("Axis %d %s", m_id, (m_dir == Input::AD_NEGATIVE) ? L"-" : L"+");
|
||||
break;
|
||||
case Input::IT_STICKBUTTON:
|
||||
//I18N: to appear in input configuration screen, for gamepad buttons
|
||||
s = StringUtils::insertValues( _("Gamepad button %d"),
|
||||
(m_id+1));
|
||||
s = ( _("Gamepad button %d", m_id+1));
|
||||
break;
|
||||
case Input::IT_STICKHAT:
|
||||
//I18N: to appear in input configuration screen, for gamepad hats
|
||||
s = StringUtils::insertValues( _("Gamepad hat %d"), (m_id+1));
|
||||
s = _("Gamepad hat %d", (m_id+1));
|
||||
break;
|
||||
case Input::IT_MOUSEBUTTON:
|
||||
//I18N: to appear in input configuration screen, for mouse (might not be used at all)
|
||||
s = StringUtils::insertValues( _("Mouse button %d"), (m_id+1));
|
||||
s = _("Mouse button %d", (m_id+1));
|
||||
break;
|
||||
case Input::IT_MOUSEMOTION: // FIXME : I don't reckon this is used at all
|
||||
//I18N: to appear in input configuration screen, for mouse (might not be used at all)
|
||||
s = StringUtils::insertValues( _("Mouse axis %d %s"),
|
||||
(m_id+1),
|
||||
(m_dir == Input::AD_NEGATIVE)
|
||||
? '-': '+' );
|
||||
s = _("Mouse axis %d %s", (m_id+1), (m_dir == Input::AD_NEGATIVE) ? '-': '+');
|
||||
break;
|
||||
default:
|
||||
s = "?";
|
||||
|
||||
@@ -516,8 +516,8 @@ void InputManager::dispatchInput(Input::InputType type, int deviceID, int button
|
||||
abs(value)>gp->m_deadzone)
|
||||
{
|
||||
//I18N: message shown when an input device is used but is not associated to any player
|
||||
GUIEngine::showMessage(StringUtils::insertValues(_("Ignoring '%s', you needed to join earlier to play!"),
|
||||
irr::core::stringw(gp->m_name.c_str()).c_str() ).c_str());
|
||||
GUIEngine::showMessage(_("Ignoring '%s', you needed to join earlier to play!",
|
||||
irr::core::stringw(gp->m_name.c_str()).c_str()));
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -308,7 +308,7 @@ void LinearWorld::newLap(unsigned int kart_index)
|
||||
}
|
||||
else if (kart_info.m_race_lap > 0 && kart_info.m_race_lap+1 < lap_count)
|
||||
{
|
||||
m_race_gui->addMessage(StringUtils::insertValues(_("Lap %i"), kart_info.m_race_lap+1),
|
||||
m_race_gui->addMessage(_("Lap %i", kart_info.m_race_lap+1),
|
||||
m_karts[kart_index], 3.0f, 40, video::SColor(255, 210, 100, 50), true);
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ void LinearWorld::newLap(unsigned int kart_index)
|
||||
|
||||
irr::core::stringw m_fastest_lap_message;
|
||||
//I18N: as in "fastest lap: 60 seconds by Wilber"
|
||||
m_fastest_lap_message += StringUtils::insertValues(_("%s by %s"), s.c_str(), kart->getName().c_str()).c_str();
|
||||
m_fastest_lap_message += _("%s by %s", s.c_str(), kart->getName().c_str());
|
||||
|
||||
m_race_gui->addMessage(m_fastest_lap_message, NULL,
|
||||
2.0f, 40, video::SColor(255, 100, 210, 100));
|
||||
|
||||
@@ -739,9 +739,8 @@ void World::removeKart(int kart_number, bool notifyOfElimination)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_race_gui->addMessage(StringUtils::insertValues(_("'%s' has been eliminated."),
|
||||
kart->getName().c_str()),
|
||||
*i, 2.0f, 60);
|
||||
m_race_gui->addMessage(_("'%s' has been eliminated.", kart->getName().c_str()),
|
||||
*i, 2.0f, 60);
|
||||
}
|
||||
} // for i in kart
|
||||
}
|
||||
|
||||
@@ -62,16 +62,13 @@ AddonsLoading::AddonsLoading(const float w, const float h,
|
||||
getWidget<ButtonWidget>("install")->setLabel(_("Uninstall"));
|
||||
}
|
||||
|
||||
core::stringw name = StringUtils::insertValues(_("Name: %i"),
|
||||
m_addon.getName().c_str() );
|
||||
core::stringw name = _("Name: %i", m_addon.getName().c_str() );
|
||||
getWidget<LabelWidget>("name")->setText(name);
|
||||
|
||||
core::stringw desc = StringUtils::insertValues(_("Description: %i"),
|
||||
m_addon.getDescription().c_str());
|
||||
core::stringw desc = _("Description: %i", m_addon.getDescription().c_str());
|
||||
getWidget<LabelWidget>("description")->setText(desc);
|
||||
|
||||
core::stringw version = StringUtils::insertValues(_("Version: %d"),
|
||||
m_addon.getVersion());
|
||||
core::stringw version = _("Version: %d", m_addon.getVersion());
|
||||
getWidget<LabelWidget>("version")->setText(version);
|
||||
|
||||
} // AddonsLoading
|
||||
|
||||
@@ -69,8 +69,7 @@ void ConfirmResolutionDialog::onUpdate(float dt)
|
||||
void ConfirmResolutionDialog::updateMessage()
|
||||
{
|
||||
//I18N: In the 'confirm resolution' dialog, that's shown when switching resoluton
|
||||
stringw msg = StringUtils::insertValues(_("Confirm resolution within %i seconds"),
|
||||
(int)m_remaining_time);
|
||||
stringw msg = _("Confirm resolution within %i seconds", (int)m_remaining_time);
|
||||
//std::cout << stringc(msg.c_str()).c_str() << std::endl;
|
||||
|
||||
LabelWidget* countdown_message = getWidget<LabelWidget>("title");
|
||||
|
||||
@@ -136,7 +136,7 @@ void PlayerInfoDialog::showConfirmDialog()
|
||||
|
||||
irr::core::stringw message =
|
||||
//I18N: In the player info dialog (when deleting)
|
||||
StringUtils::insertValues( _("Do you really want to delete player '%s' ?"), m_player->getName());
|
||||
_("Do you really want to delete player '%s' ?", m_player->getName());
|
||||
|
||||
core::rect< s32 > area_left(5, 0, m_area.getWidth()-5, m_area.getHeight()/2);
|
||||
|
||||
|
||||
@@ -166,10 +166,10 @@ RaceOverDialog::RaceOverDialog(const float percentWidth,
|
||||
//I18N: In results of battle mode; %i is where the rank is inserted;
|
||||
//I18N: the first %s is where the kart name is inserted;
|
||||
//I18N: the second %s is where the time is inserted
|
||||
kart_results_line = StringUtils::insertValues( _("%i. %s : survived for %s"),
|
||||
current_kart->getPosition(),
|
||||
kart_name.c_str(),
|
||||
time_string.c_str());
|
||||
kart_results_line = _("%i. %s : survived for %s",
|
||||
current_kart->getPosition(),
|
||||
kart_name.c_str(),
|
||||
time_string.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -73,7 +73,7 @@ TrackInfoDialog::TrackInfoDialog(const std::string& ribbonItem, const std::strin
|
||||
core::rect< s32 > creator_info_area(0, hscores_y_to, m_area.getWidth()/2, y2);
|
||||
|
||||
//I18N: when showing who is the author of track '%s' (place %s where the name of the author should appear)
|
||||
stringw text = StringUtils::insertValues(_("Track by %s"), track->getDesigner().c_str());
|
||||
stringw text = _("Track by %s", track->getDesigner().c_str());
|
||||
|
||||
IGUIStaticText* b = GUIEngine::getGUIEnv()->addStaticText( text.c_str(),
|
||||
creator_info_area, false , true , // border, word warp
|
||||
|
||||
@@ -256,44 +256,13 @@ public:
|
||||
target_w = m_w;
|
||||
target_h = m_h;
|
||||
|
||||
/*
|
||||
// ---- Player ID label
|
||||
if (associatedPlayer->getDevice()->getType() == DT_KEYBOARD)
|
||||
{
|
||||
deviceName += _("keyboard");
|
||||
}
|
||||
else if (associatedPlayer->getDevice()->getType() == DT_GAMEPAD)
|
||||
{
|
||||
deviceName += _("gamepad");
|
||||
}
|
||||
|
||||
m_player_ID_label = new LabelWidget(false, true);
|
||||
|
||||
m_player_ID_label->setText(
|
||||
//I18N: In kart selection screen (Will read like 'Player 1 (foobartech gamepad)')
|
||||
StringUtils::insertValues(_("Player %i (%s)"), m_playerID + 1, deviceName.c_str())
|
||||
);
|
||||
|
||||
m_player_ID_label->m_properties[PROP_TEXT_ALIGN] = "center";
|
||||
m_player_ID_label->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_label", m_playerID);
|
||||
m_player_ID_label->m_x = player_id_x;
|
||||
m_player_ID_label->m_y = player_id_y;
|
||||
m_player_ID_label->m_w = player_id_w;
|
||||
m_player_ID_label->m_h = player_id_h;
|
||||
|
||||
//playerID->setParent(this);
|
||||
m_children.push_back(m_player_ID_label);
|
||||
*/
|
||||
|
||||
// ---- Player identity spinner
|
||||
m_player_ident_spinner = new PlayerNameSpinner(parent, m_playerID);
|
||||
m_player_ident_spinner->m_x = player_name_x;
|
||||
m_player_ident_spinner->m_y = player_name_y;
|
||||
m_player_ident_spinner->m_w = player_name_w;
|
||||
m_player_ident_spinner->m_h = player_name_h;
|
||||
//m_player_ident_spinner->m_event_handler = this;
|
||||
|
||||
|
||||
|
||||
if (associatedPlayer->getDevice()->getType() == DT_KEYBOARD)
|
||||
{
|
||||
m_player_ident_spinner->setBadge(KEYBOARD_BADGE);
|
||||
@@ -432,11 +401,6 @@ public:
|
||||
|
||||
// restore previous focus, but with new player ID
|
||||
if (focus != NULL) focus->setFocusForPlayer(m_playerID);
|
||||
|
||||
//I18N: In kart selection screen (Will read like 'Player 1 (foobartech gamepad)')
|
||||
//irr::core::stringw newLabel = StringUtils::insertValues(_("Player %i (%s)"), m_playerID + 1, deviceName.c_str());
|
||||
//m_player_ID_label->setText( newLabel );
|
||||
//m_player_ID_label->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_label", m_playerID);
|
||||
|
||||
if (m_player_ident_spinner != NULL) m_player_ident_spinner->setID(m_playerID);
|
||||
} // setPlayerID
|
||||
@@ -536,11 +500,9 @@ public:
|
||||
m_player_ident_spinner->m_y),
|
||||
core::dimension2di(m_player_ident_spinner->m_w,
|
||||
m_player_ident_spinner->m_h));
|
||||
GUIEngine::getGUIEnv()->addStaticText(StringUtils::insertValues( _("%s is ready"), playerNameString ).c_str(),
|
||||
GUIEngine::getGUIEnv()->addStaticText(_("%s is ready", playerNameString),
|
||||
rect)->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER );
|
||||
|
||||
//m_player_ID_label->setText( StringUtils::insertValues( _("%s is ready"), playerNameString ) );
|
||||
|
||||
|
||||
m_children.remove(m_player_ident_spinner);
|
||||
m_player_ident_spinner->getIrrlichtElement()->remove();
|
||||
m_player_ident_spinner->elementRemoved();
|
||||
|
||||
@@ -91,7 +91,7 @@ void OptionsScreenInput::buildDeviceList()
|
||||
|
||||
//FIXME: I18N: since irrLicht's list widget has the nasty tendency to put the
|
||||
// icons very close to the text, I'm adding spaces to compensate...
|
||||
devices->addItem(internal_name, StringUtils::insertValues(_(" Keyboard %i"), i), 0 /* icon */);
|
||||
devices->addItem(internal_name, _(" Keyboard %i", i), 0 /* icon */);
|
||||
}
|
||||
|
||||
const int gpad_config_count = input_manager->getDeviceList()->getGamePadConfigAmount();
|
||||
|
||||
@@ -107,6 +107,10 @@ namespace StringUtils
|
||||
*/
|
||||
std::string insertValues(const std::string &s, std::vector<std::string>& all_vals);
|
||||
|
||||
/** This no-op is useful when using variadic arguments, so that we may support the case with 0 variadic arguments */
|
||||
template <class T1>
|
||||
T1 insertValues(const T1& s) { return s; }
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Same as above but for wide-strings */
|
||||
irr::core::stringw insertValues(const irr::core::stringw &s, std::vector<irr::core::stringw>& all_vals);
|
||||
|
||||
@@ -147,7 +147,82 @@ Translations::Translations()
|
||||
#endif
|
||||
|
||||
} // Translations
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
const wchar_t* Translations::fribidize(const wchar_t* in_ptr)
|
||||
{
|
||||
#if ENABLE_BIDI
|
||||
if(this->isRTLLanguage())
|
||||
{
|
||||
const int FRIBIDI_BUFFER_SIZE = 512;
|
||||
FriBidiChar fribidiInput[FRIBIDI_BUFFER_SIZE];
|
||||
int len = 0;
|
||||
int n = 0;
|
||||
//std::cout << "fribidi input : ";
|
||||
for (n = 0; ; n++)
|
||||
{
|
||||
fribidiInput[n] = in_ptr[n];
|
||||
//std::cout << (int)fribidiInput[n] << " ";
|
||||
len++;
|
||||
|
||||
if (n == FRIBIDI_BUFFER_SIZE-1) // prevent buffeoverflows
|
||||
{
|
||||
std::cerr << "WARNING : translated string too long, truncating!\n";
|
||||
fribidiInput[n] = 0;
|
||||
break;
|
||||
}
|
||||
if (fribidiInput[n] == 0) break; // stop on '\0'
|
||||
}
|
||||
//std::cout << " (len=" << len << ")\n";
|
||||
|
||||
// Assume right to left as start direction.
|
||||
#if FRIBIDI_MINOR_VERSION==10
|
||||
// While the doc for older fribidi versions is somewhat sparse,
|
||||
// using the RIGHT-TO-LEFT EMBEDDING character here appears to
|
||||
// work correct.
|
||||
FriBidiCharType pbase_dir = L'\u202B';
|
||||
#else
|
||||
FriBidiCharType pbase_dir = FRIBIDI_PAR_ON;
|
||||
#endif
|
||||
|
||||
static FriBidiChar fribidiOutput[FRIBIDI_BUFFER_SIZE];
|
||||
for (n = 0; n < 512 ; n++) { fribidiOutput[n] = 0; }
|
||||
fribidi_boolean result = fribidi_log2vis(fribidiInput,
|
||||
len-1,
|
||||
&pbase_dir,
|
||||
fribidiOutput,
|
||||
/* gint *position_L_to_V_list */ NULL,
|
||||
/* gint *position_V_to_L_list */ NULL,
|
||||
/* gint8 *embedding_level_list */ NULL
|
||||
);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
std::cerr << "Fribidi failed in 'fribidi_log2vis' =(\n";
|
||||
m_converted_string = core::stringw(in_ptr);
|
||||
return m_converted_string.c_str();
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
// On windows FriBidiChar is 4 bytes, but wchar_t is 2 bytes.
|
||||
// So we simply copy the characters over here (note that this
|
||||
// is technically incorrect, all characters we use/support fit
|
||||
// in 16 bits, which is what irrlicht supports atm).
|
||||
static wchar_t out[FRIBIDI_BUFFER_SIZE];
|
||||
for(int i=0; i<len; i++)
|
||||
out[i]=fribidiOutput[i];
|
||||
out[len]=0;
|
||||
return out;
|
||||
#else
|
||||
return (const wchar_t*)fribidiOutput;
|
||||
#endif //WIND32
|
||||
}
|
||||
|
||||
#endif // ENABLE_BIDI
|
||||
return in_ptr;
|
||||
}
|
||||
|
||||
const wchar_t* Translations::w_gettext(const char* original)
|
||||
{
|
||||
if (original[0] == '\0') return L"";
|
||||
@@ -204,77 +279,7 @@ const wchar_t* Translations::w_gettext(const char* original)
|
||||
std::wcout << L" translation : " << out_ptr << std::endl;
|
||||
#endif
|
||||
|
||||
|
||||
#if ENABLE_BIDI
|
||||
if(this->isRTLLanguage())
|
||||
{
|
||||
const int FRIBIDI_BUFFER_SIZE = 512;
|
||||
FriBidiChar fribidiInput[FRIBIDI_BUFFER_SIZE];
|
||||
int len = 0;
|
||||
int n = 0;
|
||||
//std::cout << "fribidi input : ";
|
||||
for (n = 0; ; n++)
|
||||
{
|
||||
fribidiInput[n] = out_ptr[n];
|
||||
//std::cout << (int)fribidiInput[n] << " ";
|
||||
len++;
|
||||
|
||||
if (n == FRIBIDI_BUFFER_SIZE-1) // prevent buffeoverflows
|
||||
{
|
||||
std::cerr << "WARNING : translated string too long, truncating!\n";
|
||||
fribidiInput[n] = 0;
|
||||
break;
|
||||
}
|
||||
if (fribidiInput[n] == 0) break; // stop on '\0'
|
||||
}
|
||||
//std::cout << " (len=" << len << ")\n";
|
||||
|
||||
// Assume right to left as start direction.
|
||||
#if FRIBIDI_MINOR_VERSION==10
|
||||
// While the doc for older fribidi versions is somewhat sparse,
|
||||
// using the RIGHT-TO-LEFT EMBEDDING character here appears to
|
||||
// work correct.
|
||||
FriBidiCharType pbase_dir = L'\u202B';
|
||||
#else
|
||||
FriBidiCharType pbase_dir = FRIBIDI_PAR_ON;
|
||||
#endif
|
||||
|
||||
static FriBidiChar fribidiOutput[FRIBIDI_BUFFER_SIZE];
|
||||
for (n = 0; n < 512 ; n++) { fribidiOutput[n] = 0; }
|
||||
fribidi_boolean result = fribidi_log2vis(fribidiInput,
|
||||
len-1,
|
||||
&pbase_dir,
|
||||
fribidiOutput,
|
||||
/* gint *position_L_to_V_list */ NULL,
|
||||
/* gint *position_V_to_L_list */ NULL,
|
||||
/* gint8 *embedding_level_list */ NULL
|
||||
);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
std::cerr << "Fribidi failed in 'fribidi_log2vis' =(\n";
|
||||
m_converted_string = core::stringw(original);
|
||||
return m_converted_string.c_str();
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
// On windows FriBidiChar is 4 bytes, but wchar_t is 2 bytes.
|
||||
// So we simply copy the characters over here (note that this
|
||||
// is technically incorrect, all characters we use/support fit
|
||||
// in 16 bits, which is what irrlicht supports atm).
|
||||
static wchar_t out[FRIBIDI_BUFFER_SIZE];
|
||||
for(int i=0; i<len; i++)
|
||||
out[i]=fribidiOutput[i];
|
||||
out[len]=0;
|
||||
return out;
|
||||
#else
|
||||
return (const wchar_t*)fribidiOutput;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
return out_ptr;
|
||||
|
||||
}
|
||||
|
||||
bool Translations::isRTLLanguage() const
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "irrlicht.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "utils/string_utils.hpp"
|
||||
|
||||
#if ENABLE_NLS
|
||||
# ifdef __APPLE__
|
||||
@@ -31,15 +32,17 @@
|
||||
# include <libintl.h>
|
||||
# endif
|
||||
|
||||
# define _(String) (translations->w_gettext(String))
|
||||
# define gettext_noop(String) (String)
|
||||
# define N_(String) (gettext_noop (String))
|
||||
# define _(String, args...) (translations->fribidize(StringUtils::insertValues(translations->w_gettext(String), ##args)))
|
||||
# define _LTR(String, args...) (StringUtils::insertValues(translations->w_gettext(String), ##args))
|
||||
# define gettext_noop(String) (String)
|
||||
# define N_(String) (gettext_noop (String))
|
||||
// libintl defines its own fprintf, which doesn't work properly
|
||||
# if defined(WIN32) && !defined(__CYGWIN__)
|
||||
# undef fprintf
|
||||
# endif
|
||||
#else // No NLS
|
||||
# define _(String) (translations->w_gettext(String))
|
||||
# define _LTR(String) (translations->w_gettext(String))
|
||||
# define gettext_noop(String) (String)
|
||||
# define N_(String) (String)
|
||||
#endif
|
||||
@@ -49,11 +52,14 @@ class Translations
|
||||
private:
|
||||
irr::core::stringw m_converted_string;
|
||||
bool m_rtl;
|
||||
|
||||
public:
|
||||
Translations();
|
||||
const wchar_t *w_gettext(const char* original);
|
||||
bool isRTLLanguage() const;
|
||||
|
||||
const wchar_t* fribidize(const wchar_t* in_ptr);
|
||||
const wchar_t* fribidize(const irr::core::stringw str) { return fribidize(str.c_str()); }
|
||||
|
||||
const std::vector<std::string>* getLanguageList() const;
|
||||
}; // Translations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user