Skip to content

Commit

Permalink
right to left support
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Aug 31, 2018
1 parent 90daf5c commit 12c944b
Show file tree
Hide file tree
Showing 7 changed files with 13,755 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ckan/lib/app_globals.py
Expand Up @@ -56,6 +56,7 @@
'name': 'facets'},
'package_hide_extras': {'type': 'split'},
'ckan.plugins': {'type': 'split'},
'ckan.i18n.rtl_languages': {'type': 'split'},

# bool
'debug': {'default': 'false', 'type' : 'bool'},
Expand All @@ -82,6 +83,12 @@ def set_main_css(css_file):
# FIXME we should check the css file exists
app_globals.main_css = str(new_css)

def set_rtl_globals(rtl_css_file, rtl_languages):
assert rtl_css_file.endswith('.css')
new_css = rtl_css_file
# FIXME we should check the css file exists
app_globals.rtl_css = str(new_css)
app_globals.rtl_languages = rtl_languages

def set_app_global(key, value):
'''
Expand Down Expand Up @@ -174,6 +181,10 @@ def get_config_value(key, default=''):
main_css = get_config_value('ckan.main_css', '/base/css/main.css')
set_main_css(main_css)

rtl_css_file = get_config_value('ckan.i18n.rtl_css', '/base/css/rtl.css')
rtl_languages = get_config_value('ckan.i18n.rtl_languages', 'he ar')
set_rtl_globals(rtl_css_file, rtl_languages)

if app_globals.site_logo:
app_globals.header_class = 'header-image'
elif not app_globals.site_description:
Expand Down
3 changes: 3 additions & 0 deletions ckan/public/base/css/resource.config
@@ -0,0 +1,3 @@
[custom render order]

rtl.css = 999

0 comments on commit 12c944b

Please sign in to comment.