ParadoxGameConverters / CK3ToEU4

Converts Crusader Kings 3 saves into Europa Universalis 4 mods
MIT License
52 stars 25 forks source link

Country adjectives in French #184

Open IohannesIohannium opened 3 years ago

IohannesIohannium commented 3 years ago

Through the use of customizable locs, EU4 shows correctly gendered French adjectives.

A dynamic file should be created, named /customizable_localization/!00_countryadjectives_FR.txt and should contain the following blocks, with [TAG] being an example and each text entry being repeated for each tag that is found to be in the output mod, plus special cases*:

defined_text = {
    name = GetRootAdjMS
    random = no
    ### HIGHER PRIORITY ###
    text = {
        localisation_key = string_[TAG]_ADJ_ms_FR
        trigger = { tag = [TAG] }
    }
}

defined_text = {
    name = GetRootAdjFS
    random = no
    ### HIGHER PRIORITY ###
    text = {
        localisation_key = string_[TAG]_ADJ_fs_FR
        trigger = { tag = [TAG] }
    }
}

defined_text = {
    name = GetRootAdjMP
    random = no
    ### HIGHER PRIORITY ###
    text = {
        localisation_key = string_[TAG]_ADJ_mp_FR
        trigger = { tag = [TAG] }
    }
}

defined_text = {
    name = GetRootAdjFP
    random = no
    ### HIGHER PRIORITY ###
    text = {
        localisation_key = string_[TAG]_ADJ_fp_FR
        trigger = { tag = [TAG] }
    }
}

Among special cases are this one to be put at the end of each defined_text box:

    text = {
        localisation_key = string_Root_ADJ_[a]_FR # Fallback for Colonial/RNW/Dynamic nations
        trigger = { is_dynamic_tag = yes }
    }

[a] is s in MS and FS, p in MP and FP

Then there are some that need to be at the start of each defined_text box, that should be kept in a configurable file since they may change in new EU4 patches. Such a configurable, specialFrenchAdjectives.txt, would feature four blocks, namely MS, FS, MP and FP. What is inside the MS block would be copied to GetRootAdjMS as is, just after the random = no line and before the HIGHER PRIORITY one.

The generation of adjectives from CK3 could recycle the script used for Vic2-HoI4, although adjectives from CK3 are feminine by default rather than masculine. The configurable file for adjectives would be named frenchAdjectives.txt

This GetRoot big block would then be repeated verbatim for GetFrom, GetRootOwner, GetRootOverlord

IohannesIohannium commented 3 years ago

Labels: [coding][data files][enhancement]

IohannesIohannium commented 3 years ago

frenchAdjectives.txt: https://pastebin.com/eZv74Qmq specialFrenchAdjectives.txt: https://pastebin.com/d445suq8

Zemurin commented 2 years ago

c_pest:0 "Pest" c_pest_adj:0 "pestienne" X12_ADJ is copied as pestienne We match the string pestienne against a "French adjective rules" config file It matches the rule triggered by "(.+)nne"

And we output: X12: "Pest" X12_ADJ: "pestienne" string_X12_ADJ_ms_FR: "pestien" string_X12_ADJ_fs_FR: "pestienne" string_X12_ADJ_mp_FR: "pestiens" string_X12_ADJ_fp_FR: "pestiennes"

then the upper file with 4 blocks with [TAG] replaced by X12 for every tag that we generate or rename

Zemurin commented 2 years ago

defined_text = { name = GetRootAdjMS random = no ... text = { localisation_key = string_Z99_ADJ_ms_FR trigger = { tag = Z99} } text = { localisation_key = string_Root_ADJ_s_FR trigger = { is_dynamic_tag = yes } } } ... means other lines defined_text = { ... text = { localisation_key = string_Z99_ADJ_fp_FR trigger = { tag = Z99} } text = { localisation_key = string_Root_ADJ_p_FR trigger = { is_dynamic_tag = yes } } }

Ditto for another "defined_text" block

Zemurin commented 2 years ago

This block is copied over four times, first time with name = GetRootAdjMS, then with name = GetFromAdjMS, third with name = GetRootOwnerAdjMS, last with name = GetRootOverlordAdjMS

IohannesIohannium commented 2 years ago

EU4 also has localized [TAG]_ADJ2 entries. They are of no use in English, but are used for "prefix"-form adjectives. E.g. the Anglo-French War instead of the English-French War.

Configurable used for generation:

french = {
    # Special cases
    link = { source = "(.+)allemande" adj = "(.+)germano" }
    link = { source = "(.+)autrichienne" adj = "(.+)austro" }
    link = { source = "(.+)chinoise" adj = "(.+)sino" }
    link = { source = "(.+)espagnole" adj = "(.+)hispano" }
    link = { source = "(.+)grecque" adj = "(.+)gréco" }
    link = { source = "(.+)hongroise" adj = "(.+)magyaro" }
    link = { source = "(.+)japonaise" adj = "(.+)nippo" }
    link = { source = "(.+)portugaise" adj = "(.+)luso" }
    link = { source = "(.+)suisse" adj = "(.+)helvéto" }
    link = { source = "(.+)bosniaque" adj = "(.+)bosno" }
    link = { source = "(.+)gauloise" adj = "(.+)gallo" }
    link = { source = "(.+)britannique" adj = "(.+)britanno" }
    link = { source = "(.+)américaine" adj = "(.+)américano" }
    # Usual endings
    link = { source = "(.+)aine" adj = "(.+)o" }
    link = { source = "(.+)çaise" adj = "(.+)co" }
    link = { source = "(.+)aise" adj = "(.+)o" }
    link = { source = "(.+)ienne" adj = "(.+)o" }
    link = { source = "(.+)çoise" adj = "(.+)co" }
    link = { source = "(.+)oise" adj = "(.+)o" }
    link = { source = "(.+)onne" adj = "(.+)o" }
    link = { source = "(.+)tique" adj = "(.+)to" }
    link = { source = "(.+)èque" adj = "(.+)éco" }
    link = { source = "(.+)ègue" adj = "(.+)égo" }
    link = { source = "(.+)que" adj = "(.+)co" }
    link = { source = "(.+)gue" adj = "(.+)go" }
    link = { source = "(.+)a" adj = "(.+)o" }
    link = { source = "(.+)e" adj = "(.+)o" }
    link = { source = "(.+)i" adj = "(.+)o" }
    link = { source = "(.+)o" adj = "(.+)o" }
    link = { source = "(.+)u" adj = "(.+)uvo" }
    link = { source = "(.+)" adj = "(.+)o" } # Fallback
}

As I could not find out a suitable list of equivalent "prefix"-forms for Spanish, I could not set out rules for them.

Example of how things go: