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.
From around the web
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
- How to make Google AdWords work for your business
- The curse of sloppily written software
- Paying for your crimes with Bitcoin
- Behind the scenes: tech support for Formula 1
- The security risk of fat fingers
- Why Windows Phone 7 isn't quite ready for business
- When will Microsoft stop fiddling with Windows 8?
- Flash down the pan?
- Metro Style apps vs desktop applications
- Coping with Facebook changes
- Chrome's shine getting lost in translation
- BytePac: the cardboard hard disk enclosure
- How tech loosens our grip on reality
- Hokum watch: Safer Internet Day
- Why I'm deleting Adobe from my PC
- Prepare to be patronised: it's Safer Internet Day
- Dear Sony, Samsung and every other tech company in the world: stop trying to be Apple
- Will Apple's Final Cut Pro X update placate the pros?
- Smartr Contacts for iPhone review
- Switching to Office 365's Outlook Web App
- VeriSign slammed for security breach cover-up
- SAP willing to share HANA with Oracle
- Why using a tablet could harm your health
- New RIM boss: no need for drastic change
- RIM founders fall on their swords
- Slow economy helps boost Red Hat revenue by 23%
- Google+ pages get multiple admins
- One in five companies lack card industry compliance
- Oil industry warns hacking attacks could kill
- British workers fear email monitoring
advertisement

