Finding Translation Candidates, Configs, and Fired Events
Inspired by this issue I've searched for a way to get all strings in Vanilla that have to be translated. So I've started playing around with regular expressions but ended up with PHPs tokenizer. Great tool!
In order to be able to really play around with the data, I've exported it to excel. Another thing I've learned and found it to be really easy I've attached my script so you can play around, too.
I've found 1.880 usages of the functions T, BigPlural and PluralTranslate. 1.761 are simple T functions with "only" 1.147 (roughly 2/3) unique strings.
The remaining function calls contain translatable data in a way that is more complicate to deal with. Those 119 functions have 82 unique parameters and only 40 of them contain strings (e.g.
T($Discussion->Sink == '1' ? 'Unsink' : 'Sink')).
The rest is untranslatable by just looking at the code that way: eg
T($this->Data['Title']) makes a string translatable but it is not obvious how to do it...
So what is this all about? 1.147 simple translations + 40 "complex" translations (containing up to 4 strings) will add up to a maximum of around 1.300 translations. Add the 79 unsure usages of T/PluralTranslate/BigPlural to that and you are still below 1.400, but German transifex has 978 + 907 = 1.885 definitions
Well, I've started this experiment to find a way of checking if every string in the source code has been translated and ended up with about 20% more translations than I've expected! Strange thing. Maybe I'll try to match the definitions with my excel and see what I will find out.
Count von Count