I am trying to write a better solution to the translations in yii 1.1.
I will start with a very simple example:
Yii::t('app', 'n==1#one book|n>1#many books', array(5));
output:
one book (if n=1)
many books (if n>1)
But i want other words to be part of the translation without having to repeat the words.
If i want the output to be
one book in the table
many books in the table
I will have to add in the table to both of these expressions like so
Yii::t('app', 'n==1#one book in the table|n>1#many books in the table', array(5));
in the table is common between both the expressions here but I am finding myself having to repeat that. If the sentence is too long, i will be repeating quiet a lot.
Is there an efficient solution to this problem.
Thanks