translation update

This commit is contained in:
Flatlogic Bot 2026-02-21 12:46:35 +00:00
parent 87ae7e578e
commit 516cfb21f3
2 changed files with 41 additions and 39 deletions

View File

@ -2,47 +2,44 @@
// OpenAI proxy configuration (workspace scope). // OpenAI proxy configuration (workspace scope).
// Reads values from environment variables or executor/.env. // Reads values from environment variables or executor/.env.
$projectUuid = getenv('PROJECT_UUID'); function get_ai_env($key) {
$projectId = getenv('PROJECT_ID'); $val = getenv($key);
if ($val !== false && $val !== '') return $val;
$envVars = []; if (isset($_ENV[$key]) && $_ENV[$key] !== '') return $_ENV[$key];
if ( if (isset($_SERVER[$key]) && $_SERVER[$key] !== '') return $_SERVER[$key];
($projectUuid === false || $projectUuid === null || $projectUuid === '') || return null;
($projectId === false || $projectId === null || $projectId === '')
) {
$envPath = realpath(__DIR__ . '/../../.env'); // executor/.env
if ($envPath && is_readable($envPath)) {
$lines = @file($envPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
foreach ($lines as $line) {
$line = trim($line);
if ($line === '' || $line[0] === '#') {
continue;
}
if (!str_contains($line, '=')) {
continue;
}
[$key, $value] = array_map('trim', explode('=', $line, 2));
if ($key === '') {
continue;
}
$value = trim($value, "\"' ");
$envVars[$key] = $value;
if (getenv($key) === false || getenv($key) === '') {
putenv("{$key}={$value}");
}
}
if (empty($projectUuid) && isset($envVars['PROJECT_UUID'])) {
$projectUuid = $envVars['PROJECT_UUID'];
}
if (empty($projectId) && isset($envVars['PROJECT_ID'])) {
$projectId = $envVars['PROJECT_ID'];
}
}
} }
$projectUuid = ($projectUuid === false || $projectUuid === '') ? null : $projectUuid; $projectUuid = get_ai_env('PROJECT_UUID');
$projectId = ($projectId === false || $projectId === '') ? null : $projectId; $projectId = get_ai_env('PROJECT_ID');
if (!$projectUuid || !$projectId) {
$possiblePaths = [
__DIR__ . '/../../.env',
__DIR__ . '/../.env',
__DIR__ . '/.env',
'/home/ubuntu/executor/.env',
'/var/www/html/.env'
];
foreach ($possiblePaths as $path) {
if (file_exists($path) && is_readable($path)) {
$lines = @file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
foreach ($lines as $line) {
$line = trim($line);
if ($line === '' || $line[0] === '#') continue;
if (!str_contains($line, '=')) continue;
[$k, $v] = array_map('trim', explode('=', $line, 2));
$v = trim($v, "\"' ");
if (!$projectUuid && $k === 'PROJECT_UUID') $projectUuid = $v;
if (!$projectId && $k === 'PROJECT_ID') $projectId = $v;
}
}
if ($projectUuid && $projectId) break;
}
}
$baseUrl = 'https://flatlogic.com'; $baseUrl = 'https://flatlogic.com';
$responsesPath = $projectId ? "/projects/{$projectId}/ai-request" : null; $responsesPath = $projectId ? "/projects/{$projectId}/ai-request" : null;

View File

@ -193,3 +193,8 @@
2026-02-21 09:58:21 - POST: {"action":"save_theme","theme":"forest"} 2026-02-21 09:58:21 - POST: {"action":"save_theme","theme":"forest"}
2026-02-21 09:58:24 - POST: {"action":"save_theme","theme":"dracula"} 2026-02-21 09:58:24 - POST: {"action":"save_theme","theme":"dracula"}
2026-02-21 09:58:32 - POST: {"action":"save_theme","theme":"default"} 2026-02-21 09:58:32 - POST: {"action":"save_theme","theme":"default"}
2026-02-21 12:39:00 - POST: {"action":"translate","text":"Hello","target":"ar"}
2026-02-21 12:39:03 - POST: {"backup_limit":"5","backup_time":"00:00","backup_auto_enabled":"1","save_backup_settings":""}
2026-02-21 12:39:43 - POST: {"create_backup":""}
2026-02-21 12:40:23 - POST: {"action":"translate","text":"World","target":"ar"}
2026-02-21 12:41:26 - POST: {"action":"translate","text":"Success","target":"ar"}