Browse Source

fix L10n path after move

pull/8134/head
nupplaPhil 1 month ago
parent
commit
8138b05032
No account linked to committer's email address
2 changed files with 7 additions and 7 deletions
  1. +6
    -6
      src/Core/L10n.php
  2. +1
    -1
      tests/src/Core/L10nTest.php

+ 6
- 6
src/Core/L10n.php View File

@@ -115,13 +115,13 @@ class L10n
$addons = $this->dba->select('addon', ['name'], ['installed' => true]);
while ($p = $this->dba->fetch($addons)) {
$name = Strings::sanitizeFilePathItem($p['name']);
if (file_exists("addon/$name/lang/$lang/strings.php")) {
include __DIR__ . "/../../../addon/$name/lang/$lang/strings.php";
if (file_exists(__DIR__ . "/../../addon/$name/lang/$lang/strings.php")) {
include __DIR__ . "/../../addon/$name/lang/$lang/strings.php";
}
}

if (file_exists(__DIR__ . "/../../../view/lang/$lang/strings.php")) {
include __DIR__ . "/../../../view/lang/$lang/strings.php";
if (file_exists(__DIR__ . "/../../view/lang/$lang/strings.php")) {
include __DIR__ . "/../../view/lang/$lang/strings.php";
}

$this->lang = $lang;
@@ -191,8 +191,8 @@ class L10n
while (count($lang_code)) {
// try to mix them so we can get double-code parts too
$match_lang = strtolower(join('-', $lang_code));
if (file_exists(__DIR__ . "/../../../view/lang/$match_lang") &&
is_dir(__DIR__ . "/../../../view/lang/$match_lang")) {
if (file_exists(__DIR__ . "/../../view/lang/$match_lang") &&
is_dir(__DIR__ . "/../../view/lang/$match_lang")) {
if ($lang_quality > $current_q) {
$current_lang = $match_lang;
$current_q = $lang_quality;

tests/src/Core/L10n/L10nTest.php → tests/src/Core/L10nTest.php View File

@@ -1,6 +1,6 @@
<?php

namespace src\Core\L10n;
namespace Friendica\Test\src\Core\L10n;

use Friendica\Core\L10n;
use Friendica\Test\MockedTest;

Loading…
Cancel
Save