Read/Write to a textfile | Stencil Translation Script

Started by Lars-Erik, September 04, 2008, 08:12:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lars-Erik

I'm making a tool to help translate stencils, basicly it asks for a translation, stores that in a collection, so if it finds the same custom property, its doesnt have to ask you for a translation again. This makes it dummy proof, quick and consistent. Anyway, what i dislike is storing the known translations in a collection, i was wondering if i can store it in a txt file somehow, that would allow users to just change the names in a txt file, run the macro and voila, the file is translated... any thougts?

On a side note, how do i force a stencil out of read only...
:)

- Lars

Lars-Erik

Got the file reading down... Ill post my translation script when its done...

still would like to know how to make a stencil writeable using VBA

Paul Herber

activeDocument.OpenEx stencilName visOpenRW+visOpenDocument

Lars, I'll email you my translation stuff.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Lars-Erik

I'm pretty happy with how mine is working atm, you can import a translation list, from a txt file. You can also export your translations to a text file. There is the option to clear the known translations (without dmging your textfile) and to delete a certain translation, incase you made a mistake somewhere (typo or whatever)

It will translate masters, always asks for a translation and its custom properties, which is will check vs its know translations and only ask you if it hasn't been translated yet. Pretty much all i want it to do.

Still not totaly dummy proof, it needs the stencil to be writeable, for now, and it doesnt have any error checking for textbox inputs as of yet...

I'd love to see what you did with it Paul, ill check my mail as soon as i come home.

- Lars

Paul Herber

The translations are in an Excel file and the program is in Delphi. It's only a bare-bones file, it won't compile as I had to take out other irrelevent stuff.
But the program reads translations from text files, I can't remember how I got the data from Excel to the text files! (very unlike me, I haven't got any 'how-to' notes)


Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visio Guy

You guys might think about using Visio's xml format, and for that matter, using xml for the translation dictionary as well.

Then you can translate a Visio file without even starting Visio. And humans can still read the dictionary as well. There are plenty of tools (ie: libraries) for processing xml, and it is more structured than just using a text file.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010