So I tracked down what was wrong with the file buy manually importing it into a python terminal and clearing up the syntax errors one by one.
The problem with the current translation system: If file encoding is not utf-8 or if there is a syntax error in the file, the file is over written. Instead we should give errors if the file already exists. I understand that the admin translation tool was designed to eliminate this from happening, however I had 5 different people working on different chunks of the file to translate and did not want to give them all access to the admin app. Any suggestions on the best way to update languages.py to prevent this from happening? -- Regards, Bruce On Mon, Mar 5, 2012 at 1:32 PM, Bruce Wade <[email protected]> wrote: > Bigger issue with the translation file. > > I had a file where I added 90% of the file that was translated already, > and it was missing some keys. The translator then truncated everything and > only added the keys that were missing. > > > On Mon, Mar 5, 2012 at 11:26 AM, Anthony <[email protected]> wrote: > >> I agree -- if the file exists and appears corrupted, a warning or error >> would be more appropriate rather than silent overwriting (particularly >> since "corruption" will most likely just be a different encoding). >> >> Anthony >> >> >> On Monday, March 5, 2012 1:20:26 PM UTC-5, Detectedstealth wrote: >>> >>> That could work but my point is when I opened the file in a text editor >>> everything looked fine, however it was then overwritten so I was clueless >>> as to why it was happening, until I went to save as and seen the encoding. >>> Once I changed it to UTF-8 the file was no longer overwritten. >>> >>> -- >>> Regards, >>> Bruce >>> >>> On Mon, Mar 5, 2012 at 10:10 AM, Alan Etkin <[email protected]> wrote: >>> >>>> Maybe allowing to override the behavior with a initial argument? In >>>> that way, developers could do: >>>> >>>> T.no_overwrite = True >>>> >>>> And default to the normal file managing. >>>> >>>> >>>> On Mar 5, 2:13 pm, Massimo Di Pierro <[email protected]> >>>> wrote: >>>> > web2py rewrites language files in order to add translation strings. >>>> If it >>>> > does not find a string, it adds it. The problem in your case is that >>>> the >>>> > file appears corrupted (not utf8, not created by web2py) and >>>> therefore it >>>> > find no translation string and needs to add them all. >>>> > >>>> > This is the intended behavior. Can we change it? How should it >>>> > behave exactly in this case? >>>> > If it does not overwrite it, you are going to get a ticket when you >>>> try >>>> > edit using the admin interface. >>>> > >>>> > massimo >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote: >>>> > >>>> > > Was able to resolve the problem, the file was encoded as: GB18030 >>>> changing >>>> > > to UTF-8 allowed the file to show up again. >>>> > >>>> > > However I think the framework should give a error like unable to >>>> read file >>>> > > etc... instead of just overwriting a file? >>>> > >>>> > > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade <[email protected]> >>>> wrote: >>>> > >>>> > >> Hi, >>>> > >>>> > >> I gave someone a translation file to translate, however when I put >>>> the >>>> > >> new file in the languages folder it gets overridden by web2py >>>> > >> automatically. Any specific reason this would happen? >>>> > >>>> > >> -- >>>> > >> -- >>>> > >> Regards, >>>> > >> Bruce Wade >>>> > >>http://ca.linkedin.com/in/**brucelwade<http://ca.linkedin.com/in/brucelwade> >>>> > >>http://www.wadecybertech.com >>>> > >>http://www.warplydesigned.**com <http://www.warplydesigned.com> >>>> > >>http://www.**fitnessfriendsfinder.com<http://www.fitnessfriendsfinder.com> >>>> > >>>> > > -- >>>> > > -- >>>> > > Regards, >>>> > > Bruce Wade >>>> > >http://ca.linkedin.com/in/**brucelwade<http://ca.linkedin.com/in/brucelwade> >>>> > >http://www.wadecybertech.com >>>> > >http://www.warplydesigned.com >>>> > >http://www.**fitnessfriendsfinder.com<http://www.fitnessfriendsfinder.com> >>>> > >>>> > On Monday, 5 March 2012 09:37:01 UTC-6, Detectedstealth wrote: >>>> > >>>> > > Was able to resolve the problem, the file was encoded as: GB18030 >>>> changing >>>> > > to UTF-8 allowed the file to show up again. >>>> > >>>> > > However I think the framework should give a error like unable to >>>> read file >>>> > > etc... instead of just overwriting a file? >>>> > >>>> > > On Mon, Mar 5, 2012 at 7:29 AM, Bruce Wade <[email protected]> >>>> wrote: >>>> > >>>> > >> Hi, >>>> > >>>> > >> I gave someone a translation file to translate, however when I put >>>> the >>>> > >> new file in the languages folder it gets overridden by web2py >>>> > >> automatically. Any specific reason this would happen? >>>> > >>>> > >> -- >>>> > >> -- >>>> > >> Regards, >>>> > >> Bruce Wade >>>> > >>http://ca.linkedin.com/in/**brucelwade<http://ca.linkedin.com/in/brucelwade> >>>> > >>http://www.wadecybertech.com >>>> > >>http://www.warplydesigned.**com <http://www.warplydesigned.com> >>>> > >>http://www.**fitnessfriendsfinder.com<http://www.fitnessfriendsfinder.com> >>>> > >>>> > > -- >>>> > > -- >>>> > > Regards, >>>> > > Bruce Wade >>>> > >http://ca.linkedin.com/in/**brucelwade<http://ca.linkedin.com/in/brucelwade> >>>> > >http://www.wadecybertech.com >>>> > >http://www.warplydesigned.com >>>> > >http://www.**fitnessfriendsfinder.com<http://www.fitnessfriendsfinder.com> >>>> >>> >>> >>> >>> -- >>> -- >>> Regards, >>> Bruce Wade >>> http://ca.linkedin.com/in/**brucelwade<http://ca.linkedin.com/in/brucelwade> >>> http://www.wadecybertech.com >>> http://www.warplydesigned.com >>> http://www.**fitnessfriendsfinder.com<http://www.fitnessfriendsfinder.com> >>> >> > > > -- > -- > Regards, > Bruce Wade > http://ca.linkedin.com/in/brucelwade > http://www.wadecybertech.com > http://www.warplydesigned.com > http://www.fitnessfriendsfinder.com > -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com

