kokopu
Version:
A JavaScript/TypeScript library implementing the chess game rules and providing tools to read/write the standard chess file formats.
112 lines • 8.7 kB
JavaScript
;
/*!
* -------------------------------------------------------------------------- *
* *
* Kokopu - A JavaScript/TypeScript chess library. *
* <https://www.npmjs.com/package/kokopu> *
* Copyright (C) 2018-2026 Yoann Le Montagner <yo35 -at- melix.net> *
* *
* Kokopu is free software: you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
* as published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version. *
* *
* Kokopu is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General *
* Public License along with this program. If not, see *
* <http://www.gnu.org/licenses/>. *
* *
* -------------------------------------------------------------------------- */
Object.defineProperty(exports, "__esModule", { value: true });
exports.i18n = void 0;
/**
* This module defines the localizable strings used by the library.
*/
var i18n;
(function (i18n) {
/* eslint-disable prefer-const, @stylistic/indent, @stylistic/no-multi-spaces */
// WARNING: all those constants must be declared with "let" to allow them to be re-defined if necessary by consumer codes.
// FEN parsing error messages
i18n.WRONG_NUMBER_OF_FEN_FIELDS = 'A FEN string must contain exactly 6 space-separated fields.';
i18n.WRONG_NUMBER_OF_SUBFIELDS_IN_BOARD_FIELD = 'The 1st field of a FEN string must contain exactly 8 `/`-separated subfields.';
i18n.UNEXPECTED_CHARACTER_IN_BOARD_FIELD = 'Unexpected character in the 1st field of the FEN string: `{0}`.';
i18n.UNEXPECTED_END_OF_SUBFIELD_IN_BOARD_FIELD = 'Subfield {0} of the FEN string 1st field is unexpectedly short.';
i18n.INVALID_TURN_FIELD = 'The 2nd field of a FEN string must be either `w` or `b`.';
i18n.INVALID_CASTLING_FIELD = 'The 3rd field of a FEN string must be either `-` or a list of characters among `K`, `Q`, `k` and `q` (in this order).';
i18n.INVALID_EN_PASSANT_FIELD = 'The 4th field of a FEN string must be either `-` or a square from the 3rd or 6th rank where en-passant is allowed.';
i18n.WRONG_RANK_IN_EN_PASSANT_FIELD = 'The rank number indicated in the FEN string 4th field is inconsistent with respect to the 2nd field.';
i18n.INEFFECTIVE_EN_PASSANT_FIELD = 'No en-passant capture can happen on file {0} in the position defined in the FEN string.';
i18n.INVALID_HALF_MOVE_COUNT_FIELD = 'The 5th field of a FEN string must be a number, indicating the number of half-move since the last pawn move or capture.';
i18n.INVALID_MOVE_NUMBER_FIELD = 'The 6th field of a FEN string must be a number, indicating the move number of the game.';
i18n.INVALID_VARIANT_PREFIX = 'Invalid variant prefix: `{0}`.';
// Notation & UCI parsing error messages
i18n.INVALID_UCI_NOTATION_SYNTAX = 'The syntax of the UCI notation is invalid.';
i18n.ILLEGAL_UCI_MOVE = 'The UCI move is not legal.';
i18n.INVALID_MOVE_NOTATION_SYNTAX = 'The syntax of the move notation is invalid.';
i18n.ILLEGAL_POSITION = 'The position is not legal.';
i18n.ILLEGAL_NO_KING_CASTLING = 'Castling is not legal in the considered position as it has no king.';
i18n.ILLEGAL_QUEEN_SIDE_CASTLING = 'Queen-side castling is not legal in the considered position.';
i18n.ILLEGAL_KING_SIDE_CASTLING = 'King-side castling is not legal in the considered position.';
i18n.NO_PIECE_CAN_MOVE_TO = 'No {0} can move to {1}.';
i18n.NO_PIECE_CAN_MOVE_TO_DISAMBIGUATION = 'No {0} on the specified rank/file can move to {1}.';
i18n.REQUIRE_DISAMBIGUATION = 'Cannot determine uniquely which {0} is supposed to move to {1}.';
i18n.WRONG_DISAMBIGUATION_SYMBOL = 'Wrong disambiguation symbol (expected: `{0}`, observed: `{1}`).';
i18n.CASTLING_MOVE_ENCODED_WITH_ZERO = 'Capital O must be used for castling moves (instead of digit 0).';
i18n.TRYING_TO_CAPTURE_YOUR_OWN_PIECES = 'Capturing its own pieces is not legal.';
i18n.CAPTURE_IS_MANDATORY = 'Capture is mandatory.';
i18n.INVALID_PIECE_SYMBOL = 'Character `{0}` is not a valid piece symbol.';
i18n.INVALID_PIECE_SYMBOL_COLOR = 'Invalid color for piece symbol `{0}`.';
i18n.INVALID_CAPTURING_PAWN_MOVE = 'Invalid capturing pawn move.';
i18n.INVALID_NON_CAPTURING_PAWN_MOVE = 'Invalid non-capturing pawn move.';
i18n.NOT_SAFE_FOR_WHITE_KING = 'This move would let the white king in check.';
i18n.NOT_SAFE_FOR_BLACK_KING = 'This move would let the black king in check.';
i18n.MISSING_PROMOTION = 'A promoted piece must be specified for this move.';
i18n.MISSING_PROMOTION_SYMBOL = 'Character `=` is required to specify a promoted piece.';
i18n.INVALID_PROMOTED_PIECE = '{0} cannot be specified as a promoted piece.';
i18n.ILLEGAL_PROMOTION = 'Specifying a promoted piece is illegal for this move.';
i18n.ILLEGAL_NULL_MOVE = 'Cannot play a null-move in this position.';
i18n.MISSING_CAPTURE_SYMBOL = 'Capture symbol `x` is missing.';
i18n.INVALID_CAPTURE_SYMBOL = 'This move is not a capture move.';
i18n.WRONG_CHECK_CHECKMATE_SYMBOL = 'Wrong check/checkmate symbol (expected: `{0}`, observed: `{1}`).';
// PGN parsing error messages
i18n.INVALID_PGN_TOKEN = 'Unrecognized character or group of characters.';
i18n.INVALID_MOVE_IN_PGN_TEXT = 'Invalid move ({0}). {1}';
i18n.INVALID_FEN_IN_PGN_TEXT = 'Invalid FEN string in the initial position header. {0}';
i18n.UNEXPECTED_PGN_HEADER = 'Unexpected PGN game header.';
i18n.MISSING_PGN_HEADER_ID = 'Missing or invalid PGN game header ID.';
i18n.MISSING_PGN_HEADER_VALUE = 'Missing or invalid PGN game header value.';
i18n.MISSING_END_OF_PGN_HEADER = 'Missing or invalid end of PGN game header.';
i18n.UNEXPECTED_BEGIN_OF_VARIATION = 'Unexpected begin of variation.';
i18n.UNEXPECTED_END_OF_VARIATION = 'Unexpected end of variation.';
i18n.UNEXPECTED_END_OF_GAME = 'Unexpected end of game: there are pending variations.';
i18n.INVALID_GAME_INDEX = 'Game index {0} is invalid (only {1} game(s) found in the PGN data).';
i18n.UNKNOWN_VARIANT = 'Unknown chess game variant ({0}).';
i18n.VARIANT_WITHOUT_FEN = 'For game variant {0}, the FEN header is mandatory.';
// POJO deserializing error messages
i18n.POJO_MUST_BE_AN_OBJECT = 'Unexpected non-object value passed as POJO.';
i18n.INVALID_POJO_STRING_FIELD = 'Invalid value (must be a string).';
i18n.INVALID_POJO_NUMBER_FIELD = 'Invalid value (must be a number).';
i18n.INVALID_POJO_BOOLEAN_FIELD = 'Invalid value (must be a boolean).';
i18n.INVALID_POJO_OBJECT_FIELD = 'Invalid value (must be an object).';
i18n.INVALID_POJO_ARRAY_FIELD = 'Invalid value (must be an array).';
i18n.INVALID_ELO_IN_POJO = 'Ill-formed elo.';
i18n.INVALID_ROUND_IN_POJO = 'Ill-formed round, sub-round or sub-sub-round.';
i18n.INVALID_DATE_IN_POJO = 'Ill-formed date.';
i18n.INVALID_ECO_CODE_IN_POJO = 'Ill-formed ECO code.';
i18n.INVALID_RESULT_IN_POJO = 'Ill-formed result.';
i18n.INVALID_VARIANT_IN_POJO = 'Ill-formed variant.';
i18n.INVALID_NAG_IN_POJO = 'Invalid NAG ({0}).';
i18n.INVALID_TAG_IN_POJO = 'Invalid tag ({0}).';
i18n.INVALID_MOVE_IN_POJO = 'Invalid move ({0}). {1}';
i18n.INVALID_FEN_IN_POJO = 'Invalid initial position FEN. {0}';
i18n.MISSING_INITIAL_POSITION_IN_POJO = 'For game variant {0}, the initial position field is mandatory.';
i18n.INVALID_OR_MISSING_NODE_ARRAY = 'Invalid or missing node POJO array.';
i18n.INVALID_OR_MISSING_NOTATION_FIELD = 'Invalid or missing node POJO.';
i18n.NOT_A_NODE_POJO = 'A node POJO must be either a string or an object.';
i18n.NOT_A_VARIATION_POJO = 'A variation POJO must be either an array or an object.';
})(i18n || (exports.i18n = i18n = {}));
//# sourceMappingURL=i18n.js.map