Files
plugin-lang-br/plugin.php
2026-01-19 10:13:09 +07:00

39 lines
1004 B
PHP

<?php
/**
* Plugin Name: Portuguese (Brazil) Language Pack
* Description: Adds Portuguese (Brazil) language support to Mivo.
* Version: 1.0.0
* Author: DyzulkDev
*
* Category: Language Pack
* Scope: Global
* Tags: language, portuguese, br, localization
* Core Version: >= 1.2.0
*/
use App\Core\Hooks;
Hooks::addFilter('get_available_languages', function($languages) {
$languages[] = [
'code' => 'br',
'name' => 'Português (Brasil)',
'flag' => 'br', // Correct ISO code
'path' => '/lang/plugin/plugin-lang-br/br.json'
];
return $languages;
});
// Register Route for Language File
Hooks::addAction('router_init', function(\App\Core\Router $router) {
$router->get('/lang/plugin/plugin-lang-br/br.json', function() {
$path = __DIR__ . '/br.json';
if (file_exists($path)) {
header('Content-Type: application/json');
readfile($path);
exit;
}
http_response_code(404);
});
});