Linux build fix.

Also move the primary translation pot file to the external repository to facilitate updating translations when strings in the code are changed.  Now the only time the primary dolphin repository needs to be changed for translations is when a new language is added.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7438 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-04-06 13:58:03 +00:00
parent b6222a5b61
commit d5c4976532
5 changed files with 53 additions and 4819 deletions

View File

@ -431,7 +431,7 @@ install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN .svn EXCLUDE)
include(FindGettext)
if(GETTEXT_FOUND AND NOT DISABLE_WX)
file(GLOB LINGUAS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} Languages/po/*.po)
GETTEXT_CREATE_TRANSLATIONS(Languages/dolphin-emu.pot ALL ${LINGUAS})
GETTEXT_CREATE_TRANSLATIONS(Languages/po/dolphin-emu.pot ALL ${LINGUAS})
endif()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES Data/license.txt DESTINATION ${datadir})

File diff suppressed because it is too large Load Diff

View File

@ -6,10 +6,10 @@ CPP_FILE_LIST=$(find $SRCDIR \( -name '*.cpp' -o -name '*.h' -o -name '*.c' \) \
-a ! -path '*Debug*')
xgettext -d dolphin-emu -s --keyword=_ --keyword=wxTRANSLATE --keyword=SuccessAlertT \
--keyword=PanicAlertT --keyword=PanicYesNoT --keyword=AskYesNoT --keyword=_trans \
--add-comments=i18n -p ./Languages -o dolphin-emu.pot $CPP_FILE_LIST \
--add-comments=i18n -p ./Languages/po -o dolphin-emu.pot $CPP_FILE_LIST \
--package-name="Dolphin Emu"
POTFILE=./Languages/dolphin-emu.pot
POTFILE=./Languages/po/dolphin-emu.pot
PO_FILES=$(find ./Languages/po -name '*.po')
for PO in $PO_FILES
do

View File

@ -58,9 +58,57 @@ SettingRadioButton::SettingRadioButton(wxWindow* parent, const wxString& label,
_connect_macro_(this, SettingRadioButton::UpdateValue, wxEVT_COMMAND_RADIOBUTTON_SELECTED, this);
}
// partial specialization (SettingChoice template)
template<>
void StringSettingChoice::UpdateValue(wxCommandEvent& ev)
{
m_setting = ev.GetString().mb_str();
if (_type == allow_3State)
{
if (m_index != 0) // Choice ctrl with 3RD option
{
// changing state value should be done here, never outside this block
if (ev.GetInt() == 0)
{
UpdateUIState(false);
}
else
{
UpdateUIState(true);
if (ev.GetInt() == 1) m_setting.clear();
}
}
else // Choice ctrl without 3RD option
{
if (m_uistate)
if (!*m_uistate) *d_setting = m_setting;
}
}
ev.Skip();
}
template<>
wxClassInfo IntSettingChoice::ms_classInfo(wxT("IntSettingChoice"),
&wxChoice::ms_classInfo, NULL, (int)sizeof(IntSettingChoice),
(wxObjectConstructorFn) NULL);
template<>
wxClassInfo *IntSettingChoice::GetClassInfo() const
{
return &IntSettingChoice::ms_classInfo;
}
template<>
wxClassInfo StringSettingChoice::ms_classInfo(wxT("StringSettingChoice"),
&wxChoice::ms_classInfo, NULL, (int)sizeof(StringSettingChoice),
(wxObjectConstructorFn) NULL);
template<>
wxClassInfo *StringSettingChoice::GetClassInfo() const
{
return &StringSettingChoice::ms_classInfo;
}
IMPLEMENT_CLASS(IntSettingChoice, wxChoice)
IMPLEMENT_CLASS(StringSettingChoice, wxChoice)
template <typename V>
SettingChoice<V>::SettingChoice(wxWindow* parent, V &setting, V &def_setting, bool &state, int &cur_index, const wxString& tooltip, int num, const wxString choices[], long style)
: _pattern(&state, allow_3State)

View File

@ -192,34 +192,6 @@ private:
int &m_index;
};
// partial specialization (SettingChoice template)
void SettingChoice<std::string>::UpdateValue(wxCommandEvent& ev)
{
m_setting = ev.GetString().mb_str();
if (_type == allow_3State)
{
if (m_index != 0) // Choice ctrl with 3RD option
{
// changing state value should be done here, never outside this block
if (ev.GetInt() == 0)
{
UpdateUIState(false);
}
else
{
UpdateUIState(true);
if (ev.GetInt() == 1) m_setting.clear();
}
}
else // Choice ctrl without 3RD option
{
if (m_uistate)
if (!*m_uistate) *d_setting = m_setting;
}
}
ev.Skip();
}
typedef SettingChoice<int> IntSettingChoice;
typedef SettingChoice<std::string> StringSettingChoice;