Just so you know, since it causes problems in other languages, we've added 2 new keyed translations: MaleAnimal and FemaleAnimal which are "male" and "female" labels used when the pawn is an animal.
And while we're at it, I'd like to remind you that it's possible to define a custom LanguageWorker for a language. This is simply a piece of C# code which handles complex language specific string conversions. Currently only English, Russian, and Korean use it.
The available methods are:
WithIndefiniteArticle(): e.g. "an elephant"
WithDefiniteArticle(): e.g. "the elephant"
OrdinalNumber(): e.g. 1st 7th 15th
PostProcessed(): returns post-processed text generated by RulePacks
ToTitleCase(): converts "some text" to "Some Text"
Pluralize(): returns the plural form of the given word
PostProcessedBackstoryDescription(): returns post-processed backstory description
PostProcessedKeyedTranslation(): returns post-processed keyed translation (i.e. any non-def-injected translation)
You can override any of these methods. You can also suggest adding more if needed.
How to contribute (https://ludeon.com/forums/index.php?topic=2933.0)
New keyed translations format (https://ludeon.com/forums/index.php?topic=43979.0)
RimWorld 1.0 Translation Improvements (https://ludeon.com/forums/index.php?topic=41942.0)
New translation cleaner tool (https://ludeon.com/forums/index.php?topic=42587.0)
Request: Help check the language workers for accuracy (https://ludeon.com/forums/index.php?topic=44000.0)
Hi!
I don't have MaleAnimal or FemaleAnimal keyed and translation report does not have them as missing. Is this modification pushed already? /// Update 1969 has them, great addition!
Also this LanguageWorker stuff would be very useful for Hungarian, but I'm totally lost. What to do with these?
I can see the russian has a <languageWorkerClass>LanguageWorker_Russian</languageWorkerClass> reference but that's it. Can you help? Thanks!
It's just a custom class we'd need to add to our code. For example, English uses PostProcessed() to change "a" articles to "an" where appropriate. Such post processing isn't a very elegant solution though.
Well that sounds great, Hungarian has the same problem with definite articles. We have "a" and "az". Now I have to use "a(z)" everywhere or avoid. I hate it. Can you send a template so I can see what can be implemented? Or is there way to check the already existing russian version? Thnaks!
Ok, we can solve the problem with articles in Hungarian. I've looked up the a/az usage rules and they seem simple to implement, so I think I can handle it.
The WithIndefiniteArticle() / WithDefiniteArticle() methods are simple methods which accept a string and return a processed string.
How shall translators modify the source code of this class? This file is not a part of Github localization repositories.
The only way is to send them to us so we can integrate them.
Alternatively, perhaps we could allow translators to use regular expressions. Though I'm concerned about performance of this approach.
Quote from: ison on July 20, 2018, 10:07:20 AM
Ok, we can solve the problem with articles in Hungarian. I've looked up the a/az usage rules and they seem simple to implement, so I think I can handle it.
The WithIndefiniteArticle() / WithDefiniteArticle() methods are simple methods which accept a string and return a processed string.
Cool, thank you very much! It's the same rule English has for "a" and "an" so modifying that rule would be sufficient. I guess after that we use "a" everywhere and in case the pulled variable starts with a vowel, postprocessing replaces it with "az". Right?
Another thing, not sure it's postprocess related. I realized if I start the sentence with a variable, the first letter does not get capitalized.
Dear Ison,
It is very interesting. Can you please give more detail about how to implement this for French language. I suppose that this may be not too complicated: My first concerns are
WithIndefiniteArticle() / WithDefiniteArticle() / Pluralize() that should be dependent on whether the subsequent word is Male or Female (not the subject in the sentence)
For languages like French where the article depends on the subject's gender we're going to implement a new system to figure out the gender of the given subject. It's easy for pawns, but e.g. determining the gender of a sword, chair, table, etc. is impossible without some kind of a special lookup table. Though now that I think of it, I'm not sure how often we even want to add an article to a non-pawn thing. I think RulePackDefs sometimes have to do this, and some keyed translations like "A battery has broken down.", so I think adding such system is necessary.
This gender will be passed to the WithDefiniteArticle() and WithIndefiniteArticle() methods.
Great news, thank you !
The other next problem is the pronoun le/la/les (not definite articles) such as in "je la veux/je le veux" (I want it) which is different of lui/elle (him/her). I was at some point thinking about hacking the grammar.xml to use much less usefull key instead (ex NAME_possessive son/sa -> le/la)...
Hi,
is it possible to add more customisable words for grammar.xml file like:
Quote
[PAWN_possessive] -> its/his/her
[PAWN_pronoun] -> it/him/her
[PAWN_objective] -> he/she/it
For example:
Quote
[PAWN_customword] -> x/y/z
I want in Czech for example:
Quote
George was -> George byl -> [PAWN_nameDef] byl[PAWN_customword]
Kate was -> Kate byla -> [PAWN_nameDef] byl[PAWN_customword]
I think a similar problem is in other languages like Russian, Polish, Slovak, etc.
Thanks
Quote from: b606 on July 21, 2018, 09:50:50 AM
The other next problem is the pronoun le/la/les (not definite articles) such as in "je la veux/je le veux" (I want it) which is different of lui/elle (him/her).
Is it different than NAME_pronoun? Does la/le depend on whether "I" is female or whether "it" is female?
Quote from: morticinus on July 22, 2018, 03:45:33 AM
Hi,
is it possible to add more customisable words for grammar.xml file like:
This will most likely be addressed, though I'm not sure if adding more customisable words would be the best approach here. Some languages have many pronouns, so remembering all their names could be difficult. Perhaps something like this would be good:
[PAWN_nameDef] [PAWN_gender ? był : była]
Or, if the language has 3 genders (male, female, neuter) then:
[PAWN_nameDef] [PAWN_gender ? był : była : było]
Quote from: ison on July 22, 2018, 08:42:56 AM
I'm not sure if adding more customisable words would be the best approach here. Some languages have many pronouns, so remembering all their names could be difficult.
Yes it's true, but what I need is not pronouns but endings of words.
Quote from: ison on July 22, 2018, 08:42:56 AM
Perhaps something like this would be good:
[PAWN_nameDef] [PAWN_gender ? był : była]
Or, if the language has 3 genders (male, female, neuter) then:
[PAWN_nameDef] [PAWN_gender ? był : była : było]
I need only two variants for Czech (for examples):
Quote
[PAWN_gender1] = -/-a/-o (for example - word "was": byl/byla/bylo or word "could" "mohl/mohla/mohlo" etc)
[PAWN_gender2] = -ý/-á/-é (for example - word "hungry": hladový/hladová/hladové etc)
[PAWN_genderx] = male/female/neuter
Example for female:
Quote
[PAWN_nameDef] was hungry. = Kate was hungry.
[PAWN_nameDef] byl[PAWN_gender1] hladov[PAWN_gender2]. = Kate byla hladová.
Thanks
Quote from: ison on July 22, 2018, 08:42:56 AM
Quote from: b606 on July 21, 2018, 09:50:50 AM
The other next problem is the pronoun le/la/les (not definite articles) such as in "je la veux/je le veux" (I want it) which is different of lui/elle (him/her).
Is it different than NAME_pronoun? Does la/le depend on whether "I" is female or whether "it" is female?
Quote from: morticinus on July 22, 2018, 03:45:33 AM
Hi,
is it possible to add more customisable words for grammar.xml file like:
This will most likely be addressed, though I'm not sure if adding more customisable words would be the best approach here. Some languages have many pronouns, so remembering all their names could be difficult. Perhaps something like this would be good:
[PAWN_nameDef] [PAWN_gender ? był : była]
Or, if the language has 3 genders (male, female, neuter) then:
[PAWN_nameDef] [PAWN_gender ? był : była : było]
Not french native, but pretty sure it depends on whether 'it' is masculine or feminine.
For example: 'Je le veux' means 'I want him' or 'I want it', if 'it' is masculine. 'Je la veux' means 'I want her' or 'I want it', if 'it' is feminine.
Hope it helps.
@Ison
In "je la veux/je le veux" (I want it), le/la depends on "it" female not on I. NAME_pronoun is for il/elle such as in "il regarde something/elle regarde smthng" (he/she looks at smthng). So far, we chose to use NAME_objective as lui/elle, such as "autour de lui/autour d'elle" (around him/her).
A customizable word ending would solve a lot of french adjectives. They mostly end with "e" in female and "s" in plural (with few exceptions that may be solved through an appropriate texte processing.
Maybe unrelated but I just noticed this in the rimworld log today:
RECIPIENT_definite->le/la elephant
RECIPIENT_nameDef->le/la elephant
RECIPIENT_indefinite->un(e) elephant
RECIPIENT_nameIndef->un(e) elephant
Is it already customizable through the language mod ? I was thinking about *.label{In,}Definite{,Female} tags. Ideally, it should be read as
RECIPIENT_definite->l'éléphant
RECIPIENT_nameDef->l'éléphant
RECIPIENT_indefinite->un éléphant
RECIPIENT_nameIndef->un éléphant
and for female (for which we already have tag labelFemale : éléphante)
RECIPIENT_definite->l'éléphante
RECIPIENT_indefinite->une éléphante
I still need some help with gender-related problem: https://ludeon.com/forums/index.php?topic=43034.0