You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

i18n-as-script.html 750 B

2 years ago
123456789101112131415161718192021222324
  1. {% comment %}
  2. get the current translations from Jekyll, to be used in scripts
  3. {% endcomment }%}
  4. <script>
  5. var i18n_default = {{ site.data.i18n.en.script | jsonify }};
  6. window.i18n = {{ i18n.script | jsonify }} || {};
  7. window.i18n.url_base = {{ url_base | jsonify }};
  8. window.i18n.active_language = {{ vars_active_language.tag | jsonify }};
  9. // give defaults
  10. function copyDefaults(from, to) {
  11. for (var key in from) {
  12. if (from[key] !== null && typeof from[key] === 'object') {
  13. copyDefaults(from[key], to[key] || (to[key] = {}));
  14. continue;
  15. }
  16. if (to.hasOwnProperty(key) === false || to[key] === null) {
  17. to[key] = from[key];
  18. }
  19. }
  20. }
  21. copyDefaults(i18n_default, window.i18n);
  22. </script>

js yarn包管理组件依赖分析

Contributors (1)