Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6ef9c03
#792 Remove languages from admin menu
j3nsch Apr 21, 2026
88ffcfe
#792 Remove Language form and elements
j3nsch Apr 22, 2026
899ad3d
#792 Use opus4-i18n for Language form element
j3nsch Apr 22, 2026
bf5e68e
#792 Remove languages from default SQL
j3nsch Apr 22, 2026
b3b9579
#792 Remove Language form translations
j3nsch Apr 22, 2026
358f861
#792 Remove LanguageController
j3nsch Apr 22, 2026
d81305f
#792 Remove Languages from access control tests
j3nsch Apr 23, 2026
20d0ae6
#792 Use new Languages class
j3nsch Apr 23, 2026
bcaceae
#792 Old Language class not used anymore
j3nsch Apr 23, 2026
2d77e18
#792 Use dev dependencies
j3nsch Apr 23, 2026
e03c1a4
#1469 Use lang ref name if not translated
j3nsch Apr 23, 2026
3a495a2
#792 If no active languages configured, use all
j3nsch Apr 23, 2026
afde995
#792 Fixed coding style
j3nsch Apr 23, 2026
b413f0f
#1469 Do not use local lang translations
j3nsch Apr 24, 2026
8efb47d
#792 Log missing languages
j3nsch Apr 27, 2026
5525547
#1469 Move ref-name fallback to opus4-i18n
j3nsch Apr 27, 2026
0fdaf47
#792 Use part2_b for default languages
j3nsch Apr 27, 2026
bec74ee
#792 Support adding local languages
j3nsch Apr 27, 2026
3ca3afe
#866 Normalize lang ID for form element
j3nsch Apr 29, 2026
618a9c7
#792 Depend on dev framework
j3nsch May 8, 2026
a6f71a1
Merge branch 'v4.10' into lang792
j3nsch May 8, 2026
7581fe4
#792 Do not reset configuration table
j3nsch May 8, 2026
e475617
#792 Add prefix i18n to language options
j3nsch May 8, 2026
bedbe30
#792 Removed old languages translation test
j3nsch May 8, 2026
04ebb3d
#792 Removed unused use statement
j3nsch May 8, 2026
562e09d
#1477 Removing resource_languages
j3nsch May 8, 2026
b15b41d
#1477 Make update script executable
j3nsch May 8, 2026
feb618c
#1477 Remove resource_languages
j3nsch May 8, 2026
5355e92
#792 Added languages config to admin UI
j3nsch May 10, 2026
4097085
#792 Use proper ISO 639 codes for deu, fra
j3nsch May 11, 2026
a061574
#867 Add instructions for defining options
j3nsch May 11, 2026
1f15e98
#1460 Updated release notes
j3nsch May 11, 2026
490a572
#792 Fixed trim with null
j3nsch May 11, 2026
ed11680
#792 Updated unit test
j3nsch May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,31 @@

## Release 4.10 - 2026-05-12

### Update
Der neue Release bringt insbesondere Veränderungen bei der Sprachverwaltung und
den Optionen, die in der Administration editierbar sind.

### Update auf OPUS 4.10

Das Updateskript, `bin/update.sh`, muss ausgeführt werden, da es Änderungen an
der Datenbank und weitere Updateschritte gibt.

- Tabelle `configuration` wird angelegt
- Tabelle `languages` wird entfernt
- Konfiguration in `config.xml` with in die Datenbank übertragen und die
Datei optional gelöscht
- Aktive Sprachen werden in neue Konfigurationsoptionen übernommen

Das Updateskript muss ausgeführt werden, da es Änderungen an der Datenbank und
zusätzliche Updateschritte gibt.
### Sprachverwaltung

Die Sprachverwaltung wurde aus der Administration entfernt. Dafür werden jetzt
485 ISO 639 Sprachen im Standard unterstützt. Welche Sprachen in den Formularen
zur Auswahl stehen sollen, lässt sich über Optionen einstellen.

Mehr dazu findet sich im OPUS 4 Handbuch unter
https://www.opus-repository.org/userdoc/admin/languages.html

Beim Update werden die aktiven Sprachen automatisch in die neue Konfiguration
übernommen.

### Konfiguration

Expand All @@ -18,8 +39,6 @@ Die editierbaren Optionen werden nun in `application/configs/options.yml`
definiert. Generell kann die Liste lokal erweitert werden. Im Standard werden
im Laufe der Zeit mehr Optionen in der Weboberfläche verfügbar gemacht werden.

TODO Link to documentation

### RSS-Links

RSS-Links können nun ausgeblendet werden. Sie werden automatisch ausgeblendet,
Expand Down
6 changes: 5 additions & 1 deletion application/configs/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ db.debug = 0
; LOCALE SETTINGS
resources.locale.default = 'de'

; SUPPORTED LANGUAGES
; Languages selectable for documents
i18n.languages.active = deu, eng, fra, rus, spa, mul
i18n.languages.sortByName = 0

; SUPPORTED USER INTERFACE LANGUAGES
supportedLanguages = de,en

;GENERAL SETTINGS
Expand Down
44 changes: 0 additions & 44 deletions application/configs/navigationModules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -364,50 +364,6 @@
</pages>
</licence>

<languages>
<type>mvc</type>
<label>admin_title_languages</label>
<description>admin_title_languages_description</description>
<group>group-cafelatte</group>
<module>admin</module>
<controller>language</controller>
<action>index</action>
<resource>languages</resource>
<pages>
<show>
<type>mvc</type>
<label>admin_language_show</label>
<module>admin</module>
<controller>language</controller>
<action>show</action>
</show>

<new>
<type>mvc</type>
<label>admin_language_new</label>
<module>admin</module>
<controller>language</controller>
<action>new</action>
</new>

<edit>
<type>mvc</type>
<label>admin_language_edit</label>
<module>admin</module>
<controller>language</controller>
<action>edit</action>
</edit>

<delete>
<type>mvc</type>
<label>admin_language_delete</label>
<module>admin</module>
<controller>language</controller>
<action>delete</action>
</delete>
</pages>
</languages>

<dnbInstitute>
<type>mvc</type>
<label>admin_title_dnbinstitute</label>
Expand Down
35 changes: 35 additions & 0 deletions application/configs/options.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
#
# Defines options available in administration user interface (Settings->Options).
#
# The 'type' defines how the option appears in the form. Supported types are
# - string (default)
# - int
# - bool
#
# The 'section' allows grouping options. The names are arbitrary and are used as section
# labels if no translations for the section exist.
#
# 'options' can be used to pass additional options to the form element, for
# instance to increase the size.
#
# The translation keys for options use the following patterns:
# - admin_config_section_SECTIONNAME
# - admin_config_OPTIONKEY
# - admin_config_OPTIONKEY_description
#
# For instance:
# - admin_config_section_languages
# - admin_config_i18n.languages.active
# - admin_config_i18n.languages.active_description
#

searchengine.solr.parameterDefaults.rows:
type: int
section: searching
Expand All @@ -7,3 +32,13 @@ searchengine.solr.parameterDefaults.rows:
browsing.series.sortByTitle:
type: bool
section: browsing

i18n.languages.active:
type: string
section: languages
options:
size: 60

i18n.languages.sortByName:
type: bool
section: languages
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"ext-yaml": "*",
"opus4/zf1-future": "1.25.*",
"jpgraph/jpgraph": "dev-master",
"opus4-repo/opus4-common": "^4.9",
"opus4-repo/framework": "dev-master as 4.10",
"opus4-repo/opus4-common": "dev-master as 4.10",
"opus4-repo/framework": "dev-lang407 as 4.10",
"opus4-repo/search": "^4.9",
"opus4-repo/opus4-bibtex": "^4.9",
"opus4-repo/opus4-import": "^4.9",
Expand All @@ -34,6 +34,7 @@
"opus4-repo/opus4-sword": "^4.9",
"opus4-repo/opus4-app-common": "dev-main as 4.10",
"opus4-repo/opus4-deepgreen": "^4.9",
"opus4-repo/opus4-i18n": "dev-main as 4.10",
"components/jquery": "3.4.*",
"components/jqueryui": "1.12.*",
"oomphinc/composer-installers-extender": "^2.0",
Expand Down
44 changes: 0 additions & 44 deletions db/masterdata/002_create_languages.sql

This file was deleted.

2 changes: 1 addition & 1 deletion db/masterdata/022-set-opus-version.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ START TRANSACTION;
-- Set internal OPUS version (for controlling updates)

TRUNCATE TABLE `opus_version`;
INSERT INTO `opus_version` (`version`) VALUES (21);
INSERT INTO `opus_version` (`version`) VALUES (22);

COMMIT;

Expand Down
8 changes: 1 addition & 7 deletions library/Application/Controller/Action/Helper/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

use Opus\Common\Enrichment;
use Opus\Document;
use Opus\Language;

/**
* Helper for handling translations.
Expand Down Expand Up @@ -103,12 +102,7 @@ public function getKeyForField($modelName, $fieldName)
$translationKey = $this->normalizeModelName($modelName) . '_' . $fieldName;
return preg_replace('/Opus_Common_/', 'Opus_', $translationKey); // TODO LAMINAS fix keys
} else {
switch ($modelName) {
case Language::class:
return $this->normalizeModelName($modelName) . '_' . $fieldName;
default:
return $fieldName;
}
return $fieldName;
}
}

Expand Down
81 changes: 77 additions & 4 deletions library/Application/Form/Element/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
* @license http://www.gnu.org/licenses/gpl.html General Public License
*/

use Opus\Common\Language;
use Opus\App\Common\Configuration;
use Opus\Common\Log;
use Opus\I18n\I18nException;
use Opus\I18n\Languages;

/**
* TODO override setLabel for more robust translation
Expand All @@ -52,6 +55,23 @@ public function init()
}
}

/**
* @param string|null $value
* @return void
*/
public function setValue($value)
{
if ($value !== null) {
$language = Languages::getLanguage($value);

if (null !== $language) {
$value = $language->getId();
}
}

parent::setValue($value);
}

/**
* @return array
*/
Expand All @@ -65,15 +85,68 @@ public static function getLanguageList()

/**
* Setup language list.
*
* TODO reduce responsibilities of this function
*/
public static function initLanguageList()
{
$config = Configuration::getInstance()->getConfig();

if (! isset($config->i18n->languages->active)) {
throw new Exception('no active languages configured');
}

$optionValue = $config->i18n->languages->active;

if (strlen(trim($optionValue)) > 0) {
// Use configured languages
$activeLanguages = explode(',', $optionValue);
} else {
// Use all languages
$helper = new Languages();
$activeLanguages = array_keys($helper->getAllAsArray());
}

$activeLanguages = array_filter($activeLanguages, function ($lang) {
return ! empty($lang);
});

if (isset($config->i18n->languages->local)) {
$localLanguages = $config->i18n->languages->local->toArray();
$languages = new Languages();
try {
$languages->addLanguages($localLanguages);
} catch (I18nException $ex) {
Log::get()->err('Error loading local languages: ' . $ex->getMessage());
}
}

$translate = Application_Translate::getInstance();
$locale = $translate->getLocale();

$languages = [];
foreach (Language::getAllActiveTable() as $languageRow) {
$langId = $languageRow['part2_t'];
$languages[$langId] = $translate->translateLanguage($langId);

foreach ($activeLanguages as $lang) {
$part2b = trim($lang);
$language = Languages::getLanguage($part2b);

if ($language === null) {
Log::get()->err("Language '{$part2b}' not found");
continue;
}

$langId = $language->getPart2t();
$translation = $language->getDisplayName($locale);

// TODO support local translations

$languages[$langId] = $translation;
}

if (isset($config->i18n->languages->sortByName) && filter_var($config->i18n->languages->sortByName, FILTER_VALIDATE_BOOLEAN)) {
asort($languages);
}

self::$languageList = $languages;
}
}
44 changes: 0 additions & 44 deletions library/Application/Form/Element/LanguageType.php

This file was deleted.

Loading