| 1 | /** |
| 2 | * Manages language items. |
| 3 | * |
| 4 | * @author Tim Duesterhus |
| 5 | * @copyright 2001-2019 WoltLab GmbH |
| 6 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
| 7 | */ |
| 8 | define(["require", "exports"], function (require, exports) { |
| 9 | "use strict"; |
| 10 | Object.defineProperty(exports, "__esModule", { value: true }); |
| 11 | exports.addObject = exports.add = exports.get = exports.registerPhrase = exports.getPhrase = void 0; |
| 12 | function getPhrase(key, parameters = {}) { |
| 13 | return window.WoltLabLanguage.getPhrase(key, parameters); |
| 14 | } |
| 15 | exports.getPhrase = getPhrase; |
| 16 | function registerPhrase(key, value) { |
| 17 | window.WoltLabLanguage.registerPhrase(key, value); |
| 18 | } |
| 19 | exports.registerPhrase = registerPhrase; |
| 20 | /** |
| 21 | * @deprecated 6.0 Use `getPhrase()` instead |
| 22 | */ |
| 23 | function get(key, parameters = {}) { |
| 24 | return getPhrase(key, parameters); |
| 25 | } |
| 26 | exports.get = get; |
| 27 | /** |
| 28 | * @deprecated 6.0 Use `registerPhrase()` instead |
| 29 | */ |
| 30 | function add(key, value) { |
| 31 | registerPhrase(key, value); |
| 32 | } |
| 33 | exports.add = add; |
| 34 | /** |
| 35 | * @deprecated 6.0 Use `registerPhrase()` instead |
| 36 | */ |
| 37 | function addObject(object) { |
| 38 | Object.entries(object).forEach(([key, value]) => { |
| 39 | registerPhrase(key, value); |
| 40 | }); |
| 41 | } |
| 42 | exports.addObject = addObject; |
| 43 | }); |