@winstrike/next-i18next-koa
Version:
The easiest way to translate your NextJs apps. With Koa support only. Forked from 'next-i18next'.
34 lines (26 loc) • 873 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _defaultConfig = require("../config/default-config");
var _default = function _default(nextI18NextInternals, lng) {
var _nextI18NextInternals = nextI18NextInternals.config,
defaultLanguage = _nextI18NextInternals.defaultLanguage,
localeSubpaths = _nextI18NextInternals.localeSubpaths;
if (lng) {
if (localeSubpaths === _defaultConfig.localeSubpathOptions.NONE) {
return false;
}
if (localeSubpaths === _defaultConfig.localeSubpathOptions.FOREIGN && lng !== defaultLanguage) {
return true;
}
if (localeSubpaths === _defaultConfig.localeSubpathOptions.ALL) {
return true;
}
}
return false;
};
exports.default = _default;
module.exports = exports.default;
module.exports.default = exports.default;