[I18N] Fix i18n and add default domain 'Core'

This commit is contained in:
Hugo Sales 2020-06-04 20:35:46 +00:00 committed by Hugo Sales
parent 13ae29cae2
commit 436b44df89
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -17,7 +17,6 @@
// along with GNU social. If not, see <http://www.gnu.org/licenses/>. // along with GNU social. If not, see <http://www.gnu.org/licenses/>.
// }}} // }}}
/** /**
* Utility functions for i18n * Utility functions for i18n
* *
@ -52,6 +51,7 @@ foreach ($LC_CATEGORIES as $key => $name) {
} }
} }
use App\Util\Formatting;
use InvalidArgumentException; use InvalidArgumentException;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
@ -88,10 +88,10 @@ abstract class I18n
static $cached; static $cached;
$path = $backtrace[0]['file']; $path = $backtrace[0]['file'];
if (!isset($cached[$path])) { if (!isset($cached[$path])) {
$path = common::normalizePath($path); $path = Formatting::normalizePath($path);
$cached[$path] = common::pluginFromPath($path); $cached[$path] = Formatting::pluginFromPath($path);
} }
return $cached[$path] ?? ''; return $cached[$path] ?? 'Core';
} }
/** /**