Add dative case function to loc manager (#5510)

* dative

* slipped it

* slipped it twice
This commit is contained in:
lzk
2024-11-05 19:55:30 +01:00
committed by GitHub
parent 14d3699ae2
commit 4e100d96bc
2 changed files with 20 additions and 0 deletions

View File

@@ -20,6 +20,15 @@ zzzz-object-pronoun = { GENDER($ent) ->
*[neuter] it
}
# Used internally by the DAT-OBJ() function.
# Not used in en-US. Created for supporting other languages.
zzzz-dat-object = { GENDER($ent) ->
[male] him
[female] her
[epicene] them
*[neuter] it
}
# Used internally by the POSS-PRONOUN() function.
zzzz-possessive-pronoun = { GENDER($ent) ->
[male] his

View File

@@ -22,6 +22,7 @@ namespace Robust.Shared.Localization
AddCtxFunction(bundle, "GENDER", FuncGender);
AddCtxFunction(bundle, "SUBJECT", FuncSubject);
AddCtxFunction(bundle, "OBJECT", FuncObject);
AddCtxFunction(bundle, "DAT-OBJ", FuncDatObj);
AddCtxFunction(bundle, "POSS-ADJ", FuncPossAdj);
AddCtxFunction(bundle, "POSS-PRONOUN", FuncPossPronoun);
AddCtxFunction(bundle, "REFLEXIVE", FuncReflexive);
@@ -203,6 +204,16 @@ namespace Robust.Shared.Localization
return new LocValueString(GetString("zzzz-object-pronoun", ("ent", args.Args[0])));
}
/// <summary>
/// Returns the dative form pronoun for the entity's gender.
/// This method is intended for languages with a dative case, where indirect objects
/// (e.g., "to him," "for her") require specific forms. Not applicable for en-US locale.
/// </summary>
private ILocValue FuncDatObj(LocArgs args)
{
return new LocValueString(GetString("zzzz-dat-object", ("ent", args.Args[0])));
}
/// <summary>
/// Returns the respective possessive adjective (his, her, their, its) for the entity's gender.
/// </summary>