Hi Andrea,
You'll actually have to do several things to present the site in another
language.

   1. You'll have to add supply your own version of the template/header.htm
   file and as you mentioned loop through the languages provided by the
   system.  To do that you'll probably want to add a context processor that
   get's the language information from the database.  See
   arches/app/utils/context_processors.py for examples.  Once you've created
   that, then add a reference to it in the TEMPLATE_CONTEXT_PROCESSORS section
   of settings.py.  Once you've done this you should be able to access the
   languages from your new header.htm template.
   2. In settings.py go to MIDDLEWARE_CLASSES and uncomment the line:
   'django.middleware.locale.LocaleMiddleware'
   3. Read the section entitled "How Django discovers language preference"
   in the reference documentation found here:
   https://media.readthedocs.org/pdf/django/1.6.x/django.pdf . There are
   several ways to set the language, but the easiest might be to set a cookie.

Once you've done those things you should be well on your way to displaying
your site in Arabic.
Chees,
Alexei


Director of Web Development - Farallon Geographics, Inc. - 971.227.3173

On Mon, Jun 6, 2016 at 7:12 AM, <[email protected]> wrote:

> I am not sure I explained myself correctly Adam. Let me try again: we have
> translated our entire platform in Arabic, including both the static strings
> which Django reads via the .mo file and our nodes and concepts. The
> translations for the latter two have been entered via the RDM as altLabels
> selecting Arabic as a language. Arabic had been previously added as a
> language via the Django admin panel (Models -> d_languages).
>
> Now, what I want to do is to be able to select the appropriate app
> language in the header dropdown so that, when I select Arabic, I get the
> whole app to be shown in Arabic. Do I have to write this whole class from
> scratch? Or does something exist already to support multilingual apps?
>
> Andrea
>
>
> On Wednesday, June 1, 2016 at 10:38:48 PM UTC+1, Adam Cox wrote:
>>
>> Hi Andrea, technically this is possible, but I don't think it would do
>> what you are hoping... The Languages dropdown is meant to be configured to
>> allow the user to change the app's interface language, while the language
>> concepts are only meant to be attributes for a resource (the language that
>> an Information Resource is written in, for example).
>>
>> Adam
>>
>> On Wednesday, May 25, 2016 at 12:59:08 AM UTC-6, [email protected]
>> wrote:
>>>
>>> Hi All,
>>>
>>> I am in need to change the static 'Languages' dropdown menu in the
>>> header.htm template to a dynamic one looping through the list of languages
>>> in the concepts.d_languages table. Has someone already written this code ?
>>> I couldn't figure out how to read the language table via Django tags.
>>>
>>> Best,
>>>
>>> Andrea
>>>
>> --
> -- To post, send email to [email protected]. To unsubscribe,
> send email to [email protected]. For more
> information, visit https://groups.google.com/d/forum/archesproject?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Arches Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- To post, send email to [email protected]. To unsubscribe, send 
email to [email protected]. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to