-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18n
More file actions
36 lines (31 loc) · 1.21 KB
/
i18n
File metadata and controls
36 lines (31 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{%- if include.id contains '.' -%}
{%- assign split_id = include.id | split: '.' -%}
{%- assign this_id = split_id[1] -%}
{%- assign ui_data_path = split_id[0] -%}
{%- elsif include.source -%}
{%- assign this_id = include.id -%}
{%- assign ui_data_path = include.source -%}
{%- elsif site.ui_data_path -%}
{%- assign this_id = include.id -%}
{%- assign ui_data_path = site.ui_data_path -%}
{%- else -%}
{%- assign this_id = include.id -%}
{%- assign ui_data_path = 'patterns' -%}
{%- endif -%}
{%- if include.lang -%}
{%- assign this_lang = include.lang -%}
{%- elsif page.lang -%}
{%- assign this_lang = page.lang -%}
{%- elsif site.lang -%}
{%- assign this_lang = site.lang -%}
{%- else -%}
{%- assign this_lang = site.data.config.lang -%}
{%- endif -%}
{%- unless include.sentinel == false -%}<!-- <pat-i18n handle="{{ this_id }}" source="{{ ui_data_path }}" lang="{{ this_lang }}" >-->{%- endunless -%}
{%- assign this_translation = site.data[ui_data_path].ui[this_id][this_lang] -%}
{%- if this_translation == null -%}
{{- include.id -}}
{%- else -%}
{{- this_translation -}}
{%- endif -%}
{%- unless include.sentinel == false -%}<!-- </pat-i18n> -->{%- endunless -%}