We study the viability and resilience of languages, using a simple dynamical model of two languages in competition. Assuming that public action can modify the prestige of a language in order to avoid language extinction, we analyze two cases: (i) the prestige can only take two values, (ii) it can take any value but its change at each time step is bounded. In both cases, we determine the viability kernel, that is, the set of states for which there exists an action policy maintaining the coexistence of the two languages, and we define such policies. We also study the resilience of the languages and identify configurations from where the system can return to the viability kernel (finite resilience), or where one of the languages is lead to disappear (zero resilience). Within our current framework, the maintenance of a bilingual society is shown to be possible by introducing the prestige of a language as a control variable.