diff --git a/README.md b/README.md index 1642e75..970dfff 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ This repository obtains and reformats cards for the Leder Spotlight application. - `npm run build:card-symbols` - move the card symbol icons - `npm run build:card-images` - move the card images - `npm run build:i18n` - build the i18n files and ensure that they're formatted correctly +- `npm run validate` - validate everything - `npm run validate:card-data` - validate the card data is formatted correctly ## Adding New Content @@ -39,6 +40,14 @@ Follow the guide for adding a new locale 1. Create a new folder in `content/card-images/{product}` for the locale (probably `en-US`) 1. Fill this folder with the images for the cards for the game. +### Adding New Filters + +When adding new filters in a meta data file that previously did not exist, you must also: + +1. Navigate to each locale file (in the `i18n` folder) +1. Go to `Pages.AdvancedSearch` +1. Add a similar entry as seen there for your new filter. + ## Publishing New Content This is done automatically when a PR is merged to `master`, and isn't intended to be done manually. diff --git a/content/i18n/en-US.yml b/content/i18n/en-US.yml index 8d7fd51..7a8fff8 100644 --- a/content/i18n/en-US.yml +++ b/content/i18n/en-US.yml @@ -1,2 +1,205 @@ -App: - Title: 'Leder Light' +Common: + Company: Leder Games + AppName: Lederlight + + Actions: + AdvancedLong: Advanced Search + AdvancedShort: Advanced + SyntaxLong: Syntax Help + SyntaxShort: Syntax + ProductsLong: All Products + ProductsShort: Products + + Products: + Oath: Oath + Root: Root + Arcs: Arcs + Fort: Fort + Vast: Vast + Ahoy: Ahoy + +Meta: + Title: 'Leder Cards Spotlight' + +Languages: + en-US: English + +Components: + BelowTheFold: + Home: Home + + LightMode: Light Mode + DarkMode: Dark Mode + + CategoryCards: Cards + + CategorySupport: Support + FAQ: FAQ + Ask: Ask a Question + + CategoryMore: More + GitHub: GitHub + Discord: Discord + + Copyright: The literal and graphical information presented on this site about Leder Games, including card images and symbols is copyright Leder Games. + + Omnisearch: + Search: Search all of {{ selectedProduct }}... + +Pages: + Homepage: + SubText: is your go-to cardpanion for + + AdvancedSearch: + CardNameLabel: Card Name + CardNamePlaceholder: Search any card name + + ProductLabel: Product + ProductPlaceholder: Select product + + SubproductsLabel: Subproducts + SubproductsPlaceholder: Select subproducts + + TagsLabel: Tags + TagsPlaceholder: Select tags + + DefenseLabel: Defense + DefensePlaceholder: Defense + + CardCapacityLabel: Card Capacity + CardCapacityPlaceholder: Card Capacity + + KeysLabel: Keys + KeysPlaceholder: Keys + + ActLabel: Act + ActPlaceholder: Act + + ComplexityLabel: Complexity + ComplexityPlaceholder: Complexity + + NumberText: If left unspecified, will not be included in the search query + + Operators: + EqualTo: Equal To + NotEqualTo: Not Equal To + GreaterThan: Greater Than + LessThan: Less Than + GreaterThanOrEqualTo: Greater Than Or Equal To + LessThanOrEqualTo: Less Than Or Equal To + + Actions: + Search: Search + Reset: Reset + + SyntaxHelp: + Header: 'Search Reference' + Subheader: 'includes a large set of keywords and filters you can use to filter cards.' + + Operators: + ID: + Name: ID + Text: > + You can find cards that match a certain id by using the `id:` operator. + + + This operator is special, you may also search without using the operator. + + Examples: + - Example: '`OATH/1`' + Text: Find specifically the card matching the id OATH/1. + + - Example: '`id:=OATH/1`' + Text: Find specifically the card matching the id OATH/1. + + - Example: '`-id:OATH`' + Text: Exclude all cards with the id OATH. + + Name: + Name: Name + Text: > + You can find cards that match a certain expansion by using the `name:` or `n:` operator. + + + This operator is a loose-text operator, which means that you can use partial names. You can also specify multiple expansions by separating them with a comma. If a name has spaces in its name, you must use quotation marks around the name. + + Examples: + - Example: '`Alchemist`' + Text: Cards with "alchemist" in their name. + + - Example: '`name:alchemist`' + Text: Cards with "alchemist" in their name. + + - Example: '`name:"=Alchemist"`' + Text: Cards that are called exactly "Alchemist". + + - Example: '`-name:"Alchemist"`' + Text: Cards without "alchemist" in their name. + + Product: + Name: Product + Text: > + You can find cards that are associated with a certain product/game by using the `product:` operator. + + Examples: + - Example: '`product:oath`' + Text: Cards that belong to the Oath product. + + - Example: '`-product:root`' + Text: Cards that don't belong to the Root product. + + Subproduct: + Name: Subproduct + Text: > + You can find cards that are associated with a certain subproduct/expansion by using the `subproduct:` operator. + + Examples: + - Example: '`subproduct:clockwork-1`' + Text: Cards that belong to the Clockwork 1 subproduct. + + - Example: '`-subproduct:exiles-partisans`' + Text: Cards that don't belong to the Exiles & Partisans subproduct. + + Tag: + Name: Tag + Text: > + You can find cards that have a certain tag by using the `tag:` search operator. Almost every card will have a tag. You can find a list of valid tags by using the advanced search page. + + Examples: + - Example: '`tag:"Power"`' + Text: Cards that have the Power tag. + + - Example: '`tag:"Power,Arcane"`' + Text: Cards that have the Power and Arcane tags. + + - Example: '`tag:none`' + Text: Cards with no tags. + + SearchResults: + NoResults: + Header: No results found + Subheader: For help using the search tool, check the + HelpGuide: help guide + + Results: + Sorter: + As: Cards as + AsImages: Images + AsText: Text + + Sorted: Sorted by + SortedName: Name + SortedID: ID + SortedProduct: Product + + Asc: Asc ↑ + Desc: Desc ↓ + + Pagination: + Previous: Previous + Next: Next + + Card: + More: More + FAQ: FAQ + Rules: Rules diff --git a/package.json b/package.json index e56d1a9..f5e45a8 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "build:i18n": "ts-node scripts/build-i18n", "compress:card-images": "ts-node scripts/compress-card-images", "compress:card-symbols": "ts-node scripts/compress-card-symbols", + "validate": "concurrently \"npm run validate:*\"", "validate:card-data": "ts-node scripts/validate-cards", "finalize:version": "ts-node scripts/finalize-version", "copy:headers": "ts-node scripts/copy-headers" diff --git a/scripts/build-meta-data.ts b/scripts/build-meta-data.ts index cd25256..2c4bdf0 100644 --- a/scripts/build-meta-data.ts +++ b/scripts/build-meta-data.ts @@ -9,7 +9,12 @@ const readAllMeta = async () => { const allMetaFiles = await readdir('./content/meta-data'); const allMetas = allMetaFiles.map((f) => yaml.load(fs.readFileSync(f))); - fs.writeJsonSync(`dist/meta.json`, allMetas); + const allLocaleFiles = await readdir('./content/i18n'); + const allLocales = allLocaleFiles.map((f) => path.basename(f, '.yml')); + + const json = { products: allMetas, locales: allLocales }; + + fs.writeJsonSync(`dist/meta.json`, json); console.log(`Got ${allMetas.length} meta data files!`); };