mirror of https://github.com/onweru/compose.git

weru
14.48.2023 eadf6c63e07bba43ef1cba8f06194bfbd3a46ec6
inline script translations #101

Signed-off-by: weru <fromweru@gmail.com>
1 files added
3 files modified
32 ■■■■ changed files
assets/js/search/variables.js 7 ●●●●● patch | view | raw | blame | history
assets/js/variables.js 8 ●●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 1 ●●●● patch | view | raw | blame | history
layouts/partials/scripts/translations.html 16 ●●●●● patch | view | raw | blame | history
assets/js/search/variables.js
@@ -5,13 +5,6 @@
let search_term = empty_string;
const search_field = elem(search_field_class);
// defined in i18n / translation files
const quick_links = '{{ T "quick_links" }}';
const search_results_label = '{{ T "search_results_label" }}';
const short_search_query = '{{ T "short_search_query" }}'
const type_to_search = '{{ T "type_to_search" }}';
const no_matches_found = '{{ T "no_matches" }}';
// values defined under config/_default/params.toml
let other_searchable_fields = '{{ delimit (default slice site.Params.otherSearchableFields) ", " }}'
assets/js/variables.js
@@ -17,14 +17,6 @@
const code_block_config = JSON.parse('{{ partial "functions/getCodeConfig" . }}');
const iconsPath = `{{ partialCached "functions/getIconPath" . }}`;
// defined in i18n / translation files
const copy_text = '{{ T "copy" }}';
const copied_text = '{{ T "copied" }}';
const toggle_line_numbers_text = '{{ T "toggle_line_numbers" }}';
const toggle_line_wrap_text = '{{ T "toggle_line_wrap" }}';
const resize_snippet = '{{ T "resize_snippet" }}';
const not_set = '{{ T "not_set" }}';
const shell_based = ['sh', 'shell', 'zsh', 'bash'];
const body = elem('body');
layouts/_default/baseof.html
@@ -36,6 +36,7 @@
    {{- end -}}
  </div>
  {{ end }}
  {{- partial "scripts/translations" . -}}
  {{- partialCached "footer" . -}}
  {{- partialCached "sprites" . -}}
  {{- partial "scripts/bundle" . -}}
layouts/partials/scripts/translations.html
New file
@@ -0,0 +1,16 @@
<script>
// defined in i18n / translation files
const copy_text = '{{ T "copy" }}';
const copied_text = '{{ T "copied" }}';
const toggle_line_numbers_text = '{{ T "toggle_line_numbers" }}';
const toggle_line_wrap_text = '{{ T "toggle_line_wrap" }}';
const resize_snippet = '{{ T "resize_snippet" }}';
const not_set = '{{ T "not_set" }}';
// defined in i18n / translation files
const quick_links = '{{ T "quick_links" }}';
const search_results_label = '{{ T "search_results_label" }}';
const short_search_query = '{{ T "short_search_query" }}'
const type_to_search = '{{ T "type_to_search" }}';
const no_matches_found = '{{ T "no_matches" }}';
</script>