Posted by
| Nick Gammon
Australia (23,094 posts) Bio
Forum Administrator |
Message
| The resources are not exactly code. They are more like a database. They are publicly available (in English) here:
https://github.com/nickgammon/mushclient_resources
Example of it:
IDD_GLOBAL_PREFSP3 DIALOG DISCARDABLE 0, 0, 262, 201
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Closing"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Confirm before closing &World",
IDC_CONFIRM_BEFORE_CLOSING_WORLD,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,10,106,10
CONTROL "Offer to save world if only &Variables have changed.",
IDC_CONFIRM_BEFORE_SAVING_VARIABLES,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,28,176,10
CONTROL "Confirm before closing &MUSHclient",
IDC_CONFIRM_BEFORE_CLOSING_MUSHCLIENT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,46,125,10
CONTROL "Offer to save MXP &debug windows",
IDC_CONFIRM_BEFORE_CLOSING_MXP_DEBUG,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,64,125,10
END
The reason I don't want to change the resources is because of the considerable effort put into internationalization of the code, starting here:
http://www.gammon.com.au/forum/?id=7953
As described in that post, the resources (menus, dialog boxes, pop-up boxes etc.) were removed from being bundled inside the MUSHclient.exe file, and moved into a separate DLL. The English version (EN.dll) ships with the client.
The idea was that if someone wanted to localize the client they could recompile the resources file, changing, for example, "Offer to save world if only &Variables have changed" to be what that would be in French ("Offrir de sauver le monde si seulement les variables ont changé" maybe?).
There is also another file (en.lua) which maps text in the C++ code to other languages. For example, the message "This field may not be blank" might be changed as follows:
-- DDV_validation.cpp:41
["This field may not be blank"] =
"Blank, this field may not be",
This file can be used to change the text of messages and warnings internally generated by the client.
Right now, since these files are distributed with the client, but ones for the other languages are not, then if someone in (say) China wanted to make a Chinese version, they just have to do the translations in the resource file, and also en.lua. The new resource file would be CN.dll and the text file cn.lua.
When new versions of MUSHclient are released they will automatically pick up the resource file based on the current locale, so bug fixes in the client will still keep the Chinese text in menus, etc.
However if I change the resource file layout (eg. adding a new menu item) then all those other resource files would have to be changed too. Possibly the people that did them are no longer working on them.
So, for backwards consistency, I make it a rule to never change the resource file.
Since the code and the resource file are open source, you are welcome to change them yourself if you want to. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|