Here are the examples of the python api django.conf.settings.LANGUAGE_CODE taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
145 Examples
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)
3
View Complete Implementation : multilingual_whoosh_backend.py
Copyright MIT License
Author : PacktPublishing
Copyright MIT License
Author : PacktPublishing
def update(self, index, iterable,
commit=True,
language_specific=False):
if not language_specific \
and self.connection_alias == "default":
current_language = (translation.get_language()
or settings.LANGUAGE_CODE)[:2]
for lang_code, lang_name in settings.LANGUAGES:
using = "default_%s" % lang_code
translation.activate(lang_code)
backend = connections[using].get_backend()
backend.update(index, iterable, commit,
language_specific=True)
translation.activate(current_language)
elif language_specific:
super().update(index, iterable, commit)