I currently working on a translation project for phabricator. Extracted all the string with i18n binary and created the translation classes.
If a string is empty (null by default) tha PhutilTranslator::translate() method returns an empty string.
It is no so easy to make translation, I recommend to allow translate() method to return the original input ($text) if the translated string ($result in this case) is empty.
Description
Description
Revisions and Commits
Revisions and Commits
| Restricted Differential Revision |
Event Timeline
Comment Actions
Just have your translation provider class do something like:
foreach ($translations as $key => $value) {
if ($value === null) {
unset($translations[$key]);
}
}..before returning translated strings. We may eventually formalize this (e.g., make translation classes do this automatically), but this isn't a priority for now.