Комментарии 3
Ещё было бы интересно почитать про сложности перевода фраз, связанных с падежами, полом персонажа, числительными:
Reward 50 gold — награда 50 золотых
Reward 51 gold — награда 51 золотой
и как всего этого избегать
Reward 50 gold — награда 50 золотых
Reward 51 gold — награда 51 золотой
и как всего этого избегать
Если коротко, то удобный, понятный и универсальный подход — ICU-синтаксис.
Выглядеть будет как-то так:
"{gender_of_host, select, "
"female {"
"{num_guests, plural, offset:1 "
"=0 {{host} does not give a party.}"
"=1 {{host} invites {guest} to her party.}"
"=2 {{host} invites {guest} and one other person to her party.}"
"other {{host} invites {guest} and # other people to her party.}}}"
"male {"
"{num_guests, plural, offset:1 "
"=0 {{host} does not give a party.}"
"=1 {{host} invites {guest} to his party.}"
"=2 {{host} invites {guest} and one other person to his party.}"
"other {{host} invites {guest} and # other people to his party.}}}"
"other {"
"{num_guests, plural, offset:1 "
"=0 {{host} does not give a party.}"
"=1 {{host} invites {guest} to their party.}"
"=2 {{host} invites {guest} and one other person to their party.}"
"other {{host} invites {guest} and # other people to their party.}}}}"
Зарегистрируйтесь на Хабре, чтобы оставить комментарий
Правила локализации для разработчиков