python - Making a wxPython application multilingual -


I have an application written in wxPython, which I want to make multilingual.

  1. Separate all UI text in a message.py file, and translate text to its Using

I am very interested in the other side and I'm not getting any benefit in going on the gateway path, in another way I can not keep all my messages in the code in one place. So, if I need to change a message, then there is no need to change the code in the case of gettext Switch to me as might be suspected that msg- constants I only message instead of converting continuous wrapping message to the original message

instead of

  Wx.MessageBox (_ ( "Hi Stackevvrflo!"))  

I

  wx.MessageBox (messages.GREET_SO)  

Is Better, Is There Another Way In Gatetext Method And Damage? And is there any third way?

EDIT: Gatetext language files may also be tied to code, and if I want two messages in English but one is different in French it seems that for French English, There is a more subtle translation for different scanners. OK

Experience: I've already gone to the other side, and I should say that every application should try to remove UI text from the code, it gives an opportunity to refer to, where the UI model There is a living being and where UI lessons can be improved, compared to a mechanic in comparison, there is no input for the transmitter, and I think it would be more difficult to maintain.

And while creating a name for the text example PRINT_PROGRESS_MSG, gives the opportunity to see that in many places, the same msg is being used in a slightly different way and merged in the same name. Which, later on, when I will only need to make changes to the msg.

Conclusion: I'm still not sure of any benefits to using gettext and using my own message file but I have selected the answer that is the least Some points have been explained why gettext can be beneficial The final solution is IMO which takes best from both methods, i.e. wrapped like my own message identifier gatetext.

  wx.MessageBox (_ ("GREET_SO"))  

gettext is a way to go, in your example you "to avoid accumulation translations for" text:

  wx.MessageBox (messages.GREET_SO)  

maybe these with gettext:

  wx message box (_ ( "GREET_SO")) or wx.MessageBox (_ ( "messages.GREET_SO" ))  

Ghetetext is very standard for multilingual applications, and I'm pretty sure you will benefit from using it in the future. Ahrn, you can use Poadit (or other similar app) to translate your partners or contributors and seemingly translated not the flag or several messages from one. Also if you have unavailable / additional entries, you will be notified. Do not fool yourself, is the only proven credible way to get translations.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -