<p>How should I store (and present) the text on a website intended for worldwide use, with several languages? The content is mostly in the form of 500+ word articles, although I will need to translate tiny snippets of text on each page too (such as "print this article" or "back to menu").</p>

<p>I know there are several CMS packages that handle multiple languages, but I have to integrate with our existing ASP systems too, so I am ignoring such solutions.</p>

<p>One concern I have is that Google should be able to find the pages, even for foreign users. I am less concerned about issues with processing dates and currencies.</p>

<p>I worry that, left to my own devices, I will invent a way of doing this which work, but eventually lead to disaster! I want to know what professional solutions you have actually used on real projects, not untried ideas! Thanks very much.</p>

<hr>

<p>I looked at RESX files, but felt they were unsuitable for all but the most trivial translation solutions (I will elaborate if anyone wants to know).</p>

<p>Google will help me with translating the text, but not storing/presenting it.</p>

<p>Has anyone worked on a multi-language project that relied on their own code for presentation?</p>

<hr>

<p>Any thoughts on serving up content in the following ways, and which is best?</p>

<ul>
<li><a href="http://www.website.com/text/view.asp?id=12345&amp;lang=fr" rel="nofollow noreferrer">http://www.website.com/text/view.asp?id=12345&amp;lang=fr</a></li>
<li><a href="http://www.website.com/text/12345/bonjour_mes_amis.htm" rel="nofollow noreferrer">http://www.website.com/text/12345/bonjour_mes_amis.htm</a></li>
<li><a href="http://fr.website.com/text/12345" rel="nofollow noreferrer">http://fr.website.com/text/12345</a></li>
</ul>

<p>(these are not real URLs, i was just showing examples)</p>

[{'answer_id': 72451, 'author': 'SaaS Developer', 'author_id': 7215, 'author_profile': 'https://Stackoverflow.com/users/7215', 'pm_score': 1, 'selected': False, 'text': '<p>If you are using .Net, I would recommend going with one or more resource files (.resx).  There is plenty of documentation on this on MSDN.</p>\n'}, {'answer_id': 72473, 'author': 'Michael Pliskin', 'author_id': 9777, 'author_profile': 'https://Stackoverflow.com/users/9777', 'pm_score': 2, 'selected': False, 'text': '<p>You might want to check <a href="http://www.gnu.org/software/gettext/" rel="nofollow noreferrer">GNU Gettext</a> project out - at least something to start with.</p>\n\n<p><em>Edited to add info about projects:</em></p>\n\n<p>I\'ve worked on several multilingual projects using Gettext technology in different technologies, including C++/MFC and J2EE/JSP, and it worked all fine. However, you need to write/find your own code to display the localized data of course.</p>\n'}, {'answer_id': 72524, 'author': 'Dr. Bob', 'author_id': 12182, 'author_profile': 'https://Stackoverflow.com/users/12182', 'pm_score': 0, 'selected': False, 'text': '<p>If you\'re just worried about the article content being translated, and do not need a fully integrated option, I have used <a href="http://www.google.com/language_tools" rel="nofollow noreferrer">google translation</a> in the past and it works great on a smaller scale.</p>\n'}, {'answer_id': 73406, 'author': 'Rich McCollister', 'author_id': 9306, 'author_profile': 'https://Stackoverflow.com/users/9306', 'pm_score': 1, 'selected': False, 'text': "<p>As with most general programming questions, it depends on your needs.  </p>\n\n<p>For static text, I would use RESX files.  For me, as .Net programmer, they are easy to use and the .Net Framework has good support for them.    </p>\n\n<p>For any dynamic text, I tend to store such information in the database, especially if the site maintainer is going to be a non-developer.  In the past I've used two approaches, adding a language column and creating different entries for the different languages or creating a separate table to store the language specific text.  </p>\n\n<p>The table for the first approach might look something like this:</p>\n\n<p>Article Id | Language Id | Language Specific Article Text | Created By | Created Date</p>\n\n<p>This works for situations where you can create different entries for a given article and you don't need to keep any data associated with these different entries in sync (such as an Updated timestamp).  </p>\n\n<p>The other approach is to have two separate tables, one for non-language specific text (id, created date, created user, updated date, etc) and another table containing the language specific text.  So the tables might look something like this:</p>\n\n<p>First Table: Article Id | Created By | Created Date | Updated By | Updated Date</p>\n\n<p>Second Table: Article Id | Language Id | Language Specific Article Text</p>\n\n<p>For me, the question comes down to updating the non-language dependent data.  If you are updating that data then I would lean towards the second approach, otherwise I would go with the first approach as I view that as simpler (can't forget the KISS principle).</p>\n"}, {'answer_id': 120364, 'author': 'Keith', 'author_id': 905, 'author_profile': 'https://Stackoverflow.com/users/905', 'pm_score': 4, 'selected': True, 'text': '<p>Firstly put all code for all languages under one domain - it will help your google-rank.</p>\n\n<p>We have a fully multi-lingual system, with localisations stored in a database but cached with the web application.</p>\n\n<p>Wherever we want a localisation to appear we use:</p>\n\n<pre><code>&lt;%$ Resources: LanguageProvider, Path/To/Localisation %&gt;\n</code></pre>\n\n<p>Then in our web.config:</p>\n\n<pre><code>&lt;globalization resourceProviderFactoryType="FactoryClassName, AssemblyName"/&gt;\n</code></pre>\n\n<p><code>FactoryClassName</code> then implements <code>ResourceProviderFactory</code> to provide the actual dynamic functionality. Localisations are stored in the DB with a string key "Path/To/Localisation"</p>\n\n<p>It is important to cache the localised values - you don\'t want to have lots of DB lookups on each page, and we cache thousands of localised strings with no performance issues.</p>\n\n<p>Use the user\'s current browser localisation to choose what language to serve up.</p>\n'}, {'answer_id': 933114, 'author': 'ilya n.', 'author_id': 115200, 'author_profile': 'https://Stackoverflow.com/users/115200', 'pm_score': 0, 'selected': False, 'text': "<p>Wonderful question. </p>\n\n<p>I solved this problem for the website I made (link in my profile) with a homemade Python 3 script that translates the general template on the fly and inserts a specific content page from a language requested (or guessed by Apache from Accept-Language).</p>\n\n<p>It was fun since I got to learn Python and write my own mini-library for creating content pages. One downside was that our hosting didn't have Python 3, but I made my script generate static HTML (the original one was examining User-agent) and then upload it to server. That works so far and making a new language version of the site is now a breeze :)</p>\n\n<p>The biggest downside of this method is that it is time-consuming to write things from scratch. So if you want, drop me line and I'll help you use my script :)</p>\n"}, {'answer_id': 933135, 'author': 'ilya n.', 'author_id': 115200, 'author_profile': 'https://Stackoverflow.com/users/115200', 'pm_score': 0, 'selected': False, 'text': '<p>As for the URL format, I use <code>site.com/content/example.fr</code> since this allows Apache to perform language negotiation in case somebody asks for <code>/content/example</code> and has a browser tell that it likes French language. When you do this Apache also adds <code>.html</code> or whatever as a bonus.</p>\n\n<p>So when a request is for <code>example</code> and I have files </p>\n\n<pre><code>example.fr\nexample.en\nexample.vi\n</code></pre>\n\n<p>Apache will automatically proceed with <code>example.vi</code> for a person with Vietnamese-configured browser or <code>example.en</code> for a person with German-configured browser. Pretty useful. </p>\n'}]
['https://Stackoverflow.com/questions/72410', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11461/']