I've found this phrase in one of my games, but I don't know what is the "-y" for
"Affectez-y 10 citoyens pour produire des matériaux de construction."
French Language Stack Exchange is a question and answer site for students, teachers, and linguists wanting to discuss the finer points of the French language. It only takes a minute to sign up.
Sign up to join this communityI've found this phrase in one of my games, but I don't know what is the "-y" for
"Affectez-y 10 citoyens pour produire des matériaux de construction."
-y is used to avoid repetition by referring to a previously mentioned entity.
Construisez une usine.
Affectez-y 10 citoyens pour produire des matériaux de construction.
Here -y refers to une usine mentioned in the previous sentence. So the sentence means:
Affectez à l'usine que vous avez construite 10 citoyens pour produire des matériaux de construction.
In English this would be:
Build a factory.
Assign it 10 citizens to produce building materials.
In English this it has the same usage as -y does in French.
Y is a pronoun.
In your case, y replaces a noun or a noun group introduced by à or its derived forms (aux, au), because the verb affecter (to appoint or to assign, in this context) is used with the à in French.
Affectez 10 citoyens à cette tâche pour produire des matériaux de construction.
The exception to this rule is when the noun is a person.
J'écris à ma mère. → Je lui écris.
Je pense à mon père/ma mère. → Je pense à lui/à elle.
Y should be placed before the verb, but in your example there is an inversion because of the use of the "impératif". Y is therefore placed after the verb with a hyphen for the link.
Note: y is also used to replace a location (introduced by chez, dans, sur, à…), but this is not your case.