e26fdf72-cbae-40e2-adff-264a559c5620.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. "use strict";
  2. cc._RF.push(module, 'e26fd9yy65A4q3/JkpVnFYg', 'polyglot.min');
  3. // polyglot.min.js
  4. "use strict";
  5. // (c) 2012 Airbnb, Inc.
  6. //
  7. // polyglot.js may be freely distributed under the terms of the BSD
  8. // license. For all licensing information, details, and documention:
  9. // http://airbnb.github.com/polyglot.js
  10. //
  11. //
  12. // Polyglot.js is an I18n helper library written in JavaScript, made to
  13. // work both in the browser and in Node. It provides a simple solution for
  14. // interpolation and pluralization, based off of Airbnb's
  15. // experience adding I18n functionality to its Backbone.js and Node apps.
  16. //
  17. // Polylglot is agnostic to your translation backend. It doesn't perform any
  18. // translation; it simply gives you a way to manage translated phrases from
  19. // your client- or server-side JavaScript application.
  20. //
  21. (function (e, t) {
  22. typeof define == "function" && define.amd ? define([], function () {
  23. return t(e);
  24. }) : typeof exports == "object" ? module.exports = t(e) : e.Polyglot = t(e);
  25. })(void 0, function (e) {
  26. "use strict";
  27. function t(e) {
  28. e = e || {}, this.phrases = {}, this.extend(e.phrases || {}), this.currentLocale = e.locale || "en", this.allowMissing = !!e.allowMissing, this.warn = e.warn || c;
  29. }
  30. function s(e) {
  31. var t,
  32. n,
  33. r,
  34. i = {};
  35. for (t in e) {
  36. if (e.hasOwnProperty(t)) {
  37. n = e[t];
  38. for (r in n) {
  39. i[n[r]] = t;
  40. }
  41. }
  42. }
  43. return i;
  44. }
  45. function o(e) {
  46. var t = /^\s+|\s+$/g;
  47. return e.replace(t, "");
  48. }
  49. function u(e, t, r) {
  50. var i, s, u;
  51. return r != null && e ? (s = e.split(n), u = s[f(t, r)] || s[0], i = o(u)) : i = e, i;
  52. }
  53. function a(e) {
  54. var t = s(i);
  55. return t[e] || t.en;
  56. }
  57. function f(e, t) {
  58. return r[a(e)](t);
  59. }
  60. function l(e, t) {
  61. for (var n in t) {
  62. n !== "_" && t.hasOwnProperty(n) && (e = e.replace(new RegExp("%\\{" + n + "\\}", "g"), t[n]));
  63. }
  64. return e;
  65. }
  66. function c(t) {
  67. e.console && e.console.warn && e.console.warn("WARNING: " + t);
  68. }
  69. function h(e) {
  70. var t = {};
  71. for (var n in e) {
  72. t[n] = e[n];
  73. }
  74. return t;
  75. }
  76. t.VERSION = "0.4.3", t.prototype.locale = function (e) {
  77. return e && (this.currentLocale = e), this.currentLocale;
  78. }, t.prototype.extend = function (e, t) {
  79. var n;
  80. for (var r in e) {
  81. e.hasOwnProperty(r) && (n = e[r], t && (r = t + "." + r), typeof n == "object" ? this.extend(n, r) : this.phrases[r] = n);
  82. }
  83. }, t.prototype.clear = function () {
  84. this.phrases = {};
  85. }, t.prototype.replace = function (e) {
  86. this.clear(), this.extend(e);
  87. }, t.prototype.t = function (e, t) {
  88. var n, r;
  89. return t = t == null ? {} : t, typeof t == "number" && (t = {
  90. smart_count: t
  91. }), typeof this.phrases[e] == "string" ? n = this.phrases[e] : typeof t._ == "string" ? n = t._ : this.allowMissing ? n = e : (this.warn('Missing translation for key: "' + e + '"'), r = e), typeof n == "string" && (t = h(t), r = u(n, this.currentLocale, t.smart_count), r = l(r, t)), r;
  92. }, t.prototype.has = function (e) {
  93. return e in this.phrases;
  94. };
  95. var n = "||||",
  96. r = {
  97. chinese: function chinese(e) {
  98. return 0;
  99. },
  100. german: function german(e) {
  101. return e !== 1 ? 1 : 0;
  102. },
  103. french: function french(e) {
  104. return e > 1 ? 1 : 0;
  105. },
  106. russian: function russian(e) {
  107. return e % 10 === 1 && e % 100 !== 11 ? 0 : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2;
  108. },
  109. czech: function czech(e) {
  110. return e === 1 ? 0 : e >= 2 && e <= 4 ? 1 : 2;
  111. },
  112. polish: function polish(e) {
  113. return e === 1 ? 0 : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2;
  114. },
  115. icelandic: function icelandic(e) {
  116. return e % 10 !== 1 || e % 100 === 11 ? 1 : 0;
  117. }
  118. },
  119. i = {
  120. chinese: ["fa", "id", "ja", "ko", "lo", "ms", "th", "tr", "zh"],
  121. german: ["da", "de", "en", "es", "fi", "el", "he", "hu", "it", "nl", "no", "pt", "sv"],
  122. french: ["fr", "tl", "pt-br"],
  123. russian: ["hr", "ru"],
  124. czech: ["cs"],
  125. polish: ["pl"],
  126. icelandic: ["is"]
  127. };
  128. return t;
  129. });
  130. cc._RF.pop();