Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Patches for codeblocks about internationalization

<< < (4/6) > >>

rickg22:
argh

wxMenuBar::FindMenu
int FindMenu(const wxString& title) const

There's no FindMenu(int it) :( The reason is because wxMenu is a wxEvtHandler, not a wxWindow - and therefore, it has no associated Id. It has to be found by string :-(

Solutions anyone?

takeshimiya:
None of this helps?


--- Code: ---wxMenuItem * FindItem(int id, wxMenu **menu = NULL) const
--- End code ---
Finds the menu item object associated with the given menu item identifier and, optionally, the (sub)menu it belongs to.
If menu is !NULL, it will be filled with wxMenu this item belongs to


--- Code: ---int FindItem(const wxString& itemString) const
--- End code ---
Finds the menu item id for a menu item string.


--- Code: ---wxString GetTitle() const
--- End code ---
Returns the title of the menu.


--- Code: ---wxString GetLabel(int id) const
--- End code ---
Returns a menu item label.


--- Code: ---int GetMenuCount() const
--- End code ---
Get the number of menus in the menu bar


--- Code: ---wxMenu *GetMenu(size_t pos) const
--- End code ---
Get the menu at given position

Urxae:
Now maybe I'm saying something stupid here, but wouldn't a quick fix be to just search for the translated string? Two translations of the same string should automatically be the same, right?

rickg22:
Yes, but if the strings are translated the same... why didn't the menu creation work? (See previous screenshots).

Or you mean searching for the *untranslated* strings? ugh i think i got confused now.

heromyth:
Suppose there has something like this:
   
--- Code: ---<label>$$compiler<label>
--- End code ---
in a XRC file. When some programs use this XRC file to show the label, we can see this:
   
--- Code: ---$compiler
--- End code ---

The '$$' has changed into '$'. If we change to:
   
--- Code: ---<label>$compiler<label>
--- End code ---
Now we can see that:
   
--- Code: ---[u]c[/u]ompiler
--- End code ---

What has happened. I have tried to look into the wxWidget manual, but got nothing.

Why I care about this. That's because I want to translate some strings in XRC files. I use utils\wxxrc.exe to get these strings. Only all the '$$'s were treated as '$'s while being translated,  my program could get the correct translations.

Maybe make wxxrc change '$$' into '$' while getting the strings, we could resolve this problem!?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version