[nvda-addons] Re: Getting started on tip of the day addon.

  • From: derek riemer <driemer.riemer@xxxxxxxxx>
  • To: nvda-addons@xxxxxxxxxxxxx
  • Date: Fri, 19 Feb 2016 11:18:28 -0700

I meant translation to finish or another language. What I would need to do is somehow manage an archive of translations for each tip file.

On 2/19/2016 4:48 AM, Alex Hall wrote:

When you say "weird to translate", do you mean working with JSON in Python? If so, it's dead simple. This is from memory, not an interpreter, but it should give you the basic idea:

import json

someData = {"a":1, "b":2, "c":[3,4,5]}

jsonOfData = json.loads(someData) #that's a valid JSON object now

someData = json.dumps(jsonOfData) #back to a format Python understands

On Feb 18, 2016, at 18:31, derek riemer <driemer.riemer@xxxxxxxxx <mailto:driemer.riemer@xxxxxxxxx>> wrote:

Now that I look at it, JSON should have been my first option because I can pull it into python. It will be kind of weird to translate, so I might have to figure out how to do that.

On 2/18/2016 2:16 PM, James Scholes wrote:
A couple of things that initially spring to mind:

1. If the XML data stores the titles and text of the tips, how will they
be localised?
2. Why use XML?  You could use YAML or JSON, two formats that are
infinitely more human-readable and human-writable than XML, and easier
to parse to boot.  And if the tips won't be updated outside of the
add-on code itself, you could just store the tips in a localised,
separate Python module, in a dict or similar.

Don't make it any more complicated than it needs to be.  Focus on
implementing your idea in a way which works, and then
optomising/refactoring it later.  For instance, when will the tips be
shown?  Generally, they appear at application startup, but many NVDA
users will leave the program running 24/7.  Considerations like this
are, IMO, far more important than creating an XML-based schema for data
which can't be used yet.

--
------------------------------------------------------------------------


    Derek Riemer

  * Department of computer science, third year undergraduate student.
  * Proud user of the NVDA screen reader.
  * Open source enthusiast.
  * Member of Bridge Cu
  * Avid skiier.

Websites:
Honors portfolio <http://derekriemer.com/>
Awesome little hand built weather app! <http://django.derekriemer.com/weather/>

email me at derek.riemer@xxxxxxxxxxxx <mailto:derek.riemer@xxxxxxxxxxxx>
Phone: (303) 906-2194



--
Have a great day,
Alex Hall
mehgcap@xxxxxxxxxx <mailto:mehgcap@xxxxxxxxxx>


--
------------------------------------------------------------------------


   Derek Riemer

 * Department of computer science, third year undergraduate student.
 * Proud user of the NVDA screen reader.
 * Open source enthusiast.
 * Member of Bridge Cu
 * Avid skiier.

Websites:
Honors portfolio <http://derekriemer.com>
Awesome little hand built weather app! <http://django.derekriemer.com/weather/>

email me at derek.riemer@xxxxxxxxxxxx <mailto:derek.riemer@xxxxxxxxxxxx>
Phone: (303) 906-2194

Other related posts: