-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathupdate-wordinfo-plural.ps1
More file actions
43 lines (37 loc) · 2.09 KB
/
Copy pathupdate-wordinfo-plural.ps1
File metadata and controls
43 lines (37 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# The output file
$OutputFile = "WordInfo\plural.txt"
# Force all cmdlets to use UTF‑8 encoding
$PSDefaultParameterValues["*:Encoding"] = "UTF8"
# Include shared helper functions
. "$PSScriptRoot\utils.ps1"
# Paths of the XML files to be scanned for words based on specific regex patterns
$ScanRules = [ordered]@{
"DefInjected\OrderedTakeGroupDef\*" = ".+\.label" # MaxPickUpAllowed
"DefInjected\PsychicRitualRoleDef\*" = ".+\.label" # MaxPawnsPerRole, categoryLabel
"DefInjected\RitualBehaviorDef\*" = ".+\.label" # MessageLordJobNeedsAtLeastNumRolePawn, ritual dialog
"DefInjected\ThingDef\Apparel_*.xml, DefInjected\ThingDef\RangedSpecial.xml, DefInjected\ThingDef\Weapons_Ranged.xml" = ".+\.chargeNoun" # ReloadRemainingChargesMultipler, ReloadChargesRemaining, ReloadMaxCharges, ReloadPerCharge, CommandReload_NoCharges
"DefInjected\ThingDef\Buildings_Furniture.xml" = "Blackboard\.label" # StatsReport_Connected
"DefInjected\ThingDef\Buildings_Mech*" = "\w+\.label" # ThreatReward_MechPods_MiscReward, Util_MechCluster etc.
"DefInjected\ThingDef\Buildings_Natural.xml" = "Mineable\w+\.label" # MineralRich, MineralRichDescription
"DefInjected\ThingDef\Buildings_Misc.xml" = "TransportPod\.label" # LoadTransporters
"DefInjected\ThingDef\Buildings_PsychicRituals.xml" = ".+\.label" # psychic ritual dialog
"DefInjected\ThingDef\Items_Resource_Manufactured.xml" = "Wastepack\.label" # CommandAutoLoad, CommandEjectContents, ThingsProduced, ContainedThings
"DefInjected\ThingDef\Plants_*" = ".+\.label" # MessagePlantIncompatibleWithRoof, LetterCropBlight
"DefInjected\ThingDef\Various_Stone.xml" = "Chunk\w+\.label" # DeepDrillExhausted
"Keyed\FloatMenu.xml" = "Deity" # DeitiesRequired
}
$ColNames = @(
"SINGULAR" # indefinite nominative singular
"PLURAL" # indefinite nominative plural
)
$CommentBlock = @"
// Auto-generated by $($MyInvocation.MyCommand.Name)
// Ingame pluralization use this file automatically.
// For declension, use plural_decline.txt
// ---
"@
Update-OutputFile `
-OutputFile $OutputFile `
-ScanRules $ScanRules `
-ColNames $ColNames `
-CommentBlock $CommentBlock