<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Design Notes</title><link rel="stylesheet" type="text/css" href="openacs.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="i18n.html" title="Chapter 14. Internationalization"><link rel="previous" href="i18n-convert.html" title="How to Internationalize a Package"><link rel="next" href="i18n-translators.html" title="Translator&#39;s Guide"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="i18n-convert.html">Prev</a> </td><th width="60%" align="center">Chapter 14. Internationalization</th><td width="20%" align="right"> <a accesskey="n" href="i18n-translators.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="i18n-design"></a>Design Notes</h2></div></div></div><p>User locale is a property of ad_conn, <code class="computeroutput">ad_conn locale</code>.  The request processor sets this by calling <code class="computeroutput">lang::conn::locale</code>, which looks for the following in order of precedence:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Use user preference for this package (stored in ad_locale_user_prefs)</p></li><li class="listitem"><p>Use system preference for the package (stored in apm_packages)</p></li><li class="listitem"><p>Use user&#39;s general preference (stored in user_preferences)</p></li><li class="listitem"><p>Use Browser header (<code class="computeroutput">Accept-Language</code> HTTP header)</p></li><li class="listitem"><p>Use system locale (an APM parameter for acs_lang)</p></li><li class="listitem"><p>default to en_US</p></li></ol></div><p>For ADP pages, message key lookup occurs in the templating engine.  For Tcl pages, message key lookup happens with the <code class="computeroutput">_</code> function.  In both cases, if the requested locale is not found but a locale which is the default for the language which matches your locale&#39;s language is
found, then that locale is offered instead.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="i18n-convert.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="i18n-translators.html">Next</a></td></tr><tr><td width="40%" align="left">How to Internationalize a Package </td><td width="20%" align="center"><a accesskey="u" href="i18n.html">Up</a></td><td width="40%" align="right"> Translator&#39;s Guide</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/i18n-design.html#comments">View comments on this page at openacs.org</a></center></body></html>