tweak newlines in trans dump

pull/3304/merge
Niklas Fiekas 2017-07-16 11:58:59 +02:00
parent 24e4ed63ff
commit 54d1636c6f
2 changed files with 7 additions and 8 deletions

View File

@ -17,8 +17,8 @@ function keyListFrom(name) {
const keys = strings.concat(plurals);
resolve({
name: name,
code: keys.map(k => 'val `' + k + '` = new Translated("' + k + '", ' + ucfirst(name) + ')').join('\n'),
all: needsKeys.includes(name) && 'val allKeys = List(' + keys.map(k => '`' + k + '`').join(', ') + ')'
code: keys.map(k => 'val `' + k + '` = new Translated("' + k + '", ' + ucfirst(name) + ')').join('\n') + '\n',
all: needsKeys.includes(name) && 'val allKeys = List(' + keys.map(k => '`' + k + '`').join(', ') + ')\n'
});
}));
});
@ -27,8 +27,8 @@ function keyListFrom(name) {
Promise.all(dbs.map(keyListFrom)).then(objs => {
function dbCode(obj) {
return obj.name === 'site' ?
`${obj.code}\n` :
`object ${obj.name} {\n${obj.code}\n${obj.all || ''}\n}\n`;
obj.code :
`object ${obj.name} {\n${obj.code}${obj.all || ''}}\n`;
}
const code = `// Generated with bin/trans-dump.js
package lila.i18n
@ -41,7 +41,8 @@ object I18nKeys {
def untranslated(message: String) = new Untranslated(message)
${objs.map(dbCode).join('\n')}
}`;
}
`;
fs.writeFile('modules/i18n/src/main/I18nKeys.scala', code);
});

View File

@ -672,7 +672,6 @@ val `otherRules` = new Translated("otherRules", Arena)
val `otherRulesAnswer` = new Translated("otherRulesAnswer", Arena)
val `thisIsPrivate` = new Translated("thisIsPrivate", Arena)
val `shareUrl` = new Translated("shareUrl", Arena)
}
object emails {
@ -687,7 +686,6 @@ val `emailChange_intro` = new Translated("emailChange_intro", Emails)
val `emailChange_click` = new Translated("emailChange_click", Emails)
val `common_orPaste` = new Translated("common_orPaste", Emails)
val `common_note` = new Translated("common_note", Emails)
}
object learn {
@ -865,4 +863,4 @@ val `retry` = new Translated("retry", Learn)
val allKeys = List(`learnChess`, `byPlaying`, `menu`, `progressX`, `resetMyProgress`, `youWillLoseAllYourProgress`, `play`, `chessPieces`, `theRook`, `itMovesInStraightLines`, `rookIntro`, `rookGoal`, `grabAllTheStars`, `theFewerMoves`, `useTwoRooks`, `rookComplete`, `theBishop`, `itMovesDiagonally`, `bishopIntro`, `youNeedBothBishops`, `bishopComplete`, `theQueen`, `queenCombinesRookAndBishop`, `queenIntro`, `queenComplete`, `theKing`, `theMostImportantPiece`, `kingIntro`, `theKingIsSlow`, `lastOne`, `kingComplete`, `theKnight`, `itMovesInAnLShape`, `knightIntro`, `knightsHaveAFancyWay`, `knightsCanJumpOverObstacles`, `knightComplete`, `thePawn`, `itMovesForwardOnly`, `pawnIntro`, `pawnsMoveOneSquareOnly`, `mostOfTheTimePromotingToAQueenIsBest`, `pawnsMoveForward`, `captureThenPromote`, `useAllThePawns`, `aPawnOnTheSecondRank`, `grabAllTheStarsNoNeedToPromote`, `pawnComplete`, `pawnPromotion`, `yourPawnReachedTheEndOfTheBoard`, `itNowPromotesToAStrongerPiece`, `selectThePieceYouWant`, `fundamentals`, `capture`, `takeTheEnemyPieces`, `captureIntro`, `takeTheBlackPieces`, `takeTheBlackPiecesAndDontLoseYours`, `captureComplete`, `protection`, `keepYourPiecesSafe`, `protectionIntro`, `protectionComplete`, `escape`, `noEscape`, `dontLetThemTakeAnyUndefendedPiece`, `combat`, `captureAndDefendPieces`, `combatIntro`, `combatComplete`, `checkInOne`, `attackTheOpponentsKing`, `checkInOneIntro`, `checkInOneGoal`, `checkInOneComplete`, `outOfCheck`, `defendYourKing`, `outOfCheckIntro`, `escapeWithTheKing`, `theKingCannotEscapeButBlock`, `youCanGetOutOfCheckByTaking`, `thisKnightIsCheckingThroughYourDefenses`, `escapeOrBlock`, `outOfCheckComplete`, `mateInOne`, `defeatTheOpponentsKing`, `mateInOneIntro`, `attackYourOpponentsKing`, `mateInOneComplete`, `intermediate`, `boardSetup`, `howTheGameStarts`, `boardSetupIntro`, `thisIsTheInitialPosition`, `firstPlaceTheRooks`, `thenPlaceTheKnights`, `placeTheBishops`, `placeTheQueen`, `placeTheKing`, `pawnsFormTheFrontLine`, `boardSetupComplete`, `castling`, `theSpecialKingMove`, `castlingIntro`, `castleKingSide`, `castleQueenSide`, `theKnightIsInTheWay`, `castleKingSideMovePiecesFirst`, `castleQueenSideMovePiecesFirst`, `youCannotCastleIfMoved`, `youCannotCastleIfAttacked`, `findAWayToCastleKingSide`, `findAWayToCastleQueenSide`, `castlingComplete`, `enPassant`, `theSpecialPawnMove`, `enPassantIntro`, `blackJustMovedThePawnByTwoSquares`, `enPassantOnlyWorksImmediately`, `enPassantOnlyWorksOnFifthRank`, `takeAllThePawnsEnPassant`, `enPassantComplete`, `stalemate`, `theGameIsADraw`, `stalemateIntro`, `stalemateGoal`, `stalemateComplete`, `advanced`, `pieceValue`, `evaluatePieceStrength`, `pieceValueIntro`, `queenOverBishop`, `takeThePieceWithTheHighestValue`, `pieceValueComplete`, `checkInTwo`, `twoMovesToGiveCheck`, `checkInTwoIntro`, `checkInTwoGoal`, `checkInTwoComplete`, `whatNext`, `youKnowHowToPlayChess`, `register`, `getAFreeLichessAccount`, `practice`, `learnCommonChessPositions`, `puzzles`, `exerciseYourTacticalSkills`, `videos`, `watchInstructiveChessVideos`, `playPeople`, `opponentsFromAroundTheWorld`, `playMachine`, `testYourSkillsWithTheComputer`, `letsGo`, `stageX`, `awesome`, `excellent`, `greatJob`, `perfect`, `outstanding`, `wayToGo`, `yesYesYes`, `youreGoodAtThis`, `nailedIt`, `rightOn`, `stageXComplete`, `yourScore`, `next`, `backToMenu`, `puzzleFailed`, `retry`)
}
}
}