From: Jérôme <rom...@ya...> - 2011-04-21 09:21:16
|
> undo rev17071 on rev17178/9 I made a typo (identation) ... :-[ Fixed by Peter rev17180/1 Jérôme a écrit : > undo rev17071 on rev17178/9 > > http://gramps.svn.sourceforge.net/gramps/?view=rev&rev=17179 > > Benny Malengier a écrit : >> >> 2011/4/21 Jérôme <rom...@ya... <mailto:rom...@ya...>> >> >> If it is really need, we can keep this!!! >> >> >> No. >> LANG should not be used for this. As a fallback it is ok, but as an >> override it should be a GRAMPS variable. >> >> Benny >> >> >> >> But then we also need to fix DateHandler/__init__.py >> >> >> # Initialize global displayer >> try: >> import config >> val = config.get('preferences.date-format') >> except: >> val = 0 >> >> try: >> if LANG in LANG_TO_DISPLAY: >> displayer = LANG_TO_DISPLAY[LANG](val) >> else: >> displayer = LANG_TO_DISPLAY[LANG_SHORT](val) >> except: >> print "Date displayer for", LANG, "not available, using default" >> displayer = LANG_TO_DISPLAY["C"](val) >> >> >> Peter, >> >> With the change (rev17071), you set a empty value for LANG and I >> suppose this means that the test on LANG (if not LANG:) will never >> match, right? >> >> Unfortunately it seems we need >> >> LANG = locale.getlocale(locale.LC_TIME)[0] >> for displaying our Date format names under Linux, BSD, UNIX like >> (MacOS ?) and I suppose >> >> LANG = locale.getdefaultlocale(locale.LC_TIME)[0] >> for displaying our Date format names under Windows OS >> >> Does we really need this ? >> >> +LANG = '' >> >> +if "LANG" in os.environ: >> + LANG = os.environ["LANG"] >> >> Instead of reverting, I suppose a minor change like: >> >> - if not LANG: >> + if not LANG and LANG != '': >> >> will be an alternative (not tested). >> >> I guess this improvement is for Windows 7 and I think it is for a >> better support under this platform, but I do not know why we need to >> set an empty LANG value ? If so, maybe: >> >> -LANG = '' >> + if constfunc.win(): >> + LANG='' >> >> as second alternative ! (not tested) >> >> >> Thanks. >> Jérôme >> >> >> >> >> >> Benny Malengier a écrit : >> >> >> >> 2011/4/21 Jérôme <rom...@ya... <mailto:rom...@ya...> >> <mailto:rom...@ya... <mailto:rom...@ya...>>> >> >> >> Yes we get it (GUI, Date Edition, etc ...), but why to force >> encoding (sv) and/or a special order on DateHandler ? Now, my >> locale >> seems to be ignored under Linux for handling date format names, I >> need to revert your changes (#4812) for providing the translated >> strings (Date format on Display preferences dialog for users)! >> >> >> http://www.gramps-project.org/bugs/view.php?id=4844 >> >> I do not have a custom launcher (only default launcher without >> locale or encoding set) and I cannot see what should be fixed >> with >> the change ? >> >> http://gramps.svn.sourceforge.net/viewvc/gramps/branches/maintenance/gramps33/src/DateHandler/_DateHandler.py?view=patch&r1=16855&r2=17071 >> <http://gramps.svn.sourceforge.net/viewvc/gramps/branches/maintenance/gramps33/src/DateHandler/_DateHandler.py?view=patch&r1=16855&r2=17071> >> >> <http://gramps.svn.sourceforge.net/viewvc/gramps/branches/maintenance/gramps33/src/DateHandler/_DateHandler.py?view=patch&r1=16855&r2=17071 >> <http://gramps.svn.sourceforge.net/viewvc/gramps/branches/maintenance/gramps33/src/DateHandler/_DateHandler.py?view=patch&r1=16855&r2=17071>> >> >> >> Yes, undo this. The tread started with asking if this could not >> be done, and I replied there is a reason we don't do that. >> So we need to keep the original. >> >> If you want an environment flag to avoid using locale, then >> introduce a _new_ variable eg: GRAMPS_LOCALELANG >> but don't use important environment variables you have no way of >> knowing if they are not in use for other reasons. >> >> Note that these are the kind of small changes shortly before a >> release that cause a lot of grief. >> >> Benny >> >> 1. This breaks Date Handling on libtranslate >> (related to date formats see 2.) >> 2. and the Date format selector >> under Linux! >> >> Yes, I see that the fix for #4812 introduces an alternate method >> http://www.gramps-project.org/bugs/view.php?id=4812 >> I cannot see why it is useful and how to properly return date >> format >> names for my locale under Linux ... >> >> Also maybe to set encoding on 'register_datehandler' is something >> that could break the bundle package under Windows OS (latin1, >> east >> european, partial unicode support under Windows XP/Vista, etc >> ...), no ? >> >> I suppose __init__.py on DateHandler was ignored by your fix ? >> # Initialize global displayer >> try: >> import config >> val = config.get('preferences.date-format') >> except: >> val = 0 >> >> Sorry, but I cannot see why a custom launcher for Windows 7 >> should >> modify the Date Handling under Linux OS ... And what should >> be done! >> >> Maybe I am wrong. But currently, Date format names selection >> (ISO, >> numerical, month day year) is broken under my locale, which is >> properly set by default and worked on last releases. >> >> >> About _Date_cs.py (also on current stable release), this >> localized >> Date Handler seems to be ignored (not properly set, called). >> This might be also fixed for 3.2.6, no ? >> >> >> >> Jérôme >> >> >> Peter Landgren a écrit : >> >> Den Wednesday 20 April 2011 20.00.56 skrev jerome: >> >> If you want dates different, you must install the >> >> correct locale! Just >> >> setting LANG is not ok, as we have no idea >> what the >> >> (abbreviated) months >> >> names are. Those things are part of the locale. >> >> They are also included in 20 of the 27 _date_xx.py >> >> It seems I missed the start of the discussion ... >> >> Peter, what is the way used ? >> I just see that I do not have my local(e) date >> formats any >> more (user >> preferences dialog)[1]. >> >> It is like it ignores my date format names set on >> DateDisplayFR(DateDisplay) class (_Date_fr.py). >> >> If I start Gramps with: >> LANG=fr LANGUAGE=fr python src/gramps.py >> >> I get the French date handler. The same with German or >> English. >> >> If LANG is set, it is used to control which datahandler >> to load. >> IF LANG is not set, systems locale is used. >> >> >> Should we add encoding on localized date handlers ? >> register_datehandler('fr_FR.UTF-8', 'others.UTF-8', >> etc ...) >> >> I don't think so. >> >> /Peter >> >> [1] http://www.gramps-project.org/bugs/view.php?id=4844 >> >> >> Thanks! >> Jérôme >> >> --- En date de : Mer 20.4.11, Peter Landgren >> <pet...@te... >> <mailto:pet...@te...> <mailto:pet...@te... >> <mailto:pet...@te...>>> a >> >> écrit : >> >> De: Peter Landgren <pet...@te... >> <mailto:pet...@te...> >> <mailto:pet...@te... >> <mailto:pet...@te...>>> >> >> Objet: Re: [Gramps-devel] Date handler when >> chaning language >> À: "Benny Malengier" <ben...@gm... >> <mailto:ben...@gm...> >> <mailto:ben...@gm... >> <mailto:ben...@gm...>>> >> >> Cc: "Gramps Development List" >> <gra...@li... >> <mailto:gra...@li...> >> <mailto:gra...@li... >> <mailto:gra...@li...>>> >> >> Date: Mercredi 20 avril 2011, 10h52 >> Den Wednesday 20 April 2011 10.24.11 >> >> skrev Benny Malengier: >> >> The wiki page contains this: >> >> >> http://gramps-project.org/wiki/index.php?title=Howto:Change_the_languag >> e_of _reports#What_about_dates_and_calendars >> >> If you want dates different, you must install the >> >> correct locale! Just >> >> setting LANG is not ok, as we have no idea >> what the >> >> (abbreviated) months >> >> names are. Those things are part of the locale. >> >> They are also included in 20 of the 27 _date_xx.py >> >> /Peter >> >> It is no problem in linux to install more >> than one >> >> locale, and you can >> >> change that in system settings. >> >> Benny >> >> 2011/4/3 Peter Landgren >> <pet...@te... <mailto:pet...@te...> >> <mailto:pet...@te... >> <mailto:pet...@te...>>> >> >> >> Devs, >> >> If I will run Gramps in another language than >> >> defined by the system >> >> locale, in this case Swedish, >> >> I use a command to get Gramps in German: >> LANGUAGE=de_DE.UTF-8 >> >> LANG=de_DE.UTF-8 python src/gramps.py >> >> Gramps starts with the German translation and >> >> German relationships. >> >> However the date handler is still the Swedish >> >> one. >> >> Looking at the code in _DateHandler.py >> >> ------------------------------------------------- >> >> if not constfunc.win(): >> LANG = >> >> locale.getlocale(locale.LC_TIME)[0] >> >> else: >> LANG = >> >> locale.getdefaultlocale(locale.LC_TIME)[0] >> >> if not LANG: >> if "LANG" in os.environ: >> LANG = >> >> os.environ["LANG"] >> >> >> ------------------------------------------------- >> >> which of course will give LANG=sv_SE and as >> >> result >> >> skipping the setting of the os-variable LANG. >> >> Changing the order bit results in that >> the German >> >> date handler is loaded. >> >> >> ------------------------------------------------- >> >> if "LANG" in os.environ: >> LANG = os.environ["LANG"] >> >> if not LANG: >> if not constfunc.win(): >> LANG = >> >> locale.getlocale(locale.LC_TIME)[0] >> >> else: >> LANG = >> >> locale.getdefaultlocale(locale.LC_TIME)[0] >> >> >> ------------------------------------------------- >> >> Is there a certain reason for the original >> >> order? >> >> What is correct? >> >> /Peter >> >> >> ------------------------------------------------------------------------- >> >> ----- Create and publish websites with >> WebMatrix >> Use the most popular FREE web apps or >> write code >> >> yourself; >> >> WebMatrix provides all the features you >> need to >> >> develop and >> >> publish your website. >> http://p.sf.net/sfu/ms-webmatrix-sf >> >> _______________________________________________ >> Gramps-devel mailing list >> Gra...@li... >> <mailto:Gra...@li...> >> >> <mailto:Gra...@li... >> <mailto:Gra...@li...>> >> >> >> https://lists.sourceforge.net/lists/listinfo/gramps-devel >> >> >> ------------------------------------------------------------------------- >> ----- Benefiting from Server Virtualization: >> Beyond Initial >> Workload >> Consolidation -- Increasing the use of server >> virtualization is a top >> priority.Virtualization can reduce costs, simplify >> management, and improve >> application availability and disaster protection. >> Learn >> more about boosting >> the value of server virtualization. >> http://p.sf.net/sfu/vmware-sfdev2dev >> _______________________________________________ >> Gramps-devel mailing list >> Gra...@li... >> <mailto:Gra...@li...> >> <mailto:Gra...@li... >> <mailto:Gra...@li...>> >> >> >> https://lists.sourceforge.net/lists/listinfo/gramps-devel >> >> >> >> >> >> > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel |