mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:58:06 +01:00
Manually add Persian to post body language detection
This commit is contained in:
parent
0eed813037
commit
f3131c6277
1 changed files with 7 additions and 1 deletions
|
@ -1642,7 +1642,13 @@ class Item
|
|||
return '';
|
||||
}
|
||||
|
||||
$ld = new Language(DI::l10n()->getAvailableLanguages());
|
||||
$availableLanguages = DI::l10n()->getAvailableLanguages();
|
||||
// See https://github.com/friendica/friendica/issues/10511
|
||||
// Persian is manually added to language detection until a persian translation is provided for the interface, at
|
||||
// which point it will be automatically available through `getAvailableLanguages()` and this should be removed.
|
||||
$availableLanguages['fa'] = 'fa';
|
||||
|
||||
$ld = new Language($availableLanguages);
|
||||
$languages = $ld->detect($naked_body)->limit(0, 3)->close();
|
||||
if (is_array($languages)) {
|
||||
return json_encode($languages);
|
||||
|
|
Loading…
Reference in a new issue