UNPKG

@winstrike/next-i18next-koa

Version:

The easiest way to translate your NextJs apps. With Koa support only. Forked from 'next-i18next'.

44 lines (34 loc) 1.22 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); var _default = function _default(initialLng, fallbackLng) { var languages = []; if (initialLng) { languages.push(initialLng); } if (fallbackLng) { if (typeof fallbackLng === 'string' && fallbackLng !== initialLng) { languages.push(fallbackLng); } if (Array.isArray(fallbackLng)) { languages.push.apply(languages, (0, _toConsumableArray2.default)(fallbackLng)); } else if (initialLng) { if (typeof fallbackLng[initialLng] === 'string') { languages.push(fallbackLng[initialLng]); } else if (Array.isArray(fallbackLng[initialLng])) { languages.push.apply(languages, (0, _toConsumableArray2.default)(fallbackLng[initialLng])); } } if (fallbackLng.default) { languages.push(fallbackLng.default); } } return languages; }; exports.default = _default; module.exports = exports.default; module.exports.default = exports.default;