Out with the old
Posted on 28 Apr 2009 at 10:26
Mark Newton wonders whether change is always for the better, and defends the difficult practice of web hosting.
The site was to support ten languages, so for each page I'd need ten resource files. I considered using such resource files to handle my translated text, but after due consideration the thought of maintaining one file per language per page sounded like the admin job from hell. For one or perhaps two extra languages it might work for you, but I needed an easy-to-maintain solution that could handle UTF-8 character sets so that languages such as Polish would be correctly rendered. I considered generating the resource files directly from a database, but decided to go the old route of storing the various phrases in a database with a separate record for each language. Using this technique meant I didn't need to convert all my old ASP pages to ASP.NET to get resource files into them.
Once again, I'm baffled that Microsoft provides a mechanism like resource files without the ability to easily create them on-the-fly from a database, as an alternative to creating a huge collection of files of which a lot of the content would be similar for each page. Since ASP.NET is extremely extensible, I'm sure some reader will write in to tell me that I could write a class that hooks into some obscure system call that will achieve what I want. While my attitude is that it's great to have such flexibility, in my experience software vendors fall back on this as an excuse after releasing incomplete products, saying you could always "write that functionality yourself".
Did my solution work? Yes, like a dream, except for the button control in ASP.NET. It seems that this fully multilingual operating system, coupled with multilingual development tools, still has some problems. Before I go into detail about this, let me explain how I got the various translations into the system. First, an Excel spreadsheet is set up, with a separate column for each language, and the English text for each phrase is entered into its rows. The sheet is then sent off to our translators around the world and comes back via email attachments. All the translations are combined into one master sheet that's then imported into a table in a Microsoft SQL Server 2005 database. This database is used to replace any text on the web page. The Dataset on the web page is a select query returning just one record containing the text phrases in the desired language, and the relevant column is displayed on the page. It's worth noting here that it's a good idea to forget your usual naming convention for database field names and instead pick something that gives you an idea of the text each field contains, since this will make it so much easier to understand your page in the future. For example, this scheme makes it easier to understand what text goes where:
than this more conventional version:
So far so good, and both Excel and SQL Server seemed to fully support all the characters we needed. The ASP pages seemed to as well, although there was an occasional drop out of certain accented characters to be replaced by their non-accented cousins, something both I and the client decided to live with. However, while most of the ASP.NET Framework 3.5 SP1 controls were happy, the button control didn't like the Polish ? character (and probably others too), and the Grid View control exhibited the same glitch, while the label control was happy to display it.
Mark Newton
Mark is a contributing editor to PC Pro and managing director of the internet company ECats Ltd (Electronic CATalogueS). He specialises in internet-based solutions, often working with design houses. He works from a Victorial railway in deepest Suffolk.
advertisement
- Getting to grips with Microsoft's IT Health Environment Scanner
- Virtualise your servers
- The changing face of travel gadgets
- Build your own distributed file system
- The bulletproof Dell that costs an arm and a leg
- Microsoft Office 2010 Technical Preview: Q&A
- Lawnmowers, the TyTN II and one odd insurance request
- There'll never be a bulletproof OS
- How far can we trust apps?
- Five nice touches in Outlook 2010
- Why Britain's watchdogs have fewer teeth than goldfish
- Tabbed documents: how to make Office 2010 great
- Outlook 2010 People Pane – does it spell death to Xobni
- Microsoft Outlook 2010 screenshots
- Co-Authoring in Word 2010 and SharePoint Foundation 2010
- Microsoft Outlook 2010 screenshots: Backstage view
- Flash 10.1: Developing for Desktop and Device
- Microsoft Office 2010 screenshots: Recover unsaved items
- Microsoft Word 2010 screenshots: Text Effects
- Microsoft Word 2010: inserting screenshots
- Q&A: Why Conficker was a victim of its own success
- App developers losing faith in Android
- Biz Stone: Murdoch's Google veto will "fail fast"
- Google adds automatic captions to YouTube
- China ramps up cyber spying
- Mozilla maintains dependence on Google
- Windows 7 flying off the shelves
- Google Chrome OS: full details unveiled
- AOL slashes 2,500 jobs
- YouTube begins streaming full-length shows
advertisement
Printed from www.pcpro.co.uk


