i18n Support
This will add oslo.i18n language translation support. Change-Id: I3b9a2f5aed834903fa65aae3f11e7e86c6ccc237 Signed-off-by: Paarhati Ozkasgarli <ozkasgarli@gmail.com>
This commit is contained in:
parent
3e9983e5f4
commit
b0c21942ab
32
dash_stack_dashboard/_i18n.py
Normal file
32
dash_stack_dashboard/_i18n.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import oslo_i18n
|
||||||
|
|
||||||
|
oslo_i18n.enable_lazy()
|
||||||
|
|
||||||
|
DOMAIN = "dash_stack_dashboard"
|
||||||
|
|
||||||
|
_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN)
|
||||||
|
|
||||||
|
# The primary translation function using the well-known name "_"
|
||||||
|
_ = _translators.primary
|
||||||
|
|
||||||
|
# The contextual translation function using the name "_C"
|
||||||
|
# requires oslo.i18n >=2.1.0
|
||||||
|
_C = _translators.contextual_form
|
||||||
|
|
||||||
|
# The plural translation function using the name "_P"
|
||||||
|
# requires oslo.i18n >=2.1.0
|
||||||
|
_P = _translators.plural_form
|
||||||
|
|
||||||
|
# Translators for log levels.
|
||||||
|
#
|
||||||
|
# The abbreviated names are meant to reflect the usual use of a short
|
||||||
|
# name like '_'. The "L" is for "log" and the other letter comes from
|
||||||
|
# the level.
|
||||||
|
_LI = _translators.log_info
|
||||||
|
_LW = _translators.log_warning
|
||||||
|
_LE = _translators.log_error
|
||||||
|
_LC = _translators.log_critical
|
||||||
|
|
||||||
|
|
||||||
|
def get_available_languages():
|
||||||
|
return oslo_i18n.get_available_languages(DOMAIN)
|
5
requirement.txt
Normal file
5
requirement.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Babel==2.3.4
|
||||||
|
Django==1.10.3
|
||||||
|
mysqlclient==1.3.9
|
||||||
|
oslo.i18n==3.10.0
|
||||||
|
requests==2.12.1
|
Loading…
x
Reference in New Issue
Block a user