Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

To add Google's website translator to your website Google's instructions say that you must drop the code snippet into the body of every web page that you would like to be translated. For webmasters managing multiple pages, is there a solution for dropping the code just once, and enabling the translator (and specified default language) for every webpage?

share|improve this question
add comment

2 Answers

If your site works with templates, e.g. it has a common header.php file, you can drop the code in there.

share|improve this answer
add comment

Most people these days use Content Management Systems, so there's no need to drop the code in more than one place. Unless you're running a single-page website, there's no reason not to use a CMS, and it's inexcusable for a web developer to not provide one to their client.

There are a lot of times when you need to make site-wide changes to a website. Installing analytics or ad management code and changing layout designs or navigation and header/footer elements are just a few of the more common ones. Not having a CMS is going to create a lot more maintainability problems (violating DRY is just one of them) than just making it inconvenient to add Google Translate to each page.

Likewise, without a CMS, it makes it very difficult for the client to update their site. And the site will most-likely lack other basic features common to modern websites (search, comments, trackbacks, user management, RSS, tagging, etc.).

So fix the fundamental problem, and the rest will fall into place. Modern CMSes are easy to install and easy to use, and many of the best ones are open source. I mean, you can literally hire a high school student to install WordPress or some other CMS on your site for probably $20 (migrating an existing site and converting a design into a theme will cost a lot more though), and with full-page caching, the performance difference from a static site will be negligible. So there's very little reason not to do it (hence why static sites are a rarity these days).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.