i18n.js 688 B

12345678910111213141516171819202122232425262728293031
  1. import i18next from "i18next";
  2. import XHR from "i18next-xhr-backend";
  3. import config from "config";
  4. const i18n = i18next
  5. .use(XHR)
  6. .init({
  7. lng: "en",
  8. debug: false,
  9. fallbackLng: "en",
  10. referenceLng: "en",
  11. backend: {
  12. loadPath: "https://translation.musare.com/{{lng}}/{{ns}}.json",
  13. //addPath: "https://translation.musare.com/add/{{lng}}/{{ns}}",
  14. allowMultiLoading: false,
  15. crossDomain: false,
  16. withCredentials: false,
  17. queryStringParams: { v: config.version },
  18. },
  19. ns: ["general"],
  20. defaultNS: "general",
  21. interpolation: {
  22. escapeValue: false, // not needed for react!!
  23. formatSeparator: ",",
  24. },
  25. react: {
  26. wait: true,
  27. },
  28. });
  29. export default i18n;